#include <CC_RootObject.h>
Inheritance diagram for CC_RootObject:
This class defines four attributes and four services that are made available to its children classes. The attributes are:
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:
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.
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.
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_EventRepository * | getEventRepository (void) |
Getter method for the event repository plug-in component. | |
void | setParameterDatabase (ParameterDatabase *pDatabase) |
Setter method for the system parameter database. | |
ParameterDatabase * | getParameterDatabase (void) |
Getter method for the system parameter database. | |
void | setDataPool (DataPool *pDataPool) |
Setter method for the system data pool. | |
DataPool * | getDataPool (void) |
Getter method for the system data pool. | |
void | setTracer (Tracer *pTracer) |
Load the tracer plug-in object. | |
Tracer * | getTracer (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. |
|
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.
Definition at line 28 of file CC_RootObject.cpp. |
|
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 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. |
|
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. |
|
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. |
|
Return the size of the system list representing the maximum number of objects that can be instantiated from class
Definition at line 86 of file CC_RootObject.cpp. |
|
|
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 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.
Definition at line 62 of file CC_RootObject.cpp. |
|
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.
Definition at line 129 of file CC_RootObject.cpp. |
|
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.
Definition at line 90 of file CC_RootObject.cpp. |
|
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. |
|
Set the size of the system list representing the maximum number of objects that can be instantiated from class
The
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
Definition at line 77 of file CC_RootObject.cpp. |
|
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. |
|
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.
Definition at line 134 of file CC_RootObject.cpp. |