A ClassCollection is one of the principal structures in HUGIN. More...
Public Member Functions | |
ClassCollection () | |
Construct a new empty ClassCollection object. | |
Class * | getClassByName (const std::string &name) const |
Retrieves a Class from the ClassCollection, identified by its name. | |
ClassList | getMembers () const |
Retrieve a ClassList containing all the Classes contained in this ClassCollection. | |
void | parseClasses (const std::string &fileName, ClassParseListener *listener) |
Parse the given net into a Class. | |
void | saveAsNet (const std::string &fileName) |
Save the ClassCollection as a NET file. |
A ClassCollection is one of the principal structures in HUGIN.
All classes must be contained in a ClassCollection, and Classes can only contain instances of Classes contained in the same ClassCollection. That is, each Class may contain instances of other Classes of the ClassCollection, but not of Classes of other ClassCollections.
Class* HAPI::ClassCollection::getClassByName | ( | const std::string & | name | ) | const |
Retrieves a Class from the ClassCollection, identified by its name.
name | The name of the Class to return. |
ClassList HAPI::ClassCollection::getMembers | ( | ) | const |
Retrieve a ClassList containing all the Classes contained in this ClassCollection.
void HAPI::ClassCollection::parseClasses | ( | const std::string & | fileName, | |
ClassParseListener * | listener | |||
) |
Parse the given net into a Class.
This may involve parsing additional nets located in the same file, or in separate files. All the created Classes are inserted into the ClassCollection. When the Class to load references other classes, placed in different files, it is the responsibility of the user to provide a function for locating the files for these classes, and insert them into the ClassCollection. This is done by overloading the insertClass () function in the ClassParseListener class.
void HAPI::ClassCollection::saveAsNet | ( | const std::string & | fileName | ) |
Save the ClassCollection as a NET file.
This will write the definition of each Class from the ClassCollection into the same netfile.
fileName | The name of the file in which to save the ClassCollection. |