Merge remote-tracking branch 'upstream/master' into mueller_MessageNamespaceRenamed

This commit is contained in:
2020-08-25 14:02:48 +02:00
395 changed files with 6939 additions and 3803 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef HASHEALTHIF_H_
#define HASHEALTHIF_H_
#include <framework/events/Event.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/ipc/MessageQueueSenderIF.h>
#include "../events/Event.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueSenderIF.h"
class HasHealthIF {
public:
+5 -5
View File
@@ -1,6 +1,6 @@
#include <framework/health/HealthHelper.h>
#include <framework/ipc/MessageQueueSenderIF.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include "HealthHelper.h"
#include "../ipc/MessageQueueSenderIF.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId) :
healthTable(NULL), eventSender(NULL), objectId(objectId), parentQueue(
0), owner(owner) {
@@ -29,11 +29,11 @@ HasHealthIF::HealthState HealthHelper::getHealth() {
}
ReturnValue_t HealthHelper::initialize(MessageQueueId_t parentQueue) {
setParentQeueue(parentQueue);
setParentQueue(parentQueue);
return initialize();
}
void HealthHelper::setParentQeueue(MessageQueueId_t parentQueue) {
void HealthHelper::setParentQueue(MessageQueueId_t parentQueue) {
this->parentQueue = parentQueue;
}
+8 -8
View File
@@ -1,13 +1,13 @@
#ifndef HEALTHHELPER_H_
#define HEALTHHELPER_H_
#include <framework/events/EventManagerIF.h>
#include <framework/events/EventReportingProxyIF.h>
#include <framework/health/HasHealthIF.h>
#include <framework/health/HealthMessage.h>
#include <framework/health/HealthTableIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "../events/EventManagerIF.h"
#include "../events/EventReportingProxyIF.h"
#include "HasHealthIF.h"
#include "HealthMessage.h"
#include "HealthTableIF.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
/**
* Helper class for Objects that implement HasHealthIF
@@ -78,7 +78,7 @@ public:
/**
* @param parentQueue the Queue id of the parent object. Set to 0 if no parent present
*/
void setParentQeueue(MessageQueueId_t parentQueue);
void setParentQueue(MessageQueueId_t parentQueue);
/**
*
+1 -1
View File
@@ -1,4 +1,4 @@
#include <framework/health/HealthMessage.h>
#include "HealthMessage.h"
void HealthMessage::setHealthMessage(CommandMessage* message, Command_t command,
HasHealthIF::HealthState health, HasHealthIF::HealthState oldHealth) {
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef HEALTHMESSAGE_H_
#define HEALTHMESSAGE_H_
#include <framework/health/HasHealthIF.h>
#include <framework/ipc/CommandMessage.h>
#include "HasHealthIF.h"
#include "../ipc/CommandMessage.h"
class HealthMessage {
public:
+17 -17
View File
@@ -1,6 +1,6 @@
#include <framework/health/HealthTable.h>
#include <framework/serialize/SerializeAdapter.h>
#include <framework/ipc/MutexFactory.h>
#include "HealthTable.h"
#include "../serialize/SerializeAdapter.h"
#include "../ipc/MutexFactory.h"
HealthTable::HealthTable(object_id_t objectid) :
SystemObject(objectid) {
@@ -26,7 +26,7 @@ ReturnValue_t HealthTable::registerObject(object_id_t object,
void HealthTable::setHealth(object_id_t object,
HasHealthIF::HealthState newState) {
mutex->lockMutex(MutexIF::NO_TIMEOUT);
mutex->lockMutex(MutexIF::BLOCKING);
HealthMap::iterator iter = healthMap.find(object);
if (iter != healthMap.end()) {
iter->second = newState;
@@ -36,7 +36,7 @@ void HealthTable::setHealth(object_id_t object,
HasHealthIF::HealthState HealthTable::getHealth(object_id_t object) {
HasHealthIF::HealthState state = HasHealthIF::HEALTHY;
mutex->lockMutex(MutexIF::NO_TIMEOUT);
mutex->lockMutex(MutexIF::BLOCKING);
HealthMap::iterator iter = healthMap.find(object);
if (iter != healthMap.end()) {
state = iter->second;
@@ -46,7 +46,7 @@ HasHealthIF::HealthState HealthTable::getHealth(object_id_t object) {
}
uint32_t HealthTable::getPrintSize() {
mutex->lockMutex(MutexIF::NO_TIMEOUT);
mutex->lockMutex(MutexIF::BLOCKING);
uint32_t size = healthMap.size() * 5 + 2;
mutex->unlockMutex();
return size;
@@ -54,7 +54,7 @@ uint32_t HealthTable::getPrintSize() {
bool HealthTable::hasHealth(object_id_t object) {
bool exits = false;
mutex->lockMutex(MutexIF::NO_TIMEOUT);
mutex->lockMutex(MutexIF::BLOCKING);
HealthMap::iterator iter = healthMap.find(object);
if (iter != healthMap.end()) {
exits = true;
@@ -63,21 +63,21 @@ bool HealthTable::hasHealth(object_id_t object) {
return exits;
}
void HealthTable::printAll(uint8_t* pointer, uint32_t maxSize) {
mutex->lockMutex(MutexIF::NO_TIMEOUT);
uint32_t size = 0;
void HealthTable::printAll(uint8_t* pointer, size_t maxSize) {
mutex->lockMutex(MutexIF::BLOCKING);
size_t size = 0;
uint16_t count = healthMap.size();
ReturnValue_t result = SerializeAdapter<uint16_t>::serialize(&count,
&pointer, &size, maxSize, true);
ReturnValue_t result = SerializeAdapter::serialize(&count,
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
HealthMap::iterator iter;
for (iter = healthMap.begin();
iter != healthMap.end() && result == HasReturnvaluesIF::RETURN_OK;
++iter) {
result = SerializeAdapter<object_id_t>::serialize(&iter->first,
&pointer, &size, maxSize, true);
result = SerializeAdapter::serialize(&iter->first,
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
uint8_t health = iter->second;
result = SerializeAdapter<uint8_t>::serialize(&health, &pointer, &size,
maxSize, true);
result = SerializeAdapter::serialize(&health, &pointer, &size,
maxSize, SerializeIF::Endianness::BIG);
}
mutex->unlockMutex();
}
@@ -85,7 +85,7 @@ void HealthTable::printAll(uint8_t* pointer, uint32_t maxSize) {
ReturnValue_t HealthTable::iterate(
std::pair<object_id_t, HasHealthIF::HealthState> *value, bool reset) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
mutex->lockMutex(MutexIF::NO_TIMEOUT);
mutex->lockMutex(MutexIF::BLOCKING);
if (reset) {
mapIterator = healthMap.begin();
}
+4 -4
View File
@@ -1,9 +1,9 @@
#ifndef HEALTHTABLE_H_
#define HEALTHTABLE_H_
#include <framework/health/HealthTableIF.h>
#include <framework/objectmanager/SystemObject.h>
#include <framework/ipc/MutexIF.h>
#include "HealthTableIF.h"
#include "../objectmanager/SystemObject.h"
#include "../ipc/MutexIF.h"
#include <map>
typedef std::map<object_id_t, HasHealthIF::HealthState> HealthMap;
@@ -21,7 +21,7 @@ public:
virtual HasHealthIF::HealthState getHealth(object_id_t);
virtual uint32_t getPrintSize();
virtual void printAll(uint8_t *pointer, uint32_t maxSize);
virtual void printAll(uint8_t *pointer, size_t maxSize);
protected:
MutexIF* mutex;
+4 -4
View File
@@ -1,9 +1,9 @@
#ifndef HEALTHTABLEIF_H_
#define HEALTHTABLEIF_H_
#include <framework/health/ManagesHealthIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include "ManagesHealthIF.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include <map>
@@ -17,7 +17,7 @@ public:
HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY) = 0;
virtual uint32_t getPrintSize() = 0;
virtual void printAll(uint8_t *pointer, uint32_t maxSize) = 0;
virtual void printAll(uint8_t *pointer, size_t maxSize) = 0;
protected:
virtual ReturnValue_t iterate(std::pair<object_id_t,HasHealthIF::HealthState> *value, bool reset = false) = 0;
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef FRAMEWORK_HEALTH_MANAGESHEALTHIF_H_
#define FRAMEWORK_HEALTH_MANAGESHEALTHIF_H_
#include <framework/health/HasHealthIF.h>
#include <framework/objectmanager/ObjectManagerIF.h>
#include "HasHealthIF.h"
#include "../objectmanager/ObjectManagerIF.h"
class ManagesHealthIF {
public:
virtual ~ManagesHealthIF() {