diff options
author | Henrik Rentz-Reichert | 2017-01-04 20:07:12 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2017-01-09 16:41:16 +0000 |
commit | 9b02d5a62ea41136b46b744f7b2c1cf50f30a888 (patch) | |
tree | d7473847da1a9e3a470195f384f62322b48057db /runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp | |
parent | b8fd69cd558c0673971bcdaea495131bc4d7cd82 (diff) | |
download | org.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/messaging/StaticMessageMemory.cpp')
-rw-r--r-- | runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp index d88f10b86..c92b01d90 100644 --- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp +++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp @@ -11,10 +11,11 @@ *******************************************************************************/ #include "common/messaging/StaticMessageMemory.h" +#include <new> namespace etRuntime { -StaticMessageMemory::StaticMessageMemory(IRTObject* parent, const std::string& name, size_t size, int number) : +StaticMessageMemory::StaticMessageMemory(IRTObject* parent, const String& name, size_t size, int number) : RTObject(parent, name), m_size(size), m_msgPool(NULL, "memory"), m_buffer(0) { m_buffer = new uint8_t[m_size * number]; uint8_t* ptr = m_buffer; @@ -31,10 +32,10 @@ StaticMessageMemory::~StaticMessageMemory() { Message* StaticMessageMemory::getMessageBuffer(size_t size) { if(size > m_size) { - std::cout << "Could not provide message buffer (message too big)!" << std::endl; + printf("Could not provide message buffer (message too big)!\n"); } else if(m_msgPool.getSize() <= 0) { - std::cout << "Could not provide message buffer (message pool is empty)!" << std::endl; + printf("Could not provide message buffer (message pool is empty)!\n"); } else { return const_cast<Message*>(m_msgPool.pop()); |