Odyssey::System Class Reference

Wraps entire subsystems in a consistent interface. More...

#include <System.h>

Inheritance diagram for Odyssey::System:

Odyssey::MessageAdapter Odyssey::MessageListener List of all members.

Public Member Functions

 System ()
 Creates a new, empty System.
void setName (const String &name)
 Changes the name of the System to the one given.
const StringgetName () const
 Returns the current name of the System.
void setUpdateFrequency (float32 freq)
 Sets the locked update frequency for this system.
float32 getUpdateFrequency () const
 Returns the update frequncy of the system.
void setMaxUpdateTime (float32 time)
 Sets the max amount of time that can occur between updates.
float32 getMaxUpdateTime () const
 Returns the max amount of time allowed between updates.
void create ()
 An overridable function that initializes the system.
void destroy ()
 An overridable function that destroys the system.
void setActive (bool active=true)
 Sets the active status of the system.
bool getActive () const
 Returns the active status of the system.
void update ()
 This function updates the system.
MessageQueuegetMessageQueue ()
 Returns a reference to the system's message queue.
void setAttribute (const String &name, const Variable &attr)
 Sets the given attribute.
Variable getAttribute (const String &name) const
 Returns the value of the given attribute.
std::set< StringgetAttributes () const
 Returns a set of all the attributes handled by the system.
bool containsAttribute (const String &name) const
 Returns true if the named attribute is handled by this system.
virtual bool onAdding (Manager< SystemPtr > &) const
virtual bool onRemoving (Manager< SystemPtr > &) const

Protected Types

typedef std::map< String,
Variable
AttributeMap

Protected Member Functions

virtual void onCreated ()
virtual void onDestroyed ()
virtual void onActivated ()
virtual void onDeactivated ()
virtual void onUpdate ()
virtual bool onAttributeChanged (const String &name, const Variable &value)
void onRemoved (MessageQueue &queue)
 This event is called when this listener is removed as a listener from the message queue.

Protected Attributes

String _name
bool _active
float32 _freq
float32 _maxDelta
float32 _accumulator
Timer _timer
AttributeMap _attrs

Detailed Description

Wraps entire subsystems in a consistent interface.

This class wraps the interfaces (facade/adapter) for the large subsystems that make up the simulation (like physics, graphics, etc.)


Member Typedef Documentation

typedef std::map<String,Variable> Odyssey::System::AttributeMap [protected]
 


Constructor & Destructor Documentation

Odyssey::System::System  ) 
 

Creates a new, empty System.


Member Function Documentation

bool Odyssey::System::containsAttribute const String name  )  const
 

Returns true if the named attribute is handled by this system.

void Odyssey::System::create  ) 
 

An overridable function that initializes the system.

void Odyssey::System::destroy  ) 
 

An overridable function that destroys the system.

bool Odyssey::System::getActive  )  const
 

Returns the active status of the system.

Variable Odyssey::System::getAttribute const String name  )  const
 

Returns the value of the given attribute.

std::set<String> Odyssey::System::getAttributes  )  const
 

Returns a set of all the attributes handled by the system.

float32 Odyssey::System::getMaxUpdateTime  )  const
 

Returns the max amount of time allowed between updates.

MessageQueue& Odyssey::System::getMessageQueue  ) 
 

Returns a reference to the system's message queue.

const String& Odyssey::System::getName  )  const
 

Returns the current name of the System.

float32 Odyssey::System::getUpdateFrequency  )  const
 

Returns the update frequncy of the system.

virtual void Odyssey::System::onActivated  )  [protected, virtual]
 

virtual bool Odyssey::System::onAdding Manager< SystemPtr > &   )  const [virtual]
 

virtual bool Odyssey::System::onAttributeChanged const String name,
const Variable value
[protected, virtual]
 

virtual void Odyssey::System::onCreated  )  [protected, virtual]
 

virtual void Odyssey::System::onDeactivated  )  [protected, virtual]
 

virtual void Odyssey::System::onDestroyed  )  [protected, virtual]
 

void Odyssey::System::onRemoved MessageQueue queue  )  [protected, virtual]
 

This event is called when this listener is removed as a listener from the message queue.

Reimplemented from Odyssey::MessageAdapter.

virtual bool Odyssey::System::onRemoving Manager< SystemPtr > &   )  const [virtual]
 

virtual void Odyssey::System::onUpdate  )  [protected, virtual]
 

void Odyssey::System::setActive bool  active = true  ) 
 

Sets the active status of the system.

void Odyssey::System::setAttribute const String name,
const Variable attr
 

Sets the given attribute.

void Odyssey::System::setMaxUpdateTime float32  time  ) 
 

Sets the max amount of time that can occur between updates.

This function set the max amount of time allowed between update calls. If the delta time between updates exceeds this, the system will "skip" over that time. A negative value means that infinite time may pass.

Parameters:
time the max time allowed between updates

void Odyssey::System::setName const String name  ) 
 

Changes the name of the System to the one given.

void Odyssey::System::setUpdateFrequency float32  freq  ) 
 

Sets the locked update frequency for this system.

This function sets the desired locked update frequency. The system will attempt to stay locked at this frequency when it is updated. A negative value will mean that the system will update at one frame every update call. Essentially, the frequency will not be locked.

Parameters:
freq the desired update frequency

void Odyssey::System::update  ) 
 

This function updates the system.


Member Data Documentation

float32 Odyssey::System::_accumulator [protected]
 

bool Odyssey::System::_active [protected]
 

AttributeMap Odyssey::System::_attrs [protected]
 

float32 Odyssey::System::_freq [protected]
 

float32 Odyssey::System::_maxDelta [protected]
 

String Odyssey::System::_name [protected]
 

Timer Odyssey::System::_timer [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 01:18:53 2007 for Odyssey Meta-Engine by  doxygen 1.4.6-NO