Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ObjectManager Class Reference
[Managed Objects]

ObjectManager Class Definition. More...

#include <ObjectManager.h>

Inheritance diagram for ObjectManager:

Inheritance graph
[legend]
Collaboration diagram for ObjectManager:

Collaboration graph
[legend]
List of all members.

Public Methods

 ObjectManager ()
 ~ObjectManager ()
WDError initRef (const char *inFile)
WDError initNew (const char *inRootType, const char *inDTD)
void release (IManagedObject *inObject)
void * getChild (void *inNode, int inIndex)
void getType (void *inNode, char *outType, int inMaxLength)
WDError setAttribute (void *inNode, const char *inAttribute, const char *inValue)
WDError saveToFile (const char *inFileName)
WDError getAttribute (void *inNode, const char *inAttribute, char *outValue, int inMaxLength)
void * newChildNode (const char *inType, void *inParent)
int getChildCount (void *inNode)
void * getParentNode (void *inNode)
WDError subscribe (IManagedObject *inObject, void *inTargetNode)
void * findNode (const char *nodeID, void *inRoot)
int getIndex (void *inNode)
void registerObject (void *inObject)
void * getRoot ()
void notifyChanged (void *inNode)
void notifyChildAdded (void *inStartNode, void *inChildNode)
void notifyChildChanged (void *inStartNode, void *inChildNode)

Private Attributes

SubscriberMap * mSubscriberMap
void * mRoot
list< IManagedObject * > mNodes

Detailed Description

ObjectManager Class Definition.

The ObjectManager implements the services of the IObjectManager using the wdxml services. It is used as a Gateway to access the data, and provide subscription services for the data observers.


Constructor & Destructor Documentation

ObjectManager::ObjectManager (    ) 
 

ObjectManager::~ObjectManager (    ) 
 


Member Function Documentation

void* ObjectManager::findNode (  const char *    nodeID,
void *    inRoot
)  [virtual]
 

Returns the node with the specified ID searching from the specified root

Parameters:
nodeID  Name of the data node to look for
inRoot  Root from which to start searching

Implements IObjectManager.

WDError ObjectManager::getAttribute (  void *    inNode,
const char *    inAttribute,
char *    outValue,
int    inMaxLength
)  [virtual]
 

Returns an attribute of the specified data node

Parameters:
inNode  The data node on which to perform the operation
inAttribute  The attribute to get
outValue  The value of the attribute
inMaxLength  The size of the character buffer

Implements IObjectManager.

void* ObjectManager::getChild (  void *    inNode,
int    inIndex
)  [virtual]
 

Returns the child of the specified node at the specified index.

Parameters:
inNode  The data node whose child is requested
inIndex  The index of the child requested

Implements IObjectManager.

int ObjectManager::getChildCount (  void *    inNode )  [virtual]
 

Returns the number of child associated with the data node

Parameters:
inNode  The data node on which to perform the operation

Implements IObjectManager.

int ObjectManager::getIndex (  void *    inNode )  [virtual]
 

Returns the index of the data node with regard to its parent

Parameters:
inNode  The data node on which to perform the operation

Implements IObjectManager.

void* ObjectManager::getParentNode (  void *    inNode )  [virtual]
 

Returns the parent of the specified data node

Parameters:
inNode  The data node whose parent is requested

Implements IObjectManager.

void* ObjectManager::getRoot (    )  [virtual]
 

Returns the root of the database

Implements IObjectManager.

void ObjectManager::getType (  void *    inNode,
char *    outType,
int    inMaxLength
)  [virtual]
 

Returns the type of the specified data node

Parameters:
inNode  The data node whose type is requested
outType  The type of the specified node
inMaxLength  The size of the character buffer.

Implements IObjectManager.

WDError ObjectManager::initNew (  const char *    inRootType,
const char *    inDTD
) 
 

Creates a new ObjectManager from scratch

Parameters:
inRootType  Type of the root node (i.e. "scenario")
inDTD  Path to a validating DTD

WDError ObjectManager::initRef (  const char *    inFile ) 
 

Initializes the ObjectManager from an XML file

Parameters:
inFile  Name of the XML file

void* ObjectManager::newChildNode (  const char *    inType,
void *    inParent
)  [virtual]
 

Creates a new node in the database

Parameters:
inType  Type of the node to create
inParent  Parent of the node to create

Implements IObjectManager.

void ObjectManager::notifyChanged (  void *    inNode )  [virtual]
 

Notifies the observers that the data node has changed

Parameters:
inNode  The node that changed

Implements IObjectManager.

void ObjectManager::notifyChildAdded (  void *    inStartNode,
void *    inChildNode
)  [virtual]
 

Notifies the observers that a child was added to the node or to a child of the node

Parameters:
inStartNode  The first parent to be notified
inChildNode  The child which changed

Implements IObjectManager.

void ObjectManager::notifyChildChanged (  void *    inStartNode,
void *    inChildNode
)  [virtual]
 

Notifies the observers that a child to the node or to a child of the node has changed

Parameters:
inStartNode  The first parent to be notified
inChildNode  The child which changed

Implements IObjectManager.

void ObjectManager::registerObject (  void *    inObject )  [virtual]
 

Temporary hack - we need to have at least one ManagedObject of for each node loaded in memory all the time - and I don't feel like telling you why. Go ask Etienne instead...

Implements IObjectManager.

void ObjectManager::release (  IManagedObject *    inObject )  [virtual]
 

Removes an IManagedObject from the subscriber list

Parameters:
inObject  The object to remove the the subscribing list

Implements IObjectManager.

WDError ObjectManager::saveToFile (  const char *    inFileName )  [virtual]
 

Saves the database to a file

Parameters:
inFileName  Name of the file
Note:
If a file already exists with the same name, it will be overwritten

Implements IObjectManager.

WDError ObjectManager::setAttribute (  void *    inNode,
const char *    inAttribute,
const char *    inValue
)  [virtual]
 

Sets an attribute of the specified data node

Parameters:
inNode  The data node on which to perform the operation
inAttribute  The attribute to set
inValue  The value at which the attribute should be set

Implements IObjectManager.

WDError ObjectManager::subscribe (  IManagedObject *    inObject,
void *    inTargetNode
)  [virtual]
 

Subscribes the observer to the data node

Parameters:
inObject  The data node
inTargetNode  The observer

Implements IObjectManager.


Member Data Documentation

list<IManagedObject*> ObjectManager::mNodes [private]
 

Temporary Hack - We needed to keep at least one copy of each ManagedObjects referencing another ManagedObject.

void* ObjectManager::mRoot [private]
 

Root node (the Scenario)

SubscriberMap* ObjectManager::mSubscriberMap [private]
 

Used to store the Observers


The documentation for this class was generated from the following file:
Generated on Mon Apr 15 15:23:18 2002 for WhiteDwarf by doxygen1.2.15