Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
index fcf619c9c..ab2f54a8b 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Peter Karlitschek (initial contribution)
- *
- *******************************************************************************/
-
-#include "MessageSeQueue.h"
-
-namespace etRuntime {
-
-
-MessageSeQueue::~MessageSeQueue() {
- m_first = 0;
- m_last = 0;
-}
-
-MessageSeQueue::MessageSeQueue(IRTObject* parent, std::string name)
- : RTObject(parent, name),
- m_first(0),
- m_last(0),
- m_highWaterMark(0),
- m_size(0)
-{
-}
-
-void MessageSeQueue::push(Message* msg) {
- // TODO: optimize queue for concurrent push / pop
- if (m_first == 0) {
- m_first = m_last = msg;
- } else {
- m_last->setNext(msg);
- m_last = msg;
- }
- if (++m_size > m_highWaterMark)
- m_highWaterMark++;
-
-}
-
-Message* MessageSeQueue::pop() {
- // TODO: optimize queue for concurrent push / pop
- Message* pop_msg = m_first;
- if (m_first == 0) {
- return m_first;
- }
- if (m_first->getNext() == 0) {
- m_first = m_last = 0;
- } else {
- m_first = m_first->getNext();
- }
-
- pop_msg->setNext(0);
- m_size--;
-
- return pop_msg;
-}
-
-
-} /* namespace etRuntime */
+/*******************************************************************************
+ * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Peter Karlitschek (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "MessageSeQueue.h"
+
+namespace etRuntime {
+
+
+MessageSeQueue::~MessageSeQueue() {
+ m_first = 0;
+ m_last = 0;
+}
+
+MessageSeQueue::MessageSeQueue(IRTObject* parent, std::string name)
+ : RTObject(parent, name),
+ m_first(0),
+ m_last(0),
+ m_highWaterMark(0),
+ m_size(0)
+{
+}
+
+void MessageSeQueue::push(Message* msg) {
+ // TODO: optimize queue for concurrent push / pop
+ if (m_first == 0) {
+ m_first = m_last = msg;
+ } else {
+ m_last->setNext(msg);
+ m_last = msg;
+ }
+ if (++m_size > m_highWaterMark)
+ m_highWaterMark++;
+
+}
+
+Message* MessageSeQueue::pop() {
+ // TODO: optimize queue for concurrent push / pop
+ Message* pop_msg = m_first;
+ if (m_first == 0) {
+ return m_first;
+ }
+ if (m_first->getNext() == 0) {
+ m_first = m_last = 0;
+ } else {
+ m_first = m_first->getNext();
+ }
+
+ pop_msg->setNext(0);
+ m_size--;
+
+ return pop_msg;
+}
+
+
+} /* namespace etRuntime */

Back to the top