Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CC_RootObject Class Reference
[General Base Classes]

#include <CC_RootObject.h>

Inheritance diagram for CC_RootObject:

CC_FSM CC_IntStack CC_ManoeuvreFactory CC_ManoeuvreManager CC_PunctualActionManager CC_RootObjectStack CC_TelecommandFactory CC_TelecommandManager CC_TelemetryManager CC_TelemetryPacketFactory ControlBlock DataPool DC_BasicReconfigurer DC_EventRepository FsmState Manoeuvre ModeManager MonitoringProfile ObsClock ParameterDatabase PunctualAction TelecommandLoader TelemetryPacket TelemetryStream Tracer List of all members.

Detailed Description

Base class from which most framework classes are - directly or indirectly - derived.

This class defines four attributes and four services that are made available to its children classes. The attributes are:

The instance identifier is an integer that uniquely identifies each object instantiated from this class or its subclasses. The instance identifier is automatically assigned by the CC_RootObject constructor when a new instance of this class is created. It can be read but cannot be changed after an object has been created.

The class identifier is an integer that uniquely identifies each class derived from CC_RootObject. It is useful during debugging and could be used to implement a simple form of run-time type identification. The class identifier should be set during the application instantiation phase and it is intended never to be changed afterwards. Only concrete classes are endowed with a class identifier.

The system data pool is an instance of class DataPool that is implemented as a static plug-in component for class CC_RootObject. In general, applications instantiated from the OBS Framework should have only one data pool component. The CC_RootObject class makes this single data pool instance globally accessible to all OBS Framework classes.

The system event repository is an instance of class DC_EventRepository that is implemented as a static plug-in component for class CC_RootObject. In general, applications instantiated from the OBS Framework should use only one event repository. The CC_RootObject class makes this single event repository instance globally accessible to all OBS Framework classes.

The system parameter database is an instance of class ParameterDatabase that is implemented as a static plug-in component for class CC_RootObject. In general, applications instantiated from the OBS Framework should have only one parameter database component. The CC_RootObject class makes this single parameter database instance globally accessible to all OBS Framework classes.

The services implemented by the CC_RootObject class are:

The object configuration check service allows an external entity to ask an object instantiated from a class derived from CC_RootObject to check whether it is configured. The term configuration is used to designate the operations that are performed on an object during the application initialization phase to prepare it to perform its allotted task during the application operational phase. Generally speaking, an object is configured if all its plug-in objects have been loaded and if all its internal data structures have been created and initialized.

The system configuration check service allows an external entity to verify whether all objects instantiated from a class derived from CC_RootObject are configured. The CC_RootObject class internally defines a static data structure that holds references to all objects that have been instantiated from its subclasses. This data structure is called the system list. The system list data structure is loaded by the RootObject constructor: every time a new object is created, its reference is loaded into the data structure. The system configuration check service goes through the objects in the system list data structure and performs a configuration check on each one of them. If any of the objects in the system list reports: "not configured", then the system configuration service reports: "system not configured". The system configuration check should be performed at the end of the framework instantiation phase to confirm the correctness of the instantiation procedure.

The tracing service allows an object instantiated from a class derived from CC_RootObject to ask for a trace signal to be generated. The requesting object only has to specify an identifier defining the content of the trace signal. All other operations related to the sending of the trace signal are handled by a static plug-in object of type Tracer. Two types of tracing signals can be generated: synch trace and and packet trace. The presence of this service in the root class means that all framework objects have easy access to the tracing service and can easily ask for trace signals to be sent to an external test set-up.

Todo:
change the name of isObjectConfigured to isConfigured

fix the policy for inline methods. Currently, all header files that define inline methods include the corresponding "_inl" file. This should make it unnecessary for the "_inl" file to be included by the body files. This must be checked on the ERC32 simulator. If confirmed, all inclusions of "_inl" files in body files should be removed.

See also:
DC_EventRepository

DataPool

ParameterDatabase

Tracer

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 130 of file CC_RootObject.h.

Public Member Functions

 CC_RootObject (void)
 Set the instance identifier and loads the newly created object in the system list.

virtual bool isObjectConfigured (void)
 Implement the object configuration check service.

TD_InstanceId getInstanceId (void) const
 Return the instance identifier of an object.

TD_ClassId getClassId (void) const
 Return the class identifier of an object.

void setClassId (TD_ClassId classId)
 Set the class identifier of an object.


Static Public Member Functions

bool isSystemConfigured (void)
 Implement the system configuration check service.

void setSystemListSize (TD_InstanceId systemListSize)
 Set the size of the system list representing the maximum number of objects that can be instantiated from class RootObject and its derived classes.

TD_InstanceId getSystemListSize (void)
 Return the size of the system list representing the maximum number of objects that can be instantiated from class RootObject and its derived classes.

