Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

DBObjectNode Class Reference

#include <dbobject.hpp>

Inheritance diagram for DBObjectNode:

Inheritance graph
[legend]
Collaboration diagram for DBObjectNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

Represents a DB mapped object node.

Definition at line 237 of file dbobject.hpp.

Public Methods

 DBObjectNode (const DBOBJDefinitionNode *p_pDBOBJDefNode)
 Constructor. Inits private data members.

 ~DBObjectNode ()
 Destructor. Releases private data members and deletes all fields and nodes descendants.

const char * getName () const
 Returns node name.

DBOBJSetAction getAction () const
 Return node's action constant.

DBObjectNode * getParent () const
 Returns node's parent node.

const DBOBJDefinitionNodegetDefinition () const
 Returns node's definition object.

void setAction (DBOBJSetAction p_intAction)
 Sets node's acion constant.

void setParent (DBObjectNode *p_DBOBJParentNode)
 Sets node's parent node.

void setDefinition (const DBOBJDefinitionNode *p_pDBOBJDefNode)
 Sets node's definition node.

void setValuable (XMLValuable *p_pValuableParent)
 Sets node's valuable object.

void addChildNode (DBObjectNode *p_pChildNode)
 Appends a child node object to this node.

void removeChildNode (unsigned int p_uiIndex, bool p_fDestroy=true)
 Removes a child node of this node.

void removeChildNode (const char *p_pszName, unsigned int p_uiIndex=0, bool p_fDestroy=true)
 Removes a named child node of this node.

unsigned int getChildNodesCount () const
 Returns the number of child nodes.

unsigned int getChildNodesCount (const char *p_pszName) const
 Returns the number of child nodes with given name.

DBObjectNode * getChildNode (unsigned int p_uiIndex) const
 Returns a child node.

DBObjectNode * getChildNode (const char *p_pszName, unsigned int p_uiIndex=0) const
 Returns a child node.

DBObjectNode * getCurrentChild ()
void movePreviousChild ()
void moveNextChild ()
void moveFirstChild ()
void moveLastChild ()
void addField (DBObjectField *p_pField)
 Appends a field object to this node.

void removeField (unsigned int p_uiIndex, bool p_fDestroy=true)
 Removes a field object from this node.

void removeField (const char *p_pszName, bool p_fDestroy=true)
 Removes a field object from this node.

unsigned int getFieldsCount () const
 Returns the number of fields objects.

DBObjectFieldgetField (unsigned int p_uiIndex) const
 Returns a field.

DBObjectFieldgetField (const char *p_pszName) const
 Returns a field.

DBObjectFieldgetCurrentField ()
void movePreviousField ()
void moveNextField ()
void moveFirstField ()
void moveLastField ()
void getXML (XMLStreamConsumer *p_pXMLBufOut)
 Returns the XML stream representating this object and its descendants.

DBObjectselectSingleNode (const char *p_pszPath)
 Returns a node or a field given by the path.

XMLValuablegetValuable ()
 Returns valuable object.

char * calculateRelValue (const char *p_pszExpr)
int getType () const
 Returns type of object.


Constructor & Destructor Documentation

DBObjectNode::DBObjectNode const DBOBJDefinitionNode   p_pDBOBJDefNode
 

Constructor. Inits private data members.

Parameters:
p_pDBOBJDefNode (DBOBJDefinitionNode*) Object node definition.

Definition at line 288 of file dbobject.cpp.

References DEBUG_CREATE, setAction(), and setDefinition().

DBObjectNode::~DBObjectNode  
 

Destructor. Releases private data members and deletes all fields and nodes descendants.

Definition at line 305 of file dbobject.cpp.

References DEBUG_DEL, and releaseCharBuffer().


Member Function Documentation

void DBObjectNode::addChildNode DBObjectNode *    p_pChildNode
 

Appends a child node object to this node.

Parameters:
p_pChildNode (DBObjectNode*) child node object to append.

Definition at line 420 of file dbobject.cpp.

References VAarray< DBObjectNode * >::add(), DEBUG_FUNC, getName(), and setParent().

Referenced by DBObjectSAXBuilder::endElement().

void DBObjectNode::addField DBObjectField   p_pField
 

Appends a field object to this node.

Parameters:
p_pField (DBObjectField*) Field object to append.

Definition at line 553 of file dbobject.cpp.

References VAarray< DBObjectField * >::add(), DEBUG_FUNC, DBObjectField::getName(), and DBObjectField::setParent().

Referenced by DBObjectSAXBuilder::endElement(), and DBObjectSAXBuilder::startElement().

char * DBObjectNode::calculateRelValue const char *    p_pszExpr
 

Definition at line 766 of file dbobject.cpp.

References XMLValuable::calculateValue(), getValuable(), XMLValuable::getValuer(), and XpathDBValuer::setRoot().

Referenced by DBOBJSetStreamer::buildEventStatement(), and DBObjectField::getValue().

DBOBJSetAction DBObjectNode::getAction   const
 

Return node's action constant.

Returns:
(DBOBJSetAction) Node's action.

Definition at line 337 of file dbobject.cpp.

