diff options
Diffstat (limited to 'generic/arch_pybindings.h')
-rw-r--r-- | generic/arch_pybindings.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/arch_pybindings.h b/generic/arch_pybindings.h index 72d688dc..f0daccbc 100644 --- a/generic/arch_pybindings.h +++ b/generic/arch_pybindings.h @@ -76,6 +76,18 @@ template <> struct string_converter<PipId> } }; +template <> struct string_converter<const PipId &> +{ + PipId from_str(Context *ctx, std::string name) { return ctx->getPipByNameStr(name); } + + std::string to_str(Context *ctx, const PipId &id) + { + if (id == PipId()) + throw bad_wrap(); + return ctx->getPipName(id).str(ctx); + } +}; + template <> struct string_converter<BelPin> { BelPin from_str(Context *ctx, std::string name) |