class NetworkModel

NetworkModel is the ancestor of both Domain and Class

Inheritance:


Public Methods

virtual void saveAsNet(const std::string& filename) throw(ExceptionHugin)
Write a NET description of the networkModel to a file
virtual std::string getAttribute(std::string& key) const throw( ExceptionHugin )
Return the value associated with key in the attribute list for this NetworkModel
virtual std::string getFileName() throw( ExceptionHugin )
Return the file name most recently used for loading or saving this NetworkModel
virtual NodeList getNodes() const throw(ExceptionHugin)
Return the Nodes of this NetworkModel
virtual Node* getNodeByName(const std::string& name) const throw( ExceptionHugin )
Return the node in the NetworkModel, which is identified by the given name
void* getUserData() throw(ExceptionHugin)
Return the value stored within the user data slot of this NetworkModel
virtual void setAttribute(std::string& key, std::string& value) throw(ExceptionHugin)
Insert the key/value pair in the attribute list for this NetworkModel
virtual void setLogFile(FILE *log) throw( ExceptionHugin )
Set the file to be used for logging by subsequent compilation, triangulation, and table generation operations
void setUserData(void *data) throw(ExceptionHugin)
Set the user data field of this NetworkModel
virtual bool hasAttribute(const std::string& key) throw(ExceptionHugin)
Test if this NetworkModel contains an attribute with the specified key
virtual std::pair <unsigned int,unsigned int> getNodeSize() throw(ExceptionHugin)
Return the size of the displayed nodes
virtual void setNodeSize(unsigned int width, unsigned int height) throw(ExceptionHugin)
Set the size of the nodes
virtual std::vector <Attribute*> getAttributes() throw( ExceptionHugin )
Return all the attributes associated with this NetworkModel
virtual void generateTables() throw( ExceptionHugin )
Generate tables for all Nodes, having a Model, in the NetworkModeL

Documentation

NetworkModel is the ancestor of both Domain and Class. Since Class and Domain are, in many ways, conceptually and functionally similar, the NetworkModel class is introduced to capture this similarity. It contains functionality and variables that are identical for the two classes.
virtual void saveAsNet(const std::string& filename) throw(ExceptionHugin)
Write a NET description of the networkModel to a file.
Parameters:
filename - The name of the file to save to.

virtual std::string getAttribute(std::string& key) const throw( ExceptionHugin )
Return the value associated with key in the attribute list for this NetworkModel
Returns:
Standard C++ Library string containing the attribure value.

virtual std::string getFileName() throw( ExceptionHugin )
Return the file name most recently used for loading or saving this NetworkModel
Returns:
A Standard C++ Library string.

virtual NodeList getNodes() const throw(ExceptionHugin)
Return the Nodes of this NetworkModel. No ordering can be inferred by the user.
Returns:
NodeList containing the Nodes of this Domain.

virtual Node* getNodeByName(const std::string& name) const throw( ExceptionHugin )
Return the node in the NetworkModel, which is identified by the given name
Parameters:
name - A Standard C++ string containing the name of the node to be found in this NetworkModel. @output Reference to a node in the NetworkModel carrying the name specified by the input. On error an exception will be thrown.

void* getUserData() throw(ExceptionHugin)
Return the value stored within the user data slot of this NetworkModel. If the stored value is NULL, or if no value has been stored, NULL is returned. It is the responsibility of the application programmer to ensure that the data is valid, that pointers are accessed correctly, etc.

Also note that when you delete a NetworkModel, Hugin does not attempt to delete the data pointed to by the user data slot. It is the responsibility of the user.

Returns:
Pointer stored within the NetworkModel object as a reference to user data associated with this NetworkModel.

virtual void setAttribute(std::string& key, std::string& value) throw(ExceptionHugin)
Insert the key/value pair in the attribute list for this NetworkModel. If the key is already defined, the value is updated. If no value is provided, the attribute is removed.

Parameters:
key - A Standard C++ Library string.
value - A Standard C++ Library string.

virtual void setLogFile(FILE *log) throw( ExceptionHugin )
Set the file to be used for logging by subsequent compilation, triangulation, and table generation operations.

Parameters:
log - File pointer to an opened file to be used as log. log must be a text file opened for writing or appending. Writing is done sequentially.

void setUserData(void *data) throw(ExceptionHugin)
Set the user data field of this NetworkModel. The Hugin API provides a slot within each NetworkModel object for use exclusively by the user/application. This slot can hold a pointer to arbitrary data, such as a file, a function pointer, etc. Please note that Hugin does not do anything to the user data. Data is not even copied. Only the pointer to the data is stored.

Parameters:
data - Pointer to user-defined data associated with <tt>*this</tt> NetworkModel.

virtual bool hasAttribute(const std::string& key) throw(ExceptionHugin)
Test if this NetworkModel contains an attribute with the specified key
Returns:
boolean
Parameters:
key - A Standar C++ Library string.

virtual std::pair <unsigned int,unsigned int> getNodeSize() throw(ExceptionHugin)
Return the size of the displayed nodes
Returns:
Standard C++ Library pair<int,int>.

virtual void setNodeSize(unsigned int width, unsigned int height) throw(ExceptionHugin)
Set the size of the nodes
Parameters:
width -
height -

virtual std::vector <Attribute*> getAttributes() throw( ExceptionHugin )
Return all the attributes associated with this NetworkModel
Returns:
A vector of all Attributes

virtual void generateTables() throw( ExceptionHugin )
Generate tables for all Nodes, having a Model, in the NetworkModeL. This is done by calling Node::GenerateTable() for each applicable Node. The operation is aborted, if table generation fails for some Node. This may leave the NetworkModel in a state, where some Nodes have got generated Tables, some have not got generated Tables, and one has a partially generated Table. In this case, an Exception is thrown.


Direct child classes:
Domain
Class
See Also:
Class
Domain

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de