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

ManagedObject Class Reference
[Managed Objects]

ManagedObject Class Definition. More...

#include <ManagedObject.h>

Inheritance diagram for ManagedObject:

Inheritance graph
[legend]
Collaboration diagram for ManagedObject:

Collaboration graph
[legend]
List of all members.

Public Methods

 ManagedObject ()
 ~ManagedObject ()
WDError initRef (void *inNode, IObjectManager *inManager, IObjectEventHandler *inEventHandler)
WDError initRef (IManagedObject *inParent, int inIndex, IObjectEventHandler *inEventHandler)
WDError initNew (const char *inType, IManagedObject *inParent, IObjectEventHandler *inEventHandler)
void * getNode ()
void * getChild (int inIndex)
void getChildType (int inIndex, char *outType, int inMaxLength)
IObjectManagergetManager ()
void getType (char *outType, int inMaxLength)
WDError setAttribute (const char *inAttribute, const char *inValue)
WDError getAttribute (const char *inAttribute, char *outValue, int inMaxLength)
int getChildCount ()
WDError setName (const char *inName)
WDError getName (char *outName, int inMaxLength)
void * getParentNode ()
int getIndex ()
void changed (IManagedObject *inTarget)
void childChanged (IManagedObject *inTarget, void *inChild)
void childAdded (IManagedObject *inTarget, void *inChild)

Protected Methods

IObjectEventHandlergetEventHandler ()

Private Attributes

IObjectManagermManager
IObjectEventHandlermEventHandler
void * mObject

Detailed Description

ManagedObject Class Definition.

The ManagedObject is an implementation of the IManagedObject. It provides basic services that all the ManagedObjects need. Access to the database should always be performed through a managed object - although they will never access the database directly, but rather use the ObjectManager gateway to perform queries.


Constructor & Destructor Documentation

ManagedObject::ManagedObject  
 

ManagedObject::~ManagedObject  
 


Member Function Documentation

void ManagedObject::changed IManagedObject   inTarget [virtual]
 

Called when the data node has been modified

Parameters:
inTarget  IManagedObject which was subscribed to the data node

Implements IObjectEventHandler.

void ManagedObject::childAdded IManagedObject   inTarget,
void *    inChild
[virtual]
 

Called when a child of the data node has been added

Parameters:
inTarget  IManagedObject which was subscribed to the data node
inChild  Data node of the child which has been added

Implements IObjectEventHandler.

void ManagedObject::childChanged IManagedObject   inTarget,
void *    inChild
[virtual]
 

Called when a child of the data node has been modified

Parameters:
inTarget  IManagedObject which was subscribed to the data node
inChild  Data node of the child which has changed

Implements IObjectEventHandler.

Reimplemented in Actor, ActorRef, Chapter, and FormationRef.

WDError ManagedObject::getAttribute const char *    inAttribute,
char *    outValue,
int    inMaxLength
[virtual]
 

Returns an attribute of the object

Parameters:
inAttribute  Attribute to be set
outValue  Value of the attribute.
inMaxLength  Size of the character buffer
Returns:
kWDXMLTagNotFoundErr if the attribute was not set.

Implements IManagedObject.

void* ManagedObject::getChild int    inIndex [virtual]
 

Returns the child data node at the specified index

Parameters:
inIndex  index of the requested child
Returns:
NULL if the specified child does not exist

Implements IManagedObject.

int ManagedObject::getChildCount   [virtual]
 

Returns the number of children associated with the object

Implements IManagedObject.

void ManagedObject::getChildType int    inIndex,
char *    outType,
int    inMaxLength
[virtual]
 

Implements IManagedObject.

IObjectEventHandler* ManagedObject::getEventHandler   [protected, virtual]
 

Returns the Observer of the ManagedObject

Implements IManagedObject.

int ManagedObject::getIndex   [virtual]
 

Returns the index of the object with regard to its parent

Implements IManagedObject.

IObjectManager* ManagedObject::getManager   [virtual]
 

Implements IManagedObject.

WDError ManagedObject::getName char *    outName,
int    inMaxLength
[virtual]
 

Returns the name (ID) of the object

Parameters:
outName  Name of the object
inMaxLength  The size of the character buffer

Implements IManagedObject.

void* ManagedObject::getNode   [virtual]
 

Implements IManagedObject.

void* ManagedObject::getParentNode   [virtual]
 

Implements IManagedObject.

void ManagedObject::getType char *    outType,
int    inMaxLength
[virtual]
 

Implements IManagedObject.

WDError ManagedObject::initNew const char *    inType,
IManagedObject   inParent,
IObjectEventHandler   inEventHandler
 

Creates a new ManagedObject and adds it to the database

Parameters:
inType  Type of the new data node
inParent  ManagedObject in which the ManagedObject is to be added
inEventHandler  EventHandler which listens to changes on the data node (can be NULL)

WDError ManagedObject::initRef IManagedObject   inParent,
int    inIndex,
IObjectEventHandler   inEventHandler
 

Initializes an existing ManagedObject based on its parent

Parameters:
inParent  ManagedObject in which the ManagedObject is
inIndex  Index of the ManagedObject in the ManagedObject
inEventHandler  EventHandler which listens to changes on the data node (can be NULL)

WDError ManagedObject::initRef void *    inNode,
IObjectManager   inManager,
IObjectEventHandler   inEventHandler
 

Initializes an existing ManagedObject based on data node

Parameters:
inNode  Data node representing the ManagedObject
inManager  Database from which the data node was taken
inEventHandler  EventHandler which listens to changes on the data node (can be NULL)

Reimplemented in Actor, ActorGroup, ActorRef, Chapter, Episode, EpisodeGroup, Formation, FormationGroup, FormationRef, Image, ImageGroup, Player, PlayerGroup, Scenario, Sound, SoundGroup, and State.

WDError ManagedObject::setAttribute const char *    inAttribute,
const char *    inValue
[virtual]
 

Sets an attribute of the object

Parameters:
inAttribute  Attribute to be set
inValue  Value of the attribute. Set this to NULL to remove the attribute.

Implements IManagedObject.

WDError ManagedObject::setName const char *    inName [virtual]
 

Sets the name (ID) of the object

Parameters:
inName  Name of the object

Implements IManagedObject.


Member Data Documentation

IObjectEventHandler* ManagedObject::mEventHandler [private]
 

Observer

IObjectManager* ManagedObject::mManager [private]
 

Pointer to the ObjectManager

void* ManagedObject::mObject [private]
 

Data node


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