Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp39
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h3
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp10
3 files changed, 40 insertions, 12 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp
index 0f201c20f..83fa9cd55 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp
@@ -108,24 +108,45 @@ void RTSystemServicesProtocolConjPort::receive(const Message* msg) {
// sent messages
void RTSystemServicesProtocolConjPort::executeInitialTransition() {
+ executeInitialTransition_impl();
+}
+
+void RTSystemServicesProtocolConjPort::executeInitialTransition_impl() {
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_executeInitialTransition));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_executeInitialTransition));
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_executeInitialTransition));
+ if (getPeerAddress().isValid()) {
+ Message* buffer = dynamic_cast<IMessageService*>(getPeerMsgReceiver())->getMessageBuffer(sizeof(Message));
+ if (buffer) {
+ getPeerMsgReceiver()->receive(new (buffer) Message(getPeerAddress(), RTSystemServicesProtocol::IN_executeInitialTransition));
+ }
}
}
void RTSystemServicesProtocolConjPort::startDebugging() {
+ startDebugging_impl();
+}
+
+void RTSystemServicesProtocolConjPort::startDebugging_impl() {
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_startDebugging));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_startDebugging));
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_startDebugging));
+ if (getPeerAddress().isValid()) {
+ Message* buffer = dynamic_cast<IMessageService*>(getPeerMsgReceiver())->getMessageBuffer(sizeof(Message));
+ if (buffer) {
+ getPeerMsgReceiver()->receive(new (buffer) Message(getPeerAddress(), RTSystemServicesProtocol::IN_startDebugging));
+ }
}
}
void RTSystemServicesProtocolConjPort::stopDebugging() {
+ stopDebugging_impl();
+}
+
+void RTSystemServicesProtocolConjPort::stopDebugging_impl() {
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_stopDebugging));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_stopDebugging));
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_stopDebugging));
+ if (getPeerAddress().isValid()) {
+ Message* buffer = dynamic_cast<IMessageService*>(getPeerMsgReceiver())->getMessageBuffer(sizeof(Message));
+ if (buffer) {
+ getPeerMsgReceiver()->receive(new (buffer) Message(getPeerAddress(), RTSystemServicesProtocol::IN_stopDebugging));
+ }
}
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h
index 7682e9359..49f575623 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h
@@ -96,8 +96,11 @@ class RTSystemServicesProtocolConjPort : public etRuntime::PortBase {
// sent messages
public: void executeInitialTransition();
+ private: void executeInitialTransition_impl();
public: void startDebugging();
+ private: void startDebugging_impl();
public: void stopDebugging();
+ private: void stopDebugging_impl();
};
//------------------------------------------------------------------------------------------------------------
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 c7f73870d..d88f10b86 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
@@ -30,12 +30,16 @@ StaticMessageMemory::~StaticMessageMemory() {
}
Message* StaticMessageMemory::getMessageBuffer(size_t size) {
- if(size <= m_size && m_msgPool.getSize() > 0) {
- return const_cast<Message*>(m_msgPool.pop());
+ if(size > m_size) {
+ std::cout << "Could not provide message buffer (message too big)!" << std::endl;
+ }
+ else if(m_msgPool.getSize() <= 0) {
+ std::cout << "Could not provide message buffer (message pool is empty)!" << std::endl;
}
else {
- return 0;
+ return const_cast<Message*>(m_msgPool.pop());
}
+ return NULL;
}
void StaticMessageMemory::returnMessageBuffer(const Message* buffer) {

Back to the top