# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLLIGO::IPrimitive Class Reference

#include <primitive.h>

Inheritance diagram for NLLIGO::IPrimitive:

NLLIGO::CPrimNode NLLIGO::CPrimPath NLLIGO::CPrimPoint NLLIGO::CPrimZone List of all members.

Public Types

enum  { NotAnArray, AtTheEnd = 0xffffffff }

Public Methods

 IPrimitive ()
 ~IPrimitive ()
 IPrimitive (const IPrimitive &node)
IPrimitive * copy () const
virtual void operator= (const IPrimitive &node)
uint getNumChildren () const
 Get the children primitive count. More...

bool getChild (const IPrimitive *&result, uint childId) const
 Get a child primitive. More...

bool getChild (IPrimitive *&result, uint childId)
 Get a child primitive. More...

IPrimitive * getParent ()
 Get the parent primtive. More...

const IPrimitive * getParent () const
bool getChildId (uint &childId, const IPrimitive *child) const
 Get the id of the child, return 0xffffffff if not found. More...

bool removeChild (uint childId)
 Remove a child primitive. More...

void removeChildren ()
 Remove all children primitives. More...

bool insertChild (IPrimitive *primitive, uint index=AtTheEnd)
 Insert a child primitive before the index. More...

uint getNumProperty () const
 Get a num properties. More...

bool getProperty (uint index, std::string &property_name, const IProperty *&result) const
 Get a properties by its index This is method (iterate a list) is slower than getPropertyByName (look up in a map). More...

bool getProperty (uint index, std::string &property_name, IProperty *&result)
 Get a properties by its index This is method (iterate a list) is slower than getPropertyByName (look up in a map). More...

bool addPropertyByName (const char *property_name, IProperty *result)
 Add a property If the property already exist, the method does nothing and returns false. More...

bool getPropertyByName (const char *property_name, const IProperty *&result) const
 Get a property with its name. More...

bool getPropertyByName (const char *property_name, IProperty *&result)
 Get a property with its name. More...

bool getPropertyByName (const char *property_name, std::string *&result)
 Get a string property with its name. More...

bool getPropertyByName (const char *property_name, std::vector< std::string > *&result)
 Get a string array property with its name. More...

bool getPropertyByName (const char *property_name, std::string &result) const
 Get a string property with its name. More...

bool getPropertyByName (const char *property_name, const std::vector< std::string > *&result) const
 Get a string array property with its name. More...

bool getPropertyByName (const char *property_name, NLMISC::CRGBA &result) const
 Get a color property with its name. More...

bool removeProperty (uint index)
 Remove a property This is method (iterate a list) is slower than removePropertyByName (look up in a map). More...

bool removePropertyByName (const char *property_name)
 Remove a property by its name. More...

void removeProperties ()
 Remove all the properties. More...

virtual bool read (xmlNodePtr xmlNode, const char *filename, uint version)
virtual void write (xmlNodePtr xmlNode, const char *filename) const
virtual uint getNumVector () const=0
virtual const CPrimVectorgetPrimVector () const=0
virtual CPrimVectorgetPrimVector ()=0

Public Attributes

std::string Layer
std::string Name

Private Attributes

IPrimitive * _Parent
std::vector< IPrimitive * > _Children
std::map< std::string, IProperty * > _Properties

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
NotAnArray 
AtTheEnd 

Definition at line 139 of file primitive.h.


Constructor & Destructor Documentation

NLLIGO::IPrimitive::IPrimitive   [inline]
 

Definition at line 146 of file primitive.h.

References _Parent.

Referenced by copy, getParent, and read.

NLLIGO::IPrimitive::~IPrimitive  
 

Definition at line 1382 of file primitive.cpp.

References removeChildren, and removeProperties.

NLLIGO::IPrimitive::IPrimitive const IPrimitive &    node
 

Definition at line 909 of file primitive.cpp.

References _Parent.


Member Function Documentation

bool NLLIGO::IPrimitive::addPropertyByName const char *    property_name,
IProperty   result
 

Add a property If the property already exist, the method does nothing and returns false.

The pointer will be deleted by the primitive using the delete operator.

Definition at line 1393 of file primitive.cpp.

References _Properties.

IPrimitive * NLLIGO::IPrimitive::copy   const
 

Definition at line 917 of file primitive.cpp.

References _Children, _Properties, IPrimitive, and nlverify.

bool NLLIGO::IPrimitive::getChild IPrimitive *&    result,
uint    childId
 

Get a child primitive.

Definition at line 1316 of file primitive.cpp.

References _Children, and nlwarning.

bool NLLIGO::IPrimitive::getChild const IPrimitive *&    result,
uint    childId
const
 

Get a child primitive.

Definition at line 1300 of file primitive.cpp.

References _Children, and nlwarning.

bool NLLIGO::IPrimitive::getChildId uint   childId,
const IPrimitive *    child
const
 

Get the id of the child, return 0xffffffff if not found.

Definition at line 1657 of file primitive.cpp.

References _Children.

uint NLLIGO::IPrimitive::getNumChildren   const [inline]
 

Get the children primitive count.

Definition at line 160 of file primitive.h.

References _Children.

uint NLLIGO::IPrimitive::getNumProperty   const
 

Get a num properties.

Definition at line 1674 of file primitive.cpp.

References _Properties.

virtual uint NLLIGO::IPrimitive::getNumVector   const [pure virtual]
 

Implemented in NLLIGO::CPrimNode.

const IPrimitive* NLLIGO::IPrimitive::getParent   const [inline]
 

Definition at line 176 of file primitive.h.

References _Parent, and IPrimitive.

IPrimitive* NLLIGO::IPrimitive::getParent   [inline]
 

Get the parent primtive.

Definition at line 172 of file primitive.h.

References _Parent, and IPrimitive.