References DBOBJSetAction, and DEBUG_FUNC.

Referenced by DBOBJSetStreamer::countObjectNodes(), DBObjectField::getValue(), DBOBJSetStreamer::processNode(), and DBObjectSAXBuilder::startElement().

DBObjectNode * DBObjectNode::getChildNode const char *    p_pszName,
unsigned int    p_uiIndex = 0
const
 

Returns a child node.

Parameters:
p_strName (string) Name of the node to return.
index (int) Index of the node to return (in nodes with that name).
Returns:
(int) Requested child node.

Definition at line 497 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::get().

DBObjectNode * DBObjectNode::getChildNode unsigned int    p_uiIndex const
 

Returns a child node.

Parameters:
index (int) Index of the child node to return.
Returns:
(int) Requested child node.

Definition at line 488 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::get().

Referenced by DBOBJSetStreamer::countObjectNodes(), getXML(), and selectSingleNode().

unsigned int DBObjectNode::getChildNodesCount const char *    p_pszName const
 

Returns the number of child nodes with given name.

Parameters:
p_strName (string) Name of child nodes to count.
Returns:
(int) Number of child nodes with given name.

Definition at line 479 of file dbobject.cpp.

References VAarray< DBObjectNode * >::count(), and DEBUG_FUNC.

unsigned int DBObjectNode::getChildNodesCount   const
 

Returns the number of child nodes.

Returns:
(int) Number of child nodes.

Definition at line 470 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::size().

Referenced by DBOBJSetStreamer::countObjectNodes(), and getXML().

DBObjectNode * DBObjectNode::getCurrentChild  
 

Definition at line 506 of file dbobject.cpp.

References VAarray< DBObjectNode * >::current(), and DEBUG_FUNC.

Referenced by DBOBJSetStreamer::processNode().

DBObjectField * DBObjectNode::getCurrentField  
 

Definition at line 627 of file dbobject.cpp.

References VAarray< DBObjectField * >::current(), and DEBUG_FUNC.

const DBOBJDefinitionNode * DBObjectNode::getDefinition   const
 

Returns node's definition object.

Returns:
(DBOBJDefinitionNode*) Definition node object associated with this node.

Definition at line 356 of file dbobject.cpp.

References DEBUG_FUNC.

Referenced by DBOBJSetStreamer::buildCHECKStatement(), DBOBJSetStreamer::buildDELETEStatement(), DBOBJSetStreamer::buildINSERTStatement(), DBOBJSetStreamer::buildUPDATEStatement(), DBOBJSetStreamer::buildWHEREclause(), DBOBJSetStreamer::processNode(), and DBObjectSAXBuilder::startElement().

DBObjectField * DBObjectNode::getField const char *    p_pszName const
 

Returns a field.

Parameters:
p_strName (sttring) Name of the field to return.
Returns:
(DBObjectField*) Requested field object.

Definition at line 617 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::get().

DBObjectField * DBObjectNode::getField unsigned int    p_uiIndex const
 

Returns a field.

Parameters:
p_index (int) Index of the field to return.
Returns:
(DBObjectField*) Requested field object.

Definition at line 607 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::get().

Referenced by DBOBJSetStreamer::buildINSERTStatement(), DBOBJSetStreamer::buildUPDATEStatement(), DBOBJSetStreamer::buildWHEREclause(), getXML(), and selectSingleNode().

unsigned int DBObjectNode::getFieldsCount   const
 

Returns the number of fields objects.

Returns:
(int) Number of fields objects.

Definition at line 598 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::size().

Referenced by getXML().

const char * DBObjectNode::getName   const
 

Returns node name.

Returns:
(string) Node name.

Definition at line 328 of file dbobject.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by addChildNode(), DBOBJSetStreamer::countObjectNodes(), DBObjectSAXBuilder::endElement(), DBOBJSetStreamer::sendNodeToDB(), and DBOBJSetStreamer::sendRecordToDB().

DBObjectNode * DBObjectNode::getParent   const
 

Returns node's parent node.

Returns:
(DBObjectNode*) Parent DBObjectNode or NULL if object is root.

Definition at line 347 of file dbobject.cpp.

References DEBUG_FUNC.

int DBObjectNode::getType   const [virtual]
 

Returns type of object.

Returns:
(int) type constant of objet.
Return values:
DBOBJECTTYPE_NODE for nodes.
DBOBJECTTYPE_FIELD for fields.

Implements DBObject.

Definition at line 318 of file dbobject.cpp.

References DBOBJECTTYPE_NODE, and DEBUG_FUNC.

XMLValuable * DBObjectNode::getValuable  
 

Returns valuable object.

Returns:
(XMLValuable*) Valuable object.

Definition at line 365 of file dbobject.cpp.

References DEBUG_FUNC.

Referenced by calculateRelValue().

void DBObjectNode::getXML XMLStreamConsumer   p_pXMLBufOut
 

Returns the XML stream representating this object and its descendants.

Returns:
p_pXMlBufOut (XMLStreamBuffer*) XML Buffer to write the XML stream in.

Definition at line 673 of file dbobject.cpp.