void setEventRepository (DC_EventRepository *pEventRepository)
 Setter method for the event repository plug-in component.

DC_EventRepositorygetEventRepository (void)
 Getter method for the event repository plug-in component.

void setParameterDatabase (ParameterDatabase *pDatabase)
 Setter method for the system parameter database.

ParameterDatabasegetParameterDatabase (void)
 Getter method for the system parameter database.

void setDataPool (DataPool *pDataPool)
 Setter method for the system data pool.

DataPoolgetDataPool (void)
 Getter method for the system data pool.

void setTracer (Tracer *pTracer)
 Load the tracer plug-in object.

TracergetTracer (void)
 Getter method for the tracer plug-in.

void synchTrace (TD_TraceItem traceId)
 Implement the synch tracing service offered by the root class to all its children classes.

void packetTrace (unsigned int n, TD_TraceItem traceData[])
 Implement the packet tracing service offered by the root class to all its children classes.


Protected Member Functions

 ~CC_RootObject (void)
 Dummy class destructor that causes an assert violation and returns without taking any action.


Constructor & Destructor Documentation

CC_RootObject::CC_RootObject void   ) 
 

Set the instance identifier and loads the newly created object in the system list.

A static counter is maintained that is incremented by one every time this constructor is called. The value of this static counter becomes the instance identifier of the newly created object. The class identifier is initialized to an illegal value to signify that the object is not yet configured. The newly created object is loaded into the system list data structure. Thus, a pseudo-code implementation for the constructor is as follows:<PRE> objectCounter++; // static counter initialized to BASE_INSTANCE_ID instanceId=objectCounter; systemList[i]=this; classId=. . .; // initialize class ID to an illegal value This constructor will only execute correctly after the size of the system list has been initialized.

See also:
setSystemListSize

Definition at line 28 of file CC_RootObject.cpp.

CC_RootObject::~CC_RootObject void   )  [protected]
 

Dummy class destructor that causes an assert violation and returns without taking any action.

In order to eliminate the danger of dangling pointers and to make memory management safer, the framework adopts a coding rule that prescribes that no instances of framework classes can ever be destroyed (either on the heap or on the stack). Making the destructor of the root class of the framework class tree protected helps detect some violations of this rule statically at compile time. More specifically, it ensures that no instances of class CC_RootObject or its subclasses are ever destroyed outside the CC_RootObject class tree.

Subclasses that are intended to be final, should declare a private destructor. This effectively prevents them from being subclassed.

Definition at line 42 of file CC_RootObject.cpp.


Member Function Documentation

TD_ClassId CC_RootObject::getClassId void   )  const
 

Return the class identifier of an object.

The class identifier is defined when an object is initially configured and should not be altered afterwards.

Definition at line 73 of file CC_RootObject.cpp.

TD_InstanceId CC_RootObject::getInstanceId void   )  const
 

Return the instance identifier of an object.

The instance identifier is defined when an object is created and cannot be altered afterwards.

Definition at line 69 of file CC_RootObject.cpp.

TD_InstanceId CC_RootObject::getSystemListSize void   )  [static]
 

Return the size of the system list representing the maximum number of objects that can be instantiated from class RootObject and its derived classes.

See also:
setSystemListSize
Returns:
systemListSize the system list size

Definition at line 86 of file CC_RootObject.cpp.

bool CC_RootObject::isObjectConfigured void   )  [virtual]
 

Implement the object configuration check service.

The method returns true if the object is correctly configured. A RootObject is configured if:

  • the event repository has been loaded
  • the parameter database has been loaded
  • the data pool has been loaded
  • the tracer has been loaded
  • the class identifier has a legal value
