SGSubsystemMgr Class Reference

Manage subsystems for FlightGear. More...

#include <subsystem_mgr.hxx>

Inheritance diagram for SGSubsystemMgr:
SGSubsystem SGReferenced

List of all members.

Public Types

enum  GroupType
 

Types of subsystem groups.


Public Member Functions

virtual void init ()
 Initialize the subsystem.
virtual void postinit ()
 Initialize parts that depend on other subsystems having been initialized.
virtual void reinit ()
 Reinitialize the subsystem.
virtual void bind ()
 Acquire the subsystem's property bindings.
virtual void unbind ()
 Release the subsystem's property bindings.
virtual void update (double delta_time_sec)
 Update the subsystem.
virtual void suspend ()
 Suspend operation of this subsystem.
virtual void resume ()
 Resume operation of this subsystem.
virtual bool is_suspended () const
 Test whether this subsystem is suspended.

Detailed Description

Manage subsystems for FlightGear.

This top-level subsystem will eventually manage all of the subsystems in FlightGear: it broadcasts its life-cycle events (init, bind, etc.) to all of the subsystems it manages. Subsystems are grouped to guarantee order of initialization and execution -- currently, the only two groups are INIT and GENERAL, but others will appear in the future.

All subsystems are named as well as grouped, and subsystems can be looked up by name and cast to the appropriate subtype when another subsystem needs to invoke specialized methods.

The subsystem manager owns the pointers to all the subsystems in it.

Definition at line 369 of file subsystem_mgr.hxx.


Member Function Documentation

void SGSubsystemMgr::bind (  )  [virtual]

Acquire the subsystem's property bindings.

This method should bind all properties that the subsystem publishes. It will be invoked after init, but before any invocations of update.

Reimplemented from SGSubsystem.

Definition at line 377 of file subsystem_mgr.cxx.

void SGSubsystemMgr::init ( void   )  [virtual]

Initialize the subsystem.

This method should set up the state of the subsystem, but should not bind any properties. Note that any dependencies on the state of other subsystems should be placed here rather than in the constructor, so that FlightGear can control the initialization order.

Reimplemented from SGSubsystem.

Definition at line 356 of file subsystem_mgr.cxx.

bool SGSubsystemMgr::is_suspended (  )  const [virtual]

Test whether this subsystem is suspended.

Returns:
true if the subsystem is suspended, false if it is not.

Reimplemented from SGSubsystem.

Definition at line 422 of file subsystem_mgr.cxx.

void SGSubsystemMgr::postinit (  )  [virtual]

Initialize parts that depend on other subsystems having been initialized.

This method should set up all parts that depend on other subsystems. One example is the scripting/Nasal subsystem, which is initialized last. So, if a subsystem wants to execute Nasal code in subsystem-specific configuration files, it has to do that in its postinit() method.

Reimplemented from SGSubsystem.

Definition at line 363 of file subsystem_mgr.cxx.

void SGSubsystemMgr::reinit (  )  [virtual]

Reinitialize the subsystem.

This method should cause the subsystem to reinitialize itself, and (normally) to reload any configuration files.

Reimplemented from SGSubsystem.

Definition at line 370 of file subsystem_mgr.cxx.

void SGSubsystemMgr::resume (  )  [virtual]

Resume operation of this subsystem.

This method instructs the subsystem to resume sim-time-depended operations. It is not an error for the resume method to be invoked when the subsystem is not suspended; the invocation should simply be ignored.

Reimplemented from SGSubsystem.

Definition at line 415 of file subsystem_mgr.cxx.

void SGSubsystemMgr::suspend (  )  [virtual]

Suspend operation of this subsystem.

This method instructs the subsystem to suspend sim-time-dependent operations until asked to resume. The update method will still be invoked so that the subsystem can take any non-time-dependent actions, such as updating the display.

It is not an error for the suspend method to be invoked when the subsystem is already suspended; the invocation should simply be ignored.

Reimplemented from SGSubsystem.

Definition at line 408 of file subsystem_mgr.cxx.

void SGSubsystemMgr::unbind (  )  [virtual]

Release the subsystem's property bindings.

This method should release all properties that the subsystem publishes. It will be invoked by FlightGear (not the destructor) just before the subsystem is removed.

Reimplemented from SGSubsystem.

Definition at line 384 of file subsystem_mgr.cxx.

void SGSubsystemMgr::update ( double  delta_time_sec  )  [virtual]

Update the subsystem.

FlightGear invokes this method every time the subsystem should update its state.

Parameters:
delta_time_sec The delta time, in seconds, since the last update. On first update, delta time will be 0.

Implements SGSubsystem.

Definition at line 392 of file subsystem_mgr.cxx.


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

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1