Skip to content

Custom Node with Inherit<> #990

Answered by robertosfield
Anshi701 asked this question in Q&A
Discussion options

You must be logged in to vote

The read and write methods are just for reading and writing members to Input/Output, they are aren't for runtime behaviors.

The vsg::Switch node is now I would use to toggle on/off the traversal of a subgraph, so I wouldn't use custom node, it's just easier to decorate your subgraph with a vsg::Switch node and then use it's functionality to toggle on/off traversal.

If you really want to make a transform node that also acts as a switch then you could do the above but just read/write the isEnabled flag so that you have the support for reading/writing .vsgt/.vsgb files, then to implement isEnabled I'd override the virtual void accept(ConstVisitor&), virtual void accept(Visitor&) and virtual …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Anshi701
Comment options

@robertosfield
Comment options

@Anshi701
Comment options

Answer selected by robertosfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants