Subsystems#
-
class SGSubsystem : public SGReferenced#
Basic interface for all FlightGear subsystems.
This is an abstract interface that all FlightGear subsystems will eventually implement. It defines the basic operations for each subsystem: initialization, property binding and unbinding, and updating. Interfaces may define additional methods, but the preferred way of exchanging information with other subsystems is through the property tree.
To publish information through a property, a subsystem should bind it to a variable or (if necessary) a getter/setter pair in the bind() method, and release the property in the unbind() method:
To reference a property (possibly) from another subsystem, there are two alternatives. If the property will be referenced only infrequently (say, in the init() method), then the fgGet* methods declared in fg_props.hxx are the simplest:
On the other hand, if the property will be referenced frequently (say, in the update() method), then the hash-table lookup required by the fgGet* methods might be too expensive; instead, the subsystem should obtain a reference to the actual property node in its init() function and use that reference in the main loop:
The node returned will always be a pointer to SGPropertyNode, and the subsystem should not delete it in its destructor (the pointer belongs to the property tree, not the subsystem).
The program may ask the subsystem to suspend or resume sim-time-dependent operations; by default, the suspend() and resume() methods set the protected variable _suspended, which the subsystem can reference in its update() method, but subsystems may also override the suspend() and resume() methods to take different actions.
Subclassed by AnotherSub, FakeRadioSub, MySub1, SGEventMgr, SGInterpolator, SGPerformanceMonitor, SGSoundMgr, SGSubsystemGroup, SGSubsystemMgr, simgear::PropertyBasedMgr, simgear::PropertyInterpolationMgr, simgear::SGTerraSync
-
class SGSubsystemGroup : public SGSubsystem#
A group of FlightGear subsystems.
Subclassed by InstrumentGroup
-
class SGSubsystemMgr : public SGSubsystem#
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.