Design Improvements #191
Updated by André Neto over 9 years ago
h1. Main definitions
h2. Object
The MARTe Object is a class which offers the following functionality:
# Can be managed through a shared/smart pointer mechanism;
# Can be automatically constructed given a class name;
# Provides a standard initialisation/configuration entry function;
# It has a name;
# Is introspectable.
## As a minimum the following information shall be available:
### The name of the class;
### The name of the object;
### The version of the class from which the code was compiled (i.e. revision control version)
## Shall enable reflection of derived classes that wish to expose this information.
As in the previous version of the framework any Object class instance shall automatically register itself in a class database. This database shall expose:
# All the classes that were instantiated by the framework for any given application;
# The number of objects that were instantiated for any given class.
It was agreed that as a general rule only the final classes (i.e. the ones to be used by the end-user) will inherit from Object. This implies that the final classes are constructed as a collection of direct inheritance from Object and from all the interfaces. It is likely that there will be some documented exceptions to this rule.
h2. Smart/shared pointers
As in the previous version of MARTe (i.e. BaseLib2) the framework shall support, promote and enforce the usage of shared pointers. This was implemented using GCRTemplate and GCRefences. Only minor refactoring is expected.
Naming of new classes to be agreed.
h2. Reference containers
As per previous framework, i.e.:
# Find by name
## Relative;
## Absolute;
# Find by index
With the following additions:
# Find(name) shall return a vector with all the references found for a given object name (and not the first that was found);
# Support reverse find, i.e. allow for a contained object to know who is its father;
Naming of classes to be agreed.
h2. Global object database
As per previous framework. We have discussed the possibility of having multiple global object database on top of an anonymous root, but the idea was not mature yet. h3.
h2. Object
The MARTe Object is a class which offers the following functionality:
# Can be managed through a shared/smart pointer mechanism;
# Can be automatically constructed given a class name;
# Provides a standard initialisation/configuration entry function;
# It has a name;
# Is introspectable.
## As a minimum the following information shall be available:
### The name of the class;
### The name of the object;
### The version of the class from which the code was compiled (i.e. revision control version)
## Shall enable reflection of derived classes that wish to expose this information.
As in the previous version of the framework any Object class instance shall automatically register itself in a class database. This database shall expose:
# All the classes that were instantiated by the framework for any given application;
# The number of objects that were instantiated for any given class.
It was agreed that as a general rule only the final classes (i.e. the ones to be used by the end-user) will inherit from Object. This implies that the final classes are constructed as a collection of direct inheritance from Object and from all the interfaces. It is likely that there will be some documented exceptions to this rule.
h2. Smart/shared pointers
As in the previous version of MARTe (i.e. BaseLib2) the framework shall support, promote and enforce the usage of shared pointers. This was implemented using GCRTemplate and GCRefences. Only minor refactoring is expected.
Naming of new classes to be agreed.
h2. Reference containers
As per previous framework, i.e.:
# Find by name
## Relative;
## Absolute;
# Find by index
With the following additions:
# Find(name) shall return a vector with all the references found for a given object name (and not the first that was found);
# Support reverse find, i.e. allow for a contained object to know who is its father;
Naming of classes to be agreed.
h2. Global object database
As per previous framework. We have discussed the possibility of having multiple global object database on top of an anonymous root, but the idea was not mature yet. h3.