My Project
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
DDLNode Class Reference

This class represents one single instance in the object tree of the parsed OpenDDL-file. More...

#include <DDLNode.h>

Public Types

typedef std::vector< DDLNode * > DllNodeList
 The child-node-list type.
 

Public Member Functions

 ~DDLNode ()
 The class destructor.
 
void attachParent (DDLNode *parent)
 Will attach a parent node instance, an older one will be released. More...
 
void detachParent ()
 Will try to detach a parent node instance, if there is any.
 
DDLNodegetParent () const
 Returns the assigned parent node instance, will return ddl_nullptr id no parent is assigned. More...
 
const DllNodeListgetChildNodeList () const
 Returns the child node list. More...
 
void setType (const std::string &type)
 
const std::string & getType () const
 Returns the type of the DDLNode instance. More...
 
void setName (const std::string &name)
 
const std::string & getName () const
 Returns the name of the DDLNode instance. More...
 
void setProperties (Property *prop)
 Set a new property set. More...
 
PropertygetProperties () const
 Returns the first element of the assigned property set. More...
 
bool hasProperty (const std::string &name)
 Looks for a given property. More...
 
PropertyfindPropertyByName (const std::string &name)
 Search for a given property and returns it. Will return ddl_nullptr if no property was found. More...
 
void setValue (Value *val)
 Set a new value set. More...
 
ValuegetValue () const
 Returns the first element of the assigned value set. More...
 
void setDataArrayList (DataArrayList *dtArrayList)
 Set a new DataArrayList. More...
 
DataArrayListgetDataArrayList () const
 Returns the DataArrayList. More...
 
void setReferences (Reference *refs)
 Set a new Reference set. More...
 
ReferencegetReferences () const
 Returns the first element of the assigned Reference set. More...
 

Static Public Member Functions

static DDLNodecreate (const std::string &type, const std::string &name, DDLNode *parent=ddl_nullptr)
 The creation method. More...
 

Friends

class OpenDDLParser
 

Detailed Description

This class represents one single instance in the object tree of the parsed OpenDDL-file.

A DDLNode represents one leaf in the OpenDDL-node tree. It can have one parent node and multiple children. You can assign special properties to a single DDLNode instance. A node instance can store values via a linked list. You can get the first value from the DDLNode. A node can store data-array-lists and references as well.

Member Function Documentation

void DDLNode::attachParent ( DDLNode parent)

Will attach a parent node instance, an older one will be released.

Parameters
parent[in] The parent node instance.
static DDLNode* DDLNode::create ( const std::string &  type,
const std::string &  name,
DDLNode parent = ddl_nullptr 
)
static

The creation method.

Parameters
type[in] The DDLNode type.
name[in] The name for the new DDLNode instance.
parent[in] The parent node instance or ddl_nullptr if no parent node is there.
Returns
The new created node instance.
Property* DDLNode::findPropertyByName ( const std::string &  name)

Search for a given property and returns it. Will return ddl_nullptr if no property was found.

Parameters
name[in] The name for the property to look for.
Returns
The property or ddl_nullptr if no property was found.
const DllNodeList& DDLNode::getChildNodeList ( ) const

Returns the child node list.

Returns
The list of child nodes.
DataArrayList* DDLNode::getDataArrayList ( ) const

Returns the DataArrayList.

Returns
The DataArrayList.
const std::string& DDLNode::getName ( ) const

Returns the name of the DDLNode instance.

Returns
The name of the DDLNode instance.
DDLNode* DDLNode::getParent ( ) const

Returns the assigned parent node instance, will return ddl_nullptr id no parent is assigned.

Returns
The parent node instance.
Property* DDLNode::getProperties ( ) const

Returns the first element of the assigned property set.

Returns
The first property of the assigned property set.
Reference* DDLNode::getReferences ( ) const

Returns the first element of the assigned Reference set.

Returns
The first property of the assigned Reference set.
const std::string& DDLNode::getType ( ) const

Returns the type of the DDLNode instance.

Returns
The type of the DDLNode instance.
Value* DDLNode::getValue ( ) const

Returns the first element of the assigned value set.

Returns
The first property of the assigned value set.
bool DDLNode::hasProperty ( const std::string &  name)

Looks for a given property.

Parameters
name[in] The name for the property to look for.
Returns
true, if a corresponding property is assigned to the node, false if not.
void DDLNode::setDataArrayList ( DataArrayList dtArrayList)

Set a new DataArrayList.

Parameters
val[in] The DataArrayList instance.
void DDLNode::setName ( const std::string &  name)

Set the name of the DDLNode instance.

Parameters
type[in] The name.
void DDLNode::setProperties ( Property prop)

Set a new property set.

Parameters
prop[in] The first element of the property set.
void DDLNode::setReferences ( Reference refs)

Set a new Reference set.

Parameters
val[in] The first value instance of the Reference set.
void DDLNode::setType ( const std::string &  type)

Set the type of the DDLNode instance.

Parameters
type[in] The type.
void DDLNode::setValue ( Value val)

Set a new value set.

Parameters
val[in] The first value instance of the value set.

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