This is a handy class for guaranteeing unique node names in an egg hierarchy.
More...
Public Member Functions |
| bool | add_name (const string &category, const string &name, EggNode *node=NULL) |
| | Adds the name to the indicated category.
|
| void | clear () |
| | Empties the table of used named and prepares the Uniquifier for a new tree.
|
| virtual string | filter_name (EggNode *node) |
| | Returns the name of the given node, or at least the name it should be.
|
|
virtual TypeHandle | force_init_type () |
| virtual string | generate_name (EggNode *node, const string &category, int index) |
| | Generates a new name for the given node when its existing name clashes with some other node.
|
|
virtual string | get_category (EggNode *node)=0 |
| EggNode * | get_node (const string &category, const string &name) const |
| | Returns the node associated with the given category and name, or NULL if the name has not been used.
|
|
virtual TypeHandle | get_type () const |
| bool | has_name (const string &category, const string &name) const |
| | Returns true if the name has been used for the indicated category already, false otherwise.
|
| void | uniquify (EggNode *node) |
| | Begins the traversal from the indicated node.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
This is a handy class for guaranteeing unique node names in an egg hierarchy.
It is an abstract class; to use it you must subclass off of it. See the comment above.
Definition at line 88 of file eggNameUniquifier.h.
Returns the name of the given node, or at least the name it should be.
This provides a hook to adjust the name before attempting to uniquify it, if desired, for instance to remove invalid characters.
Reimplemented in EggGroupUniquifier.
Definition at line 180 of file eggNameUniquifier.cxx.
Referenced by generate_name(), and uniquify().
Generates a new name for the given node when its existing name clashes with some other node.
This function will be called repeatedly, if necessary, until it returns a name that actually is unique.
The category is the string returned by get_category(), and index is a uniquely-generated number that may be useful for synthesizing the name.
Reimplemented in EggGroupUniquifier.
Definition at line 197 of file eggNameUniquifier.cxx.
References filter_name().
Referenced by uniquify().