event git update #16

Manually merged
muellerr merged 2 commits from event/git-update into mueller/master 2020-08-28 17:58:45 +02:00
18 changed files with 826 additions and 824 deletions

View File

@ -1,4 +1,4 @@
#include "../events/Event.h"
#include "Event.h"
namespace EVENT {
EventId_t getEventId(Event event) {
return (event & 0xFFFF);

View File

@ -1,10 +1,10 @@
#ifndef FRAMEWORK_EVENTS_EVENT_H_
#define FRAMEWORK_EVENTS_EVENT_H_
#ifndef EVENTOBJECT_EVENT_H_
#define EVENTOBJECT_EVENT_H_
#include <cstdint>
#include "../events/fwSubsystemIdRanges.h"
#include <stdint.h>
#include "fwSubsystemIdRanges.h"
//could be move to more suitable location
#include <subsystemIdRanges.h>
#include <config/tmtc/subsystemIdRanges.h>
typedef uint16_t EventId_t;
typedef uint8_t EventSeverity_t;
@ -21,7 +21,6 @@ EventSeverity_t getSeverity(Event event);
Event makeEvent(EventId_t eventId, EventSeverity_t eventSeverity);
}
namespace SEVERITY {
static const EventSeverity_t INFO = 1;
static const EventSeverity_t LOW = 2;
@ -42,4 +41,4 @@ namespace SEVERITY {
// static const EventSeverity_t HIGH = 4;
//};
#endif /* FRAMEWORK_EVENTS_EVENT_H_ */
#endif /* EVENTOBJECT_EVENT_H_ */

View File

@ -1,5 +1,5 @@
#include "../events/EventManager.h"
#include "../events/EventMessage.h"
#include "EventManager.h"
#include "EventMessage.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#include "../ipc/QueueFactory.h"
#include "../ipc/MutexFactory.h"
@ -111,25 +111,23 @@ ReturnValue_t EventManager::unsubscribeFromEventRange(MessageQueueId_t listener,
#ifdef DEBUG
//forward declaration, should be implemented by mission
const char* translateObject(object_id_t object);
const char * translateEvents(Event event);
void EventManager::printEvent(EventMessage* message) {
const char *string = 0;
switch (message->getSeverity()) {
case SEVERITY::INFO:
// string = translateObject(message->getReporter());
// sif::info << "EVENT: ";
// if (string != 0) {
// sif::info << string;
// } else {
// sif::info << "0x" << std::hex << message->getReporter() << std::dec;
// }
// sif::info << " reported " << translateEvents(message->getEvent()) << " ("
// << std::dec << message->getEventId() << std::hex << ") P1: 0x"
// << message->getParameter1() << " P2: 0x"
// << message->getParameter2() << std::dec << std::endl;
#ifdef DEBUG_INFO_EVENT
string = translateObject(message->getReporter());
sif::info << "EVENT: ";
if (string != 0) {
sif::info << string;
} else {
sif::info << "0x" << std::hex << message->getReporter() << std::dec;
}
sif::info << " reported " << translateEvents(message->getEvent()) << " ("
<< std::dec << message->getEventId() << std::hex << ") P1: 0x"
<< message->getParameter1() << " P2: 0x"
<< message->getParameter2() << std::dec << std::endl;
#endif
break;
default:
string = translateObject(message->getReporter());
@ -152,7 +150,6 @@ void EventManager::printEvent(EventMessage* message) {
<< std::endl;
break;
}
}
#endif

View File

@ -1,8 +1,8 @@
#ifndef EVENTMANAGER_H_
#define EVENTMANAGER_H_
#include "../events/eventmatching/EventMatchTree.h"
#include "../events/EventManagerIF.h"
#include "eventmatching/EventMatchTree.h"
#include "EventManagerIF.h"
#include "../objectmanager/SystemObject.h"
#include "../storagemanager/LocalPool.h"
#include "../tasks/ExecutableObjectIF.h"
@ -10,6 +10,12 @@
#include "../ipc/MutexIF.h"
#include <map>
#ifdef DEBUG
// forward declaration, should be implemented by mission
extern const char* translateObject(object_id_t object);
extern const char* translateEvents(Event event);
#endif
class EventManager: public EventManagerIF,
public ExecutableObjectIF,
public SystemObject {

View File

@ -1,8 +1,8 @@
#ifndef EVENTMANAGERIF_H_
#define EVENTMANAGERIF_H_
#include "../events/eventmatching/eventmatching.h"
#include "../events/EventMessage.h"
#include "eventmatching/eventmatching.h"
#include "EventMessage.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../ipc/MessageQueueSenderIF.h"

View File

@ -1,4 +1,4 @@
#include "../events/EventMessage.h"
#include "EventMessage.h"
#include <cstring>
EventMessage::EventMessage() {

View File

@ -1,7 +1,7 @@
#ifndef EVENTMESSAGE_H_
#define EVENTMESSAGE_H_
#include "../events/Event.h"
#include "Event.h"
#include "../ipc/MessageQueueMessage.h"
#include "../objectmanager/ObjectManagerIF.h"

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_EVENTS_EVENTREPORTINGPROXYIF_H_
#define FRAMEWORK_EVENTS_EVENTREPORTINGPROXYIF_H_
#include "../events/Event.h"
#include "Event.h"
class EventReportingProxyIF {

View File

@ -1,4 +1,4 @@
#include "../../events/eventmatching/EventIdRangeMatcher.h"
#include "EventIdRangeMatcher.h"
EventIdRangeMatcher::EventIdRangeMatcher(EventId_t lower, EventId_t upper,
bool inverted) : EventRangeMatcherBase<EventId_t>(lower, upper, inverted) {

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_EVENTS_EVENTMATCHING_EVENTIDRANGEMATCHER_H_
#define FRAMEWORK_EVENTS_EVENTMATCHING_EVENTIDRANGEMATCHER_H_
#include "../../events/eventmatching/EventRangeMatcherBase.h"
#include "EventRangeMatcherBase.h"
class EventIdRangeMatcher: public EventRangeMatcherBase<EventId_t> {
public:

View File

@ -1,7 +1,7 @@
#include "../../events/eventmatching/EventIdRangeMatcher.h"
#include "../../events/eventmatching/EventMatchTree.h"
#include "../../events/eventmatching/ReporterRangeMatcher.h"
#include "../../events/eventmatching/SeverityRangeMatcher.h"
#include "EventIdRangeMatcher.h"
#include "EventMatchTree.h"
#include "ReporterRangeMatcher.h"
#include "SeverityRangeMatcher.h"
EventMatchTree::EventMatchTree(StorageManagerIF* storageBackend,
bool invertedMatch) :

View File

@ -1,4 +1,4 @@
#include "../../events/eventmatching/ReporterRangeMatcher.h"
#include "ReporterRangeMatcher.h"
ReporterRangeMatcher::ReporterRangeMatcher(object_id_t lower, object_id_t upper,
bool inverted) : EventRangeMatcherBase<object_id_t>(lower, upper, inverted) {

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_EVENTS_EVENTMATCHING_REPORTERRANGEMATCHER_H_
#define FRAMEWORK_EVENTS_EVENTMATCHING_REPORTERRANGEMATCHER_H_
#include "../../events/eventmatching/EventRangeMatcherBase.h"
#include "EventRangeMatcherBase.h"
class ReporterRangeMatcher: public EventRangeMatcherBase<object_id_t> {
public:

View File

@ -1,4 +1,4 @@
#include "../../events/eventmatching/SeverityRangeMatcher.h"
#include "SeverityRangeMatcher.h"
#include "../../events/EventMessage.h"
#include "../../serialize/SerializeAdapter.h"

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_EVENTS_EVENTMATCHING_SEVERITYRANGEMATCHER_H_
#define FRAMEWORK_EVENTS_EVENTMATCHING_SEVERITYRANGEMATCHER_H_
#include "../../events/eventmatching/EventRangeMatcherBase.h"
#include "EventRangeMatcherBase.h"
class SeverityRangeMatcher: public EventRangeMatcherBase<EventSeverity_t> {
public:

View File

@ -1,10 +1,10 @@
#ifndef EVENTMATCHING_H_
#define EVENTMATCHING_H_
#include "../../events/eventmatching/EventIdRangeMatcher.h"
#include "../../events/eventmatching/EventMatchTree.h"
#include "../../events/eventmatching/ReporterRangeMatcher.h"
#include "../../events/eventmatching/SeverityRangeMatcher.h"
#include "EventIdRangeMatcher.h"
#include "EventMatchTree.h"
#include "ReporterRangeMatcher.h"
#include "SeverityRangeMatcher.h"
#endif /* EVENTMATCHING_H_ */