HAPI::Class Class Reference

The Class class is one of the principal structures in HUGIN. More...

Inheritance diagram for HAPI::Class:
HAPI::NetworkModel

List of all members.

Public Member Functions

 Class (ClassCollection *cColl)
 Create a new Class object, contained in the given ClassCollection.
DomaincreateDomain () const
 Instantiate this Class to a Domain.
ClassCollectiongetClassCollection () const
 Return the ClassCollection, in which this Class is contained.
NodeList getInputs () const
 Get a list of all Nodes in this Class, which have been added to the inputs of the Class.
NodeList getInstances () const
 Get a list of all InstanceNodes created from this Class.
std::string getName ()
 Retrieve the name of this Class.
NodeList getOutputs () const
 Get a list of all Nodes in this Class, which have been added to the outputs of the Class.
void setName (const char *name)
 Set the name of this Class.
void setName (const std::string &name)
 Set the name of this Class.
 ~Class () throw ()
 Destruct a Class object.

Detailed Description

The Class class is one of the principal structures in HUGIN.

When using the Object Oriented features of HUGIN, Classes must be used for creating the networks. Furthermore, all Classes which are to be used as instances in a given Class must be contained in the same ClassCollection as this.

Classes cannot, however, be used for inference. For this purpose, it is necessary to instantiate the Class into a Domain, which can be used for performing inference.

See also:
ClassCollection
Domain
Node

Constructor & Destructor Documentation

HAPI::Class::Class ( ClassCollection cColl  )  [explicit]

Create a new Class object, contained in the given ClassCollection.

Parameters:
cColl A pointer to the ClassCollection in which the newly constructed Class should be placed.

Member Function Documentation

Domain* HAPI::Class::createDomain (  )  const

Instantiate this Class to a Domain.

This is required before any inference can be made. This operation will "unfold" the object oriented parts of the network, so that the Domain will be a standard HUGIN Domain.

Returns:
The newly constructed Domain.
ClassCollection* HAPI::Class::getClassCollection (  )  const

Return the ClassCollection, in which this Class is contained.

A Class can only be contained in a single ClassCollection, so if a given Class definition is needed in more than one ClassCollection, a copy of the Class must be created in each ClassCollection, and changes to one version of the Class will not be reflected in the others.

Returns:
The ClassCollection containing this Class
NodeList HAPI::Class::getInputs (  )  const

Get a list of all Nodes in this Class, which have been added to the inputs of the Class.

Returns:
A NodeList containing all input nodes for the Class.
See also:
Node::addToInputs
NodeList HAPI::Class::getInstances (  )  const

Get a list of all InstanceNodes created from this Class.

Returns:
A NodeList containing the instances
See also:
InstanceNode
std::string HAPI::Class::getName (  ) 

Retrieve the name of this Class.

If no name has been assigned to the Class, one will be automatically generated by HUGIN.

Returns:
The name of this Class
NodeList HAPI::Class::getOutputs (  )  const

Get a list of all Nodes in this Class, which have been added to the outputs of the Class.

Returns:
A NodeList containing all output nodes for the Class.
See also:
Node::addToOutputs
void HAPI::Class::setName ( const char *  name  ) 

Set the name of this Class.

Parameters:
name The name which is given to this Class
void HAPI::Class::setName ( const std::string &  name  ) 

Set the name of this Class.

Parameters:
name The name which is given to this Class

Copyright Hugin Expert A/S 1993-2010