MXANode Class Reference

This class is a concrete implementation of the INode abstract class. It is meant to be subclassed by other classes that need to maintain parent/child relationships. More...

Inherits INode.

Inheritance diagram for MXANode:

Inheritance graph
[legend]
Collaboration diagram for MXANode:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Type {
  Root, FileVersion, FileType, DataModel,
  DataRoot, DataDimensions, Dimension, DataRecords,
  Record, MetaData, Required, UserDefined,
  DataPath, Data, Dataset
}
 Types that an INode can take. More...

Public Member Functions

 MXA_SHARED_POINTERS (MXANode)
 MXA_TYPE_MACRO (MXANode)
virtual ~MXANode ()
void setNodeType (int32 nodeType)
 Accessor for NodeType iVar.
int32 getNodeType ()
 Gets the node type.
std::string getNodeTypeString ()
 Returns the node type as a string.
virtual void setNodeName (std::string nodeName)
 Accessors for NodeName iVar.
std::string getNodeName ()
 Returns the Name of this node.
void setUniqueId (int32 aValue)
 Setter for property guid.
int32 getUniqueId ()
 Getter for property guid.
void resetGUIDValue ()
 Resets the GUID value for this node.
void setParent (MXANodeWeakPtr parent)
 Accessor for Parent iVar.
MXANodeWeakPtr getParent ()
 Returns the Parent Node.
int32 getNumChildren () const
 Returns the number of Children of this node.
bool hasChildren () const
 Returns TRUE if this node has children.
void addChild (MXANodePtr child)
void removeChild (int index)
 Removes a child from this node.
void removeChild (MXANodePtr child)
int32 indexOfChild (MXANodePtr child)
int32 indexOfChild (MXANode *child)
MXANodePtr getChildAt (int32 index)
 Returns a specific child of this node based on a given index.
MXANodeChildren & getChildren ()
 Returns a reference to the children of this node.
template<typename T>
void setAttribute (std::string key, T value)
void removeAttribute (std::string)
 Removes an Attribute from this node.
void printNodeTree (int32 depth=0)
 prints the node and the children of this node
virtual void printNode (std::ostream &os, int32 indentSize=0)
 prints the node and the children of this node
void _setWeakPtr (MXANodeWeakPtr weakPtr)

Static Public Member Functions

static void generateLUT (std::map< int32, MXANodePtr > &lut, MXANodes &nodes)
 Creates a flat look up table using the GUID of the data record as the key and the boost::Shared_ptr as the value.
static MXANodePtr New (int32 type, std::string nodeName)
 Used to create a new MXANode.
static std::string getNodeTypeAsString (int32 node_type)
 Returns the node type as a string.
static int32 nextGUIDValue ()

Static Public Attributes

static int32 _uniqueGUIDValue

Protected Member Functions

 MXANode ()
 MXANode (int32 nodeType, std::string nodeName)
std::string _indent (int)

Protected Attributes

std::string _nodeName
int32 _nodeType
int32 _uniqueId
MXANodeWeakPtr _selfPtr
MXANodeWeakPtr _parent
MXANodeChildren _children
Attributes _nodeAttributes

Private Member Functions

 MXANode (const MXANode &)
void operator= (const MXANode &)

Detailed Description

This class is a concrete implementation of the INode abstract class. It is meant to be subclassed by other classes that need to maintain parent/child relationships.

Author:
Mike Jackson
Date:
March 2007
Version:
Revision
1.2


Member Enumeration Documentation

enum MXANode::Type

Types that an INode can take.

Enumerator:
Root 
FileVersion 
FileType 
DataModel 
DataRoot 
DataDimensions 
Dimension 
DataRecords 
Record 
MetaData 
Required 
UserDefined 
DataPath 
Data 
Dataset 

Reimplemented from INode.


Constructor & Destructor Documentation

MXANode::~MXANode (  )  [virtual]

MXANode::MXANode (  )  [inline, protected]

MXANode::MXANode ( int32  nodeType,
std::string  nodeName 
) [protected]

MXANode::MXANode ( const MXANode  )  [private]


Member Function Documentation

MXANode::MXA_SHARED_POINTERS ( MXANode   ) 

MXANode::MXA_TYPE_MACRO ( MXANode   ) 

void MXANode::generateLUT ( std::map< int32, MXANodePtr > &  lut,
MXANodes &  nodes 
) [static]