References DBOBJaction_Delete, DBOBJaction_Insert, DBOBJaction_Update, DEBUG_FUNC, getChildNode(), getChildNodesCount(), getField(), getFieldsCount(), DBObjectField::getXML(), and DBObjectField::isAttribute().

Referenced by DBOBJSetStreamer::deStackObjects().

void DBObjectNode::moveFirstChild  
 

Definition at line 533 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::moveFirst().

Referenced by DBOBJSetStreamer::processNode().

void DBObjectNode::moveFirstField  
 

Definition at line 654 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::moveFirst().

void DBObjectNode::moveLastChild  
 

Definition at line 542 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::moveLast().

Referenced by DBOBJSetStreamer::processNode().

void DBObjectNode::moveLastField  
 

Definition at line 663 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::moveLast().

void DBObjectNode::moveNextChild  
 

Definition at line 524 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::moveNext().

Referenced by DBOBJSetStreamer::processNode().

void DBObjectNode::moveNextField  
 

Definition at line 645 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::moveNext().

void DBObjectNode::movePreviousChild  
 

Definition at line 515 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectNode * >::movePrevious().

Referenced by DBOBJSetStreamer::processNode().

void DBObjectNode::movePreviousField  
 

Definition at line 636 of file dbobject.cpp.

References DEBUG_FUNC, and VAarray< DBObjectField * >::movePrevious().

void DBObjectNode::removeChildNode const char *    p_pszName,
unsigned int    p_uiIndex = 0,
bool    p_fDestroy = true
 

Removes a named child node of this node.

Parameters:
p_strName (string) Name of the node to remove.
index (int) Index of the node to remove (in nodes with that name).
p_fDestroy (bool, optionnal) If TRUE, child node object is destroyed.

Definition at line 451 of file dbobject.cpp.

References DEBUG_FUNC, VAarray< DBObjectNode * >::get(), and setParent().

void DBObjectNode::removeChildNode unsigned int    p_uiIndex,
bool    p_fDestroy = true
 

Removes a child node of this node.

Parameters:
index (int) Index of the node to remove.
p_fDestroy (bool, optionnal) If TRUE, child node object is destroyed.

Definition at line 432 of file dbobject.cpp.

References DEBUG_FUNC, VAarray< DBObjectNode * >::remove(), and setParent().

void DBObjectNode::removeField const char *    p_pszName,
bool    p_fDestroy = true
 

Removes a field object from this node.

Parameters:
p_strName (string) Name of the field to remove.
p_fDestroy (bool, optionnal) If TRUE, field object is destroyed when removed.

Definition at line 581 of file dbobject.cpp.

References DEBUG_FUNC, VAarray< DBObjectField * >::remove(), and DBObjectField::setParent().

void DBObjectNode::removeField unsigned int    p_uiIndex,
bool    p_fDestroy = true
 

Removes a field object from this node.

Parameters:
index (int) Index of the field to remove.
p_fDestroy (bool, optionnal) If TRUE, field object is destroyed when removed.

Definition at line 564 of file dbobject.cpp.

References DEBUG_FUNC, VAarray< DBObjectField * >::remove(), and DBObjectField::setParent().

DBObject * DBObjectNode::selectSingleNode const char *    p_pszPath
 

Returns a node or a field given by the path.

Parameters:
p_strPath (string) Path of the target, relative to this node.

Definition at line 714 of file dbobject.cpp.

References copyCharBuffer(), DEBUG_ECHO, DEBUG_FUNC, getChildNode(), getField(), and releaseCharBuffer().

Referenced by XpathDBValuer::calculateExpression(), and DBOBJSetStreamer::sendRecordToDB().

void DBObjectNode::setAction DBOBJSetAction    p_intAction
 

Sets node's acion constant.

Parameters:
p_intAction (DBOBJSetAction) Node's action to set.

Definition at line 377 of file dbobject.cpp.

References DEBUG_FUNC.

Referenced by DBObjectNode(), and DBObjectSAXBuilder::startElement().

void DBObjectNode::setDefinition const DBOBJDefinitionNode   p_pDBOBJDefNode
 

Sets node's definition node.

Parameters:
p_pDBOBJDefNode (DBOBJDefinitionNode*) Object node definition.

Definition at line 397 of file dbobject.cpp.

References DEBUG_FUNC, DBOBJDefinitionNode::getName(), and importCharBuffer().

Referenced by DBObjectNode().

void DBObjectNode::setParent DBObjectNode *    p_DBOBJParentNode
 

Sets node's parent node.

Parameters:
p_DBOBJParentNode (DBObjectNode*) Node's parent.

Definition at line 387 of file dbobject.cpp.

References DEBUG_FUNC.

Referenced by addChildNode(), and removeChildNode().

void DBObjectNode::setValuable XMLValuable   p_pValuableParent
 

Sets node's valuable object.

Parameters:
p_pValuableParent (XMLValuable*) Node's valuable object.

Definition at line 408 of file dbobject.cpp.

References DEBUG_FUNC.

Referenced by DBOBJSetStreamer::processObject().


The documentation for this class was generated from the following files:
Generated on Sat Oct 4 13:23:40 2003 for XDFLengine by doxygen1.3-rc2