This page describes the instantiator generator meta-components that are offered by the OBS Framework. The set of meta-components is currently being expanded and the offering in the future releases of the OBS Framework will be correspondingly larger.
Matlab Bridge
The OBS Framework offers a "bridge" to code generated by the Real-Time Workshop facility
of the Matlab suite. The objective is to allow
users of the framework to integrate Matlab-generated code with the framework components.
This Matlab bridge takes the form of a meta-component that generates a C++ class that
acts as a wrapper for a Matlab-generated routine. It is assumed that Matlab would be
used to model control algorithms or digital filters and hence the wrapper class is
intended to represent an OBS Framework control block. It is therefore
built as an extension of the abstract framework class
ControlBlock
.
The meta-component for the Matlab bridge is implemented by the following XSL programs:
- GenerateMatlabWrapperHeader: generation of the header file for the Matlab wrapper class.
- GenerateMatlabWrapperBody: generation of the body file for the Matlab wrapper class.
The Ant build file runGeneratorMetaComponent defines a
target (genMatlabWR
) to run the two programs in sequence.
The XSL programs process an XML file (the Matlab wrapper descriptor) that describes the Matlab-generated code to be wrapped. Four examples of matlab wrapper classes generated by this meta-component and corresponding to four different link modes for the wrapper parameters are:
- Class
DC_MatlabCopyPid generated from this wrapper descriptor file. - Class
DC_MatlabPointerPid generated from this wrapper descriptor file. - Class
DC_MatlabDataItemPid generated from this wrapper descriptor file. - Class
DC_MatlabDataPoolPid generated from this wrapper descriptor file.
Additionally, an application feature model can serve as input Matlab wrapper descriptor. The initial comment of the GenerateMatlabWrapperHeader program states the assumptions about the Matlab code generation process.
Indexed Parameter Database
The OBS Framework defines an abstract class to encapsulate the concept of parameter database. The
framework also offers a concrete implementation of this class representing a basic type
of parameter database (see class
DC_BasicDatabase
. This generator meta-component allows a more sophisticated type of database class
to be constructed. The database is more sophisticated in that it encapsulates a
user-defined "database map" and in that it can offer varying levels of protection
against illegal accesses to the database parameters. The price paid for the
implementation of these features is a higher memory and execution time overhead than in
the case of the default parameter database. The database map is defined by the designer
who specifies the parameters to be modelled by the database, their synticatical type,
and their relative position within the database. This meta-component can therefore
directly transform a specification of the database into an implementation that complies
with the framework interfaces and can therefore be integrated with other framework components.
The meta-component for the indexed parameter database is implemented by the following XSL programs:
- GenerateParameterDatabaserHeader: generation of the header file for the parameter database class.
- GenerateParameterDatabaseBody: generation of the body file for the parameter database class.
-
GenerateParameterDatabaseInclude:
generation of an
#include
that defines the symbolic constants to access the items in the parameter database. - GenerateParameterDatabaseTestCaseHeader: generation of the header file for the test case for the parameter database class.
- GenerateParameterDatabaseTestCaseBody: generation of the body file for the test case for the parameter database class.
The Ant build file runGeneratorMetaComponent defines a
target (genParameterDatabase
) to run the above programs in sequence.
The XSL programs process an XML file (the parameter database descriptor file) that describes the database map and specifies the desired level of robustness to illegal database accesses. An application feature model can serve as input parameter database descriptor file. Three examples of parameter database classes corresponding to three different levels of robutsness to illegal database accesses are:
- From the XML database descriptor SampleParameterDbR1 the parameter
database class
DC_SampleParameterDbR1
and the test classTestCaseSampleParameterDbR1_1
are generated. . - From the XML database descriptor SampleParameterDbR2 the parameter
database class
DC_SampleParameterDbR2
and the test classTestCaseSampleParameterDbR2_1
are generated. . - From the XML database descriptor SampleParameterDbR3 the parameter
database class
DC_SampleParameterDbR3
and the test classTestCaseSampleParameterDbR3_1
are generated. .
Indexed Data Pool
The OBS Framework defines an abstract class to encapsulate the concept of data pool. The framework also
offers a concrete implementation of this class representing a basic type of data pool
(see class
DC_BasicDataPool
. This generator meta-component allows a more sophisticated type of data pool class
to be constructed. The data pool is more sophisticated in that it allows the designer to
specify the "data pool map" and to specify the attributes of the items in the data pool.
The price paid for the implementation of these features is a higher memory and execution
time overhead than in the case of the default data pool. The data pool map is defined by
the designer who specifies the items to be contained in the data pool and their
syntactical type. This meta-component can therefore directly transform a specification
of the data pool into an implementation that complies with the framework interfaces and
can therefore be integrated with other framework components.
The meta-component for the indexed data pool is implemented by the following XSL programs:
- GenerateDataPoolHeader: generation of the header file for the data pool class.
- GenerateDataPoolBody: generation of the body file for the data pool class.
-
GenerateDataPoolInclude:
generation of an
#include
that defines the symbolic constants to access the items in the data pool. - GenerateDataPoolTestCaseHeader: generation of the header file for the test case for the data pool class.
- GenerateDataPoolTestCaseBody: generation of the body file for the test case for the data pool class.
The Ant build file runGeneratorMetaComponent defines a
target (genDatapool
) to run the above programs in sequence.
The XSL programs process an XML file (the datapool descriptor file) that describes the datapool and specifies the desired level of robustness to illegal database accesses. An application feature model can serve as input datapool descriptor file. Two examples of data pool classes corresponding to two different sets of data pool attributes are:
- From the XML database descriptor SampleFullDataPool the data pool
class
DC_SampleFullDataPool
and the test classTestCaseSampleFullDataPool_1
are generated. . - From the XML database descriptor SampleMonitoredDataPool the
datapool class
DC_SampleMonitoredDataPool
and the test classTestCaseSampleMonitoredDataPool_1
are generated. .
Dynamic Factories
The OBS Framework uses dynamic factories to emulate dynamic object creation at run time in a manner that is compatible with real-time constraints. The OBS Framework provides three types of dynamic factories:
- The telemetry packet factory to provide components that encapsulate telemetry
packets (instances of abstract class
TelemetryPacket
) - The telecommand factory to provide components that encapsulate telecommands
(instances of abstract class
Telecommand
) - The manoeuvre factory to provide components that encapsulate telecommands
(instances of abstract class
Manoeuvre
)
Dynamic factories must be tailored to the specific types of the items they provide and to the number of items of each type that they provide. The OBS Framework provides a generator meta-component to generate the dynamic factories. This meta-component is implemented by the following XSL programs:
- GenerateDynamicFactoryHeader: generation of the header file for the dynamic factory.
- GenerateDynamicFactoryBody: generation of the body file for the dynamic factory.
The Ant build file runGeneratorMetaComponent defines a
target (genDynFactory
) to run the above programs in sequence.
The XSL programs process an XML file (the dynamic factory descriptor file) that describes the dynamic factories. An application feature model can serve as input dynamic factory descriptor file. Three examples of dynamic factories included in the OBS Framework are:
- From the XML database descriptor SampleTelecommands the dynamic factory
class
CC_TelecommandFactory is generated. . - From the XML database
descriptor SampleTelemetryPackets the dynamic
factory class
CC_TelemetryPacketFactory is generated. . - From the
XML database descriptor SampleManoeuvres the dynamic factory
class
CC_ManoeuvreFactory
is generated. .
Custom Classes
The OBS Framework typically defines abstract classes that must be instantiated by the application developer. In many cases, it also provides default implementations for these abstract classes but some applications will need custom implementations. In order to help their developers, instantiator meta-components are provided that generate stub versions of these classes. The following such custom class generators are provided at present (with self-explanatory names):
Containers
A container is a component that acts as a container for objects or variable values. Robust container classes must be parameterized by the syntactical type of object or variable that they hold. In C++, this kind of parameterization is implemented using the template mechanism. Templates however are not permitted in the OBS Framework because of the restricted language subset adopted for the framework. Automatic code generation offers an alternative mechanism.
One generator meta-component is implemented for each type of container. At present, the OBS Framework offers only meta-component to implement a stack-like container (FIFO container). The generator allows a container to be generated for a particular type of contained object or variable. The two XSL programs that implement this meta-component are:
- GenerateStackContainerHeader: generation of the header file for the stack container class.
- GenerateStackContainerBody: generation of the body file for the stack container class.
The Ant build file runGeneratorMetaComponent defines a
target (genStkCont
) to run the above programs in sequence.
The XSL programs process an XML file (the stack container descriptor) that describes the container to be generated. The structure of the XML file is described in the initial comment of the GenerateStackContainerHeader program. Two examples of stack container classes corresponding to two different types of contained items are:
- From the XML database descriptor IntStack the
stack container class
CC_IntStack
and the test classTestCaseIntStack_1
are generated. . - From the XML database descriptor CC_RootObjectStack the stack container
class
CC_RootObject
and the test classTestCaseRootObject_1
are generated. .