Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

VizKit::VisualNotification Class Reference

#include <VisualNotification.h>

Inherits VizKit::VisualObject.

Collaboration diagram for VizKit::VisualNotification:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VisualNotification ()
 VisualNotification (const VisualItemIdentifier &anIdentifier)
 ~VisualNotification ()
 VisualNotification (const VisualNotification &other)
VisualNotificationoperator= (const VisualNotification &other)
virtual VisualNotificationclone (void) const
void setKey (const VisualNotificationKey aKey)
VisualNotificationKey getKey (void) const
void setData (const void *const someData, uint32 dataSizeInBytes)
void * getData (uint32 &dataSizeInBytes) const
void setObject (const VisualObject &anObject)
VisualObjectgetObject (void) const
void setPointer (void *pointer)
void * getPointer (void)
void post (void)

Static Public Member Functions

static void convertNotificationKeyToString (const VisualNotificationKey aKey, char *outString)
static void post (const VisualNotificationKey aKey)
static void registerNotification (VisualActor *aVisualActor, const VisualNotificationKey aNotificationKey)
static void removeNotification (VisualActor *aVisualActor, const VisualNotificationKey aNotificationKey)

Private Member Functions

void copy (const VisualNotification &other)

Private Attributes

VisualNotificationKey notificationEnumKey
void * notificationData
uint32 notificationDataSize
VisualObjectnotificationObject
void * notificationPointer

Detailed Description

A VisualActor is notified about events and messages with a VisualNotification. The VisualActor can query the VisualNotification for details. The VisualActor can also set a value to pass it back to the caller.


Constructor & Destructor Documentation

VisualNotification::VisualNotification (  ) 

The constructor.

VisualNotification::VisualNotification ( const VisualItemIdentifier anIdentifier  ) 

Another constructor.

Parameters:
anIdentifier Identifier of the notification.
VisualNotification::~VisualNotification (  ) 

The destructor.

VisualNotification::VisualNotification ( const VisualNotification other  ) 

Copy constructor.


Member Function Documentation

VisualNotification * VisualNotification::clone ( void   )  const [virtual]

Copies the current VisualNotification and returns a pointer to a new VisualNotification.

Implements VizKit::VisualObject.

void VisualNotification::convertNotificationKeyToString ( const VisualNotificationKey  aKey,
char *  outString 
) [static]

Static helper function that converts a VisualNotificationKey to the string. Possibly useful for debugging or tracing purposes.

Parameters:
aKey The key of a notification.
outString The character string value of the VisualNotificationKey enum value.
void VisualNotification::copy ( const VisualNotification other  )  [private]

Copy method for assignment operator and copy constructor.

Parameters:
other Another VisualNotification.
void * VisualNotification::getData ( uint32 dataSizeInBytes  )  const

Returns the untyped data of the notification.

Parameters:
[out] dataSizeInBytes The number of bytes the data occupies in memory.
Returns:
The pointer to the memory location of the data.
Remarks:
To hold the data, the caller has to create and store a copy on his side.
VisualNotificationKey VisualNotification::getKey ( void   )  const

Returns the key of the notification.

Returns:
The key of the notification. Notification keys are implemented as enums.
VisualObject * VisualNotification::getObject ( void   )  const

Returns a pointer to the object of the notification.

Returns:
A pointer to the object of the notification.
Remarks:
The object does not get copied automatically. If the caller wants to retain a copy, the data has to be copied by calling its object member function clone().
void * VisualNotification::getPointer ( void   ) 

Returns a pointer to some memory address.

Returns:
A pointer to some memory address.
Remarks:
If possible, copying the data is preferred (by using setData() / getData()).
VisualNotification & VisualNotification::operator= ( const VisualNotification other  ) 

Assignment operator.

void VisualNotification::post ( void   ) 

The notification is posted to the VisualNotificationQueue (pushed at the end of the VisualNotificationQueue).

void VisualNotification::post ( const VisualNotificationKey  aKey  )  [static]

Static function for convenient posting of simple enum value of VisualNotificationKey.

Parameters:
aKey The notification key to post.
Remarks:
The notification is pushed at the end of the VisualNotificationQueue.
void VisualNotification::registerNotification ( VisualActor aVisualActor,
const VisualNotificationKey  aNotificationKey 
) [static]

A VisualActor can register for an event/message. The notification is passed with VisualActor::handleNotification().

Parameters:
aVisualActor A visual actor.
aNotificationKey An enum that denotes a notification.
void VisualNotification::removeNotification ( VisualActor aVisualActor,
const VisualNotificationKey  aNotificationKey 
) [static]

A VisualActor can be removed from the list of observers for a specific notification.

Parameters:
aVisualActor A visual actor.
aNotificationKey An enum that denotes a notification.
void VisualNotification::setData ( const void *const   someData,
uint32  dataSizeInBytes 
)

Sets the value of a notification.

Parameters:
someData The pointer to the memory location of the data.
dataSizeInBytes The size of the data in bytes.
Remarks:
The data (not only the pointer) is copied.
void VisualNotification::setKey ( const VisualNotificationKey  aKey  ) 

Sets the key of a notification. Notification keys are implemented as enums.

Parameters:
aKey The enum key.
void VisualNotification::setObject ( const VisualObject anObject  ) 

Sets the object of a notification.

Parameters:
anObject The pointer to an object.
Remarks:
The object is copied by calling clone().
void VisualNotification::setPointer ( void *  pointer  ) 

Sets a pointer to some memory address.

Parameters:
pointer A pointer to some memory address.
Remarks:
If possible, copying the data is preferred (by calling setData()).

Member Data Documentation

Optional data of notification.

The length of the optional data in bytes.

Enum value of notification as uint16.

Optional object of the notification.

Internally stored pointer to some memory address.


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

Generated on Sun Sep 26 2010 13:29:36 for VizKit by doxygen 1.7.1