updating code from Flying Laptop
This is the framework of Flying Laptop OBSW version A.13.0.
This commit is contained in:
@ -1,13 +1,3 @@
|
||||
/*
|
||||
* ObjectManager.cpp
|
||||
*
|
||||
* Created on: Sep 18, 2012
|
||||
* Author: baetz
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <framework/objectmanager/ObjectManager.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <cstdlib>
|
||||
@ -37,7 +27,6 @@ ReturnValue_t ObjectManager::insert( object_id_t id, SystemObjectIF* object) {
|
||||
}
|
||||
|
||||
ReturnValue_t ObjectManager::remove( object_id_t id ) {
|
||||
std::map<object_id_t, SystemObjectIF*>::iterator it = this->objectList.find( id );
|
||||
if ( this->getSystemObject(id) != NULL ) {
|
||||
this->objectList.erase( id );
|
||||
debug << "ObjectManager::removeObject: Object " << std::hex << (int)id << std::dec << " removed." << std::endl;
|
||||
@ -67,7 +56,6 @@ ObjectManager::ObjectManager( ) : produceObjects(NULL) {
|
||||
}
|
||||
|
||||
void ObjectManager::initialize() {
|
||||
//TODO: Include check if already initialized?
|
||||
this->produceObjects();
|
||||
ReturnValue_t return_value = RETURN_FAILED;
|
||||
uint32_t error_count = 0;
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
/**
|
||||
* @brief In the class's destructor, all objects in the list are deleted.
|
||||
*/
|
||||
//TODO: Check, if deleting works!
|
||||
//SHOULDDO: If, for some reason, deleting an ObjectManager instance is required, check if this works.
|
||||
virtual ~ObjectManager( void );
|
||||
ReturnValue_t insert( object_id_t id, SystemObjectIF* object );
|
||||
ReturnValue_t remove( object_id_t id );
|
||||
|
@ -8,6 +8,7 @@
|
||||
#ifndef OBJECTMANAGERIF_H_
|
||||
#define OBJECTMANAGERIF_H_
|
||||
|
||||
#include <framework/objectmanager/frameworkObjects.h>
|
||||
#include <config/objects/systemObjectList.h>
|
||||
#include <framework/objectmanager/SystemObjectIF.h>
|
||||
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
||||
@ -23,7 +24,7 @@
|
||||
*/
|
||||
class ObjectManagerIF : public HasReturnvaluesIF {
|
||||
public:
|
||||
static const uint8_t INTERFACE_ID = OBJECT_MANAGER_IF;
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::OBJECT_MANAGER_IF;
|
||||
static const ReturnValue_t INSERTION_FAILED = MAKE_RETURN_CODE( 1 );
|
||||
static const ReturnValue_t NOT_FOUND = MAKE_RETURN_CODE( 2 );
|
||||
protected:
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* SystemObject.cpp
|
||||
*
|
||||
* Created on: 07.11.2012
|
||||
* Author: mohr
|
||||
*/
|
||||
|
||||
#include <framework/events/EventManagerIF.h>
|
||||
#include <framework/objectmanager/ObjectManager.h>
|
||||
#include <framework/objectmanager/SystemObject.h>
|
||||
@ -22,7 +15,7 @@ SystemObject::~SystemObject() {
|
||||
}
|
||||
}
|
||||
|
||||
const object_id_t SystemObject::getObjectId() const {
|
||||
object_id_t SystemObject::getObjectId() const {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include <framework/events/Event.h>
|
||||
#include <framework/events/EventReportingProxyIF.h>
|
||||
#include <framework/ipc/MessageQueue.h>
|
||||
#include <framework/objectmanager/SystemObjectIF.h>
|
||||
#include <framework/timemanager/Clock.h>
|
||||
|
||||
/**
|
||||
* @brief This class automates insertion into the ObjectManager and
|
||||
@ -51,7 +51,7 @@ public:
|
||||
* @brief On destruction, the object removes itself from the list.
|
||||
*/
|
||||
virtual ~SystemObject();
|
||||
const object_id_t getObjectId() const;
|
||||
object_id_t getObjectId() const;
|
||||
virtual ReturnValue_t initialize();
|
||||
virtual ReturnValue_t checkObjectConnections();
|
||||
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
* This is a simple getter to return the object identifier.
|
||||
* @return Returns the object id of this object.
|
||||
*/
|
||||
virtual const object_id_t getObjectId() const = 0;
|
||||
virtual object_id_t getObjectId() const = 0;
|
||||
/**
|
||||
* The empty virtual destructor as required for C++ interfaces.
|
||||
*/
|
||||
|
21
objectmanager/frameworkObjects.h
Normal file
21
objectmanager/frameworkObjects.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef FRAMEWORK_OBJECTMANAGER_FRAMEWORKOBJECTS_H_
|
||||
#define FRAMEWORK_OBJECTMANAGER_FRAMEWORKOBJECTS_H_
|
||||
|
||||
namespace objects {
|
||||
enum framework_objects {
|
||||
//Generic IDs for IPC, modes, health, events
|
||||
HEALTH_TABLE = 0x53010000,
|
||||
// MODE_STORE = 0x53010100,
|
||||
EVENT_MANAGER = 0x53030000,
|
||||
INTERNAL_ERROR_REPORTER = 0x53040000,
|
||||
IPC_STORE = 0x534f0300,
|
||||
//IDs for PUS Packet Communication
|
||||
TC_STORE = 0x534f0100,
|
||||
TM_STORE = 0x534f0200,
|
||||
NO_OBJECT = 0xFFFFFFFF
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* FRAMEWORK_OBJECTMANAGER_FRAMEWORKOBJECTS_H_ */
|
Reference in New Issue
Block a user