Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2017-01-04 15:07:12 -0500
committerHenrik Rentz-Reichert2017-01-09 11:41:16 -0500
commit9b02d5a62ea41136b46b744f7b2c1cf50f30a888 (patch)
treed7473847da1a9e3a470195f384f62322b48057db /runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
parentb8fd69cd558c0673971bcdaea495131bc4d7cd82 (diff)
downloadorg.eclipse.etrice-9b02d5a62ea41136b46b744f7b2c1cf50f30a888.tar.gz
org.eclipse.etrice-9b02d5a62ea41136b46b744f7b2c1cf50f30a888.tar.xz
org.eclipse.etrice-9b02d5a62ea41136b46b744f7b2c1cf50f30a888.zip
Bug 509875 - [runtime.cpp] replace STL containers with own containers that are more light weight
* replaced streaming code with (s)printf constructs * added String, Vector, Set, Pair and Map with tests * using new String class in * Address * Message * MSCFilter * MSCLogger * RTObject * and affected classes * using new Vector class in * RTObject * MSCLogger * MessageServiceController * ReplicatedActorClassBase * ReplicatedInterfaceItemBase * and affected classes * using new Set class in * MessageDispatcher * using new Map class in * SubSystemClassBase * DebuggingService * adjusted cpp generator Change-Id: I9c91289057185e6e36b9453ecf03f6f6d3834ec6
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp61
1 files changed, 35 insertions, 26 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
index b2dedc349..7216a1640 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
@@ -15,7 +15,6 @@
#include "common/modelbase/ActorClassBase.h"
#include "common/modelbase/SubSystemClassBase.h"
#include "common/modelbase/InterfaceItemBase.h"
-#include <iostream>
namespace etRuntime {
@@ -32,66 +31,76 @@ DebuggingService::DebuggingService() :
}
const InterfaceItemBase* DebuggingService::getPort(const Address& address) const {
- std::map<Address, const InterfaceItemBase*>::const_iterator it = m_portInstances.find(address);
+ Map<Address, const InterfaceItemBase*>::const_iterator it = m_portInstances.find(address);
if (it != m_portInstances.end())
return it->second;
return 0;
}
-void DebuggingService::addMessageAsyncOut(const Address& source, const Address& target, const std::string& msg) {
+void DebuggingService::addMessageAsyncOut(const Address& source, const Address& target, const String& msg) {
const InterfaceItemBase* srcPort = getPort(source);
const InterfaceItemBase* tgtPort = getPort(target);
- if (srcPort != 0 && tgtPort != 0)
- m_asyncLogger.addMessageAsyncOut(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
- msg);
+ if (srcPort != 0 && tgtPort != 0) {
+ etRuntime::String srcPath = srcPort->getActor()->getInstancePath();
+ etRuntime::String tgtPath = tgtPort->getActor()->getInstancePath();
+ m_asyncLogger.addMessageAsyncOut(srcPath, tgtPath, msg);
+ }
}
-void DebuggingService::addMessageAsyncIn(const Address& source, const Address& target, const std::string& msg) {
+void DebuggingService::addMessageAsyncIn(const Address& source, const Address& target, const String& msg) {
const InterfaceItemBase* srcPort = getPort(source);
const InterfaceItemBase* tgtPort = getPort(target);
- if (srcPort != 0 && tgtPort != 0)
- m_asyncLogger.addMessageAsyncIn(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
- msg);
+ if (srcPort != 0 && tgtPort != 0) {
+ etRuntime::String srcPath = srcPort->getActor()->getInstancePath();
+ etRuntime::String tgtPath = tgtPort->getActor()->getInstancePath();
+ m_asyncLogger.addMessageAsyncIn(srcPath, tgtPath, msg);
+ }
}
-void DebuggingService::addMessageSyncCall(const Address& source, const Address& target, const std::string& msg) {
+void DebuggingService::addMessageSyncCall(const Address& source, const Address& target, const String& msg) {
const InterfaceItemBase* srcPort = getPort(source);
const InterfaceItemBase* tgtPort = getPort(target);
- if (srcPort != 0 && tgtPort != 0)
- m_asyncLogger.addMessageSyncCall(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
- msg);
+ if (srcPort != 0 && tgtPort != 0) {
+ etRuntime::String srcPath = srcPort->getActor()->getInstancePath();
+ etRuntime::String tgtPath = tgtPort->getActor()->getInstancePath();
+ m_asyncLogger.addMessageSyncCall(srcPath, tgtPath, msg);
+ }
}
-void DebuggingService::addMessageSyncReturn(const Address& source, const Address& target, const std::string& msg) {
+void DebuggingService::addMessageSyncReturn(const Address& source, const Address& target, const String& msg) {
const InterfaceItemBase* srcPort = getPort(source);
const InterfaceItemBase* tgtPort = getPort(target);
- if (srcPort != 0 && tgtPort != 0)
+ if (srcPort != 0 && tgtPort != 0) {
m_asyncLogger.addMessageSyncReturn(srcPort->getActor()->getInstancePath(),
tgtPort->getActor()->getInstancePath(), msg);
+ }
}
-void DebuggingService::addActorState(const ActorClassBase& actor, const std::string& state) {
- m_asyncLogger.addActorState(actor.getInstancePath(), state);
+void DebuggingService::addActorState(const ActorClassBase& actor, const String& state) {
+ etRuntime::String instancePath = actor.getInstancePath();
+ m_asyncLogger.addActorState(instancePath, state);
}
-void DebuggingService::addMessageActorCreate(const SubSystemClassBase& parent, const std::string& refName) {
- m_asyncLogger.addMessageActorCreate(parent.getInstancePath(),
- parent.getInstancePath() + IRTObject::PATH_DELIM + refName);
+void DebuggingService::addMessageActorCreate(const SubSystemClassBase& parent, const String& refName) {
+ etRuntime::String parentPath = parent.getInstancePath();
+ m_asyncLogger.addMessageActorCreate(parentPath, String(parentPath) + IRTObject::PATH_DELIM + refName);
}
-void DebuggingService::addMessageActorCreate(const ActorClassBase& parent, const std::string& refName) {
- m_asyncLogger.addMessageActorCreate(parent.getInstancePath(),
- parent.getInstancePath() + IRTObject::PATH_DELIM + refName);
+void DebuggingService::addMessageActorCreate(const ActorClassBase& parent, const String& refName) {
+ etRuntime::String parentPath = parent.getInstancePath();
+ m_asyncLogger.addMessageActorCreate(parentPath, String(parentPath) + IRTObject::PATH_DELIM + refName);
}
void DebuggingService::addMessageActorDestroy(const ActorClassBase& inst) {
+ etRuntime::String parentPath = inst.getParent()->getInstancePath();
+ etRuntime::String instancePath = inst.getInstancePath();
//if (!(inst.getParent() instanceof OptionalActorInterfaceBase))
- m_asyncLogger.addMessageActorDestroy(inst.getParent()->getInstancePath(), inst.getInstancePath());
+ m_asyncLogger.addMessageActorDestroy(parentPath, instancePath);
}
-void DebuggingService::addVisibleComment(const std::string& comment) {
+void DebuggingService::addVisibleComment(const String& comment) {
m_asyncLogger.addVisibleComment(comment);
}

Back to the top