HAPI::ClassCollection Class Reference

A ClassCollection is one of the principal structures in HUGIN. More...

List of all members.

Public Member Functions

 ClassCollection ()
 Construct a new empty ClassCollection object.
ClassgetClassByName (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.

Detailed Description

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.

See also:
Class

Member Function Documentation

Class* HAPI::ClassCollection::getClassByName ( const std::string &  name  )  const

Retrieves a Class from the ClassCollection, identified by its name.

Parameters:
name The name of the Class to return.
Returns:
A pointer to the Class with the given name.
ClassList HAPI::ClassCollection::getMembers (  )  const

Retrieve a ClassList containing all the Classes contained in this ClassCollection.

Returns:
A ClassList containing all members of the 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.

See also:
ClassParseListener
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.

Parameters:
fileName The name of the file in which to save the ClassCollection.

Copyright Hugin Expert A/S 1993-2010