Creates a flat look up table using the GUID of the data record as the key and the boost::Shared_ptr as the value.

Parameters:
lut The look up table to be populated.
nodes The nodes to use in the lookup table

MXANodePtr MXANode::New ( int32  type,
std::string  nodeName 
) [static]

Used to create a new MXANode.

Parameters:
type The Type of Node this is going to be
nodeName The Name of this node
Returns:
A Boost SharedPointer to the MXANode Object

void MXANode::setNodeType ( int32  nodeType  )  [virtual]

Accessor for NodeType iVar.

Implements INode.

int32 MXANode::getNodeType (  )  [virtual]

Gets the node type.

Returns:
The node type

Implements INode.

std::string MXANode::getNodeTypeString (  )  [virtual]

Returns the node type as a string.

Returns:
The Node type as a string

Implements INode.

std::string MXANode::getNodeTypeAsString ( int32  node_type  )  [static]

Returns the node type as a string.

Parameters:
node_type The type of node
Returns:
The node type as a string

Reimplemented from INode.

void MXANode::setNodeName ( std::string  nodeName  )  [virtual]

Accessors for NodeName iVar.

Implements INode.

std::string MXANode::getNodeName (  )  [virtual]

Returns the Name of this node.

Implements INode.

void MXANode::setUniqueId ( int32  aValue  )  [inline, virtual]

Setter for property guid.

Parameters:
aValue The new value to set for property guid

Implements INode.

int32 MXANode::getUniqueId (  )  [inline, virtual]

Getter for property guid.

Returns:
The value of guid

Implements INode.

void MXANode::resetGUIDValue (  )  [virtual]

Resets the GUID value for this node.

Implements INode.

int32 MXANode::nextGUIDValue (  )  [static]

void MXANode::setParent ( MXANodeWeakPtr  parent  ) 

Accessor for Parent iVar.

MXANodeWeakPtr MXANode::getParent (  )  [virtual]

Returns the Parent Node.

Implements INode.

int MXANode::getNumChildren (  )  const [virtual]

Returns the number of Children of this node.

Implements INode.

bool MXANode::hasChildren (  )  const [virtual]

Returns TRUE if this node has children.

Implements INode.

void MXANode::addChild ( MXANodePtr  child  ) 

void MXANode::removeChild ( int  index  )  [virtual]

Removes a child from this node.

Parameters:
index The index of the child to remove

Implements INode.

void MXANode::removeChild ( MXANodePtr  child  ) 

int32 MXANode::indexOfChild ( MXANodePtr  child  ) 

int32 MXANode::indexOfChild ( MXANode child  ) 

MXANodePtr MXANode::getChildAt ( int32  index  )  [virtual]

Returns a specific child of this node based on a given index.

Parameters:
index The index of the child to return
Returns:
The index of the child

Implements INode.

MXANodeChildren & MXANode::getChildren (  )  [virtual]

Returns a reference to the children of this node.

Implements INode.

template<typename T>
void MXANode::setAttribute ( std::string  key,
value 
) [inline]

void MXANode::removeAttribute ( std::string  attrName  )  [virtual]

Removes an Attribute from this node.

Parameters:
attrName The name of the attribute to remove

Implements INode.

void MXANode::printNodeTree ( int32  depth = 0  )  [virtual]

prints the node and the children of this node

Parameters:
depth The amount of indentation space

Implements INode.

void MXANode::printNode ( std::ostream &  os,
int32  indentSize = 0 
) [virtual]

prints the node and the children of this node

Parameters:
os An ostream to print the node to
indentSize The amount of indentation space

Implements INode.

void MXANode::_setWeakPtr ( MXANodeWeakPtr  weakPtr  ) 

std::string MXANode::_indent ( int   )  [protected]

void MXANode::operator= ( const MXANode  )  [private]


Member Data Documentation

int MXANode::_uniqueGUIDValue [static]

std::string MXANode::_nodeName [protected]

int32 MXANode::_nodeType [protected]

int32 MXANode::_uniqueId [protected]

MXANodeWeakPtr MXANode::_selfPtr [protected]

MXANodeWeakPtr MXANode::_parent [protected]

MXANodeChildren MXANode::_children [protected]

Attributes MXANode::_nodeAttributes [protected]


The documentation for this class was generated from the following files:
Generated on Tue Nov 17 18:43:15 2009 for MXADataModel by  doxygen 1.5.2