virtual CPrimVector* NLLIGO::IPrimitive::getPrimVector   [pure virtual]
 

Implemented in NLLIGO::CPrimNode.

virtual const CPrimVector* NLLIGO::IPrimitive::getPrimVector   const [pure virtual]
 

Implemented in NLLIGO::CPrimNode.

bool NLLIGO::IPrimitive::getProperty uint    index,
std::string &    property_name,
IProperty *&    result
 

Get a properties by its index This is method (iterate a list) is slower than getPropertyByName (look up in a map).

Definition at line 1094 of file primitive.cpp.

References _Properties, index, and nlwarning.

bool NLLIGO::IPrimitive::getProperty uint    index,
std::string &    property_name,
const IProperty *&    result
const
 

Get a properties by its index This is method (iterate a list) is slower than getPropertyByName (look up in a map).

Definition at line 1073 of file primitive.cpp.

References _Properties, index, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
NLMISC::CRGBA   result
const
 

Get a color property with its name.

Return false if the property is not found or is not a string array property.

Definition at line 1231 of file primitive.cpp.

References getPropertyByName, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
const std::vector< std::string > *&    result
const
 

Get a string array property with its name.

Return false if the property is not found or is not a string array property.

Definition at line 1209 of file primitive.cpp.

References getPropertyByName, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
std::string &    result
const
 

Get a string property with its name.

Return false if the property is not found or is not a string property.

Definition at line 1165 of file primitive.cpp.

References getPropertyByName, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
std::vector< std::string > *&    result
 

Get a string array property with its name.

Return false if the property is not found or is not a string array property.

Definition at line 1187 of file primitive.cpp.

References getPropertyByName, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
std::string *&    result
 

Get a string property with its name.

Return false if the property is not found or is not a string property.

Definition at line 1143 of file primitive.cpp.

References getPropertyByName, and nlwarning.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
IProperty *&    result
 

Get a property with its name.

Definition at line 1129 of file primitive.cpp.

References _Properties.

bool NLLIGO::IPrimitive::getPropertyByName const char *    property_name,
const IProperty *&    result
const
 

Get a property with its name.

Definition at line 1115 of file primitive.cpp.

References _Properties.

Referenced by getPropertyByName.

bool NLLIGO::IPrimitive::insertChild IPrimitive *    primitive,
uint    index = AtTheEnd
 

Insert a child primitive before the index.

The pointer will be deleted by the parent primitive using the delete operator. return false if the index is invalid

Definition at line 1361 of file primitive.cpp.

References _Children, AtTheEnd, and index.

Referenced by read.

void NLLIGO::IPrimitive::operator= const IPrimitive &    node [virtual]
 

Definition at line 1015 of file primitive.cpp.

References _Children, _Properties, nlverify, removeChildren, and removeProperties.

bool NLLIGO::IPrimitive::read xmlNodePtr    xmlNode,
const char *    filename,
uint    version
[virtual]
 

Reimplemented in NLLIGO::CPrimNode.

Definition at line 1405 of file primitive.cpp.

References _Properties, NLMISC::clamp, NLLIGO::GetContentString, NLLIGO::GetNodeString, NLLIGO::GetPropertyString, insertChild, IPrimitive, type, and NLLIGO::XMLError.

bool NLLIGO::IPrimitive::removeChild uint    childId
 

Remove a child primitive.

Definition at line 1332 of file primitive.cpp.

References _Children, and nlwarning.

void NLLIGO::IPrimitive::removeChildren  
 

Remove all children primitives.

Definition at line 1349 of file primitive.cpp.

References _Children.

Referenced by operator=, and ~IPrimitive.

void NLLIGO::IPrimitive::removeProperties  
 

Remove all the properties.

Definition at line 1287 of file primitive.cpp.

References _Properties.

Referenced by operator=, and ~IPrimitive.

bool NLLIGO::IPrimitive::removeProperty uint    index
 

Remove a property This is method (iterate a list) is slower than removePropertyByName (look up in a map).

Definition at line 1253 of file primitive.cpp.

References _Properties, index, and nlwarning.

bool NLLIGO::IPrimitive::removePropertyByName const char *    property_name
 

Remove a property by its name.

Definition at line 1273 of file primitive.cpp.

References _Properties.

void NLLIGO::IPrimitive::write xmlNodePtr    xmlNode,
const char *    filename
const [virtual]
 

Reimplemented in NLLIGO::CPrimNode.

Definition at line 1582 of file primitive.cpp.

References _Children, and _Properties.


Member Data Documentation

std::vector<IPrimitive*> NLLIGO::IPrimitive::_Children [private]
 

Definition at line 291 of file primitive.h.

Referenced by copy, getChild, getChildId, getNumChildren, insertChild, operator=, removeChild, removeChildren, and write.

IPrimitive* NLLIGO::IPrimitive::_Parent [private]
 

Definition at line 288 of file primitive.h.

Referenced by getParent, and IPrimitive.

std::map<std::string, IProperty*> NLLIGO::IPrimitive::_Properties [private]
 

Definition at line 294 of file primitive.h.

Referenced by addPropertyByName, copy, getNumProperty, getProperty, getPropertyByName, operator=, read, removeProperties, removeProperty, removePropertyByName, and write.

std::string NLLIGO::IPrimitive::Layer
 

Definition at line 136 of file primitive.h.

Referenced by NLLIGO::CPrimZone::serial, NLLIGO::CPrimPath::serial, and NLLIGO::CPrimPoint::serial.

std::string NLLIGO::IPrimitive::Name
 

Definition at line 137 of file primitive.h.

Referenced by NLLIGO::CPrimZone::serial, NLLIGO::CPrimPath::serial, and NLLIGO::CPrimPoint::serial.


The documentation for this class was generated from the following files: