Public Member Functions

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.
 ClassCollection (const std::string &filename)
 Construct a class collection by loading the corresponding Hugin Knowledge Base (HKB) file.
 ClassCollection (const std::string &filename, const std::string &password)
 Construct a class collection by loading the corresponding password protected Hugin Knowledge Base (HKB) file.
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 &netStringOrFileName, ClassParseListener *listener)
 Construct one or more classes from a NET file or a NET description given as a string.
void saveAsKB (const std::string &filename, const std::string &password)
 Save this ClassCollection as a password protected Hugin Knowledge Base (HKB) file.
void saveAsKB (const std::string &filename)
 Save this ClassCollection as a Hugin Knowledge Base (HKB) file.
void saveAsNet (const std::string &netName)
 Save a NET description of this ClassCollection to a file.
std::string toNetString () const
 Create a NET description of this ClassCollection.

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

Constructor & Destructor Documentation

HAPI::ClassCollection::ClassCollection ( const std::string &  filename ) [explicit]

Construct a class collection by loading the corresponding Hugin Knowledge Base (HKB) file.

The HKB file must contain a class collection.

Parameters:
filenamethe name of the HKB file
HAPI::ClassCollection::ClassCollection ( const std::string &  filename,
const std::string &  password 
)

Construct a class collection by loading the corresponding password protected Hugin Knowledge Base (HKB) file.

The HKB file must contain a class collection. If the given password does not match the password stored in the HKB file, an exception is thrown.

Parameters:
filenamethe name of the HKB file
passwordthe password of the HKB file

Member Function Documentation

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

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

Parameters:
nameThe 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 &  netStringOrFileName,
ClassParseListener listener 
)

Construct one or more classes from a NET file or a NET description given as a string.

See also:
ClassParseListener
Parameters:
netStringOrFileNamea string containing a NET description or the name of a NET file
pla ClassParseListener.
void HAPI::ClassCollection::saveAsKB ( const std::string &  filename )

Save this ClassCollection as a Hugin Knowledge Base (HKB) file.

Parameters:
filenamename of the HKB file
void HAPI::ClassCollection::saveAsKB ( const std::string &  filename,
const std::string &  password 
)

Save this ClassCollection as a password protected Hugin Knowledge Base (HKB) file.

Parameters:
filenamename of the HKB file
passwordthe password for the HKB file.
void HAPI::ClassCollection::saveAsNet ( const std::string &  netName )

Save a NET description of this ClassCollection to a file.

Parameters:
netNameThe name of the NET file.
std::string HAPI::ClassCollection::toNetString (  ) const

Create a NET description of this ClassCollection.

Returns:
A string containing the NET description.

Copyright Hugin Expert A/S 1993-2024