The configuration check is class-specific and derived classes may have to provide their own implementation. Derived classes should however provide only incremental implementations. Consider for instance a class B that is derived from a class A. The implementation of isConfigured for class B should be as follows:<PRE> bool isConfigured() { if (!super.isConfigured()) return false; . . . // perform configuration checks specific to class A } In this way, each class benefits from the implementation of its super class.
Returns:
true if the object is configured, false otherwise.

Reimplemented in ControlBlock, DataItemControlBlock, DataPoolControlBlock, DC_BasicDatabase, DC_BasicDataPool, DC_ControlAction, DC_ControlList, DC_SampleFullDataPool, DC_SampleMonitoredDataPool, DC_SampleR1Database, DC_SampleR2Database, DC_SampleR3Database, PointerControlBlock, DC_EventRepository, DC_PUSEventRepository, DC_DeltaProfile, DC_FdirCheck, DC_ProfileList, DC_StuckDataProfile, RangeProfile, CC_PunctualActionManager, DC_BasicReconfigurer, ModeManager, PunctualActionListModeManager, CC_FSM, DC_FromFsmEvent, DC_FsmEvent, DC_NestedFsmActivator, DC_NestedFsmActivatorWithEndState, DC_NestedFsmActivatorWithExitCheck, CC_ManoeuvreFactory, CC_ManoeuvreManager, DC_ManoeuvrePunctualAction, CC_IntStack, CC_RootObjectStack, CC_TelecommandFactory, CC_TelecommandManager, CriticalTelecommand, DC_BasicPUSTcLoader, DC_DummyTelecommandLoader, DC_PUSClearDataReporting, DC_PUSControlDataReporting, DC_PUSDefineDataReporting, PUSDumpMemory, PUSMemoryLoad, PUSTelecommand, Telecommand, TelecommandLoader, CC_TelemetryManager, CC_TelemetryPacketFactory, DC_BasicPUSTmStream, DC_ByteArrayTelemetryStream, DC_CycleDataItem16TmStream, DC_DataItem16TmWord, DC_DummyTelemetryPacket, DC_PUSDataReportingPacket, DC_PUSTelemetryModeManager, DC_PUSTmLogger, PUSMemoryDump, PUSTelemetryPacket, StructuredTelemetryPacket, and TelemetryListModeManager.

Definition at line 57 of file CC_RootObject.cpp.

bool CC_RootObject::isSystemConfigured void   )  [static]
 

Implement the system configuration check service.

The method returns true if the system is correctly configured. The system is configured if all the objects instantiated from this class or its subclasses created up to the time the method is called are configured (i.e. if their isObjectConfigured method returns true). Thus, a pseudo-code implementation of this method is:

   for (int i=0; i smaller than NumberOfCreatedObjects; i++)
   if (!systemList[i].isObjectConfigured())
           return false;
   return true;   
where systemList holds the list of framework objects created to date.

This is a static method because the system list data structure upon which it acts is a static structure.

Returns:
true if the system is configured, false otherwise.

Definition at line 62 of file CC_RootObject.cpp.

void CC_RootObject::packetTrace unsigned int  n,
TD_TraceItem  traceData[]
[static]
 

Implement the packet tracing service offered by the root class to all its children classes.

When an object needs to send a packet trace signal, it calls this method and passes to it the tracer packet data. The sending of the signal is internally handled by the tracer plug-in object. Thus, a pseudo-code implementation for this method is as follows:

   tracer.sendPacketTrace(n,traceData)  
where tracer is the tracer plug-in object.

See also:
setTracer

Tracer

Parameters:
n number of trace data elements
traceData array of trace data

Definition at line 129 of file CC_RootObject.cpp.

void CC_RootObject::setClassId TD_ClassId  classId  ) 
 

Set the class identifier of an object.

The class identifier should be set when the application is configured and never changed afterwards.

This is an initialization method.

Parameters:
classId the class identifier of the class from which the object is instantiated

Definition at line 90 of file CC_RootObject.cpp.

void CC_RootObject::setEventRepository DC_EventRepository pEventRepository  )  [static]
 

Setter method for the event repository plug-in component.

The event repository thus loaded is used to store the event reports created with the event reporting service. This method is static to ensure that all event reports created by framework objects are sent to the same event repository.

Definition at line 94 of file CC_RootObject.cpp.

void CC_RootObject::setSystemListSize TD_InstanceId  systemListSize  )  [static]
 

Set the size of the system list representing the maximum number of objects that can be instantiated from class RootObject and its derived classes.

The RootObject class maintains an internal data structure

  • the system list - where all created instances of this and derived classes are held. This method causes memory for this data structure to be allocated and the data structure to be initialized.

This is a static method because it initializes a data structure - the system list - that is static.

This is an initialization method. It should be called before any object of type RootObject is instantiated. It should not be called more than once.

Parameters:
systemListSize the maximum number of framework objects that can be instantiated in the application

Definition at line 77 of file CC_RootObject.cpp.

void CC_RootObject::setTracer Tracer pTracer  )  [static]
 

Load the tracer plug-in object.

The tracer thus loaded is used to implement the tracing service. This method is static because all tracing signals are routed through the same tracing interface

Definition at line 119 of file CC_RootObject.cpp.

void CC_RootObject::synchTrace TD_TraceItem  traceId  )  [static]
 

Implement the synch tracing service offered by the root class to all its children classes.

When an object needs to send a synch trace signal, it calls this method and passes to it the identifier of the trace signal. The sending of the signal is internally handled by the tracer plug-in object. Thus, a pseudo-code implementation for this method is as follows:

   tracer.sendSynchTrace(traceId)  
where tracer is the tracer plug-in object.

See also:
setTracer

Tracer

Parameters:
traceId identifier of the synch trace signal

Definition at line 134 of file CC_RootObject.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved