Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

HAPI::ClassCollection Class Reference

List of all members.

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


Public Member Functions

 ClassCollection ()
 Construct a new empty ClassCollection object.

ClassList getMembers () const
 Retrieve a ClassList containing all the Classes contained in this ClassCollection.

ClassgetClassByName (const std::string &name) const
 Retrieves a Class from the ClassCollection, identified by its name.

void saveAsNet (const std::string &fileName)
 Save the ClassCollection as a net file.

void parseClasses (const std::string &fileName, ClassParseListener *listener)
 Parse the given net into a 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 reference to the Class with the given name. On error an exception will be thrown.

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-2004