m2etis  0.4
NullOrder.h
Go to the documentation of this file.
1 /*
2  Copyright (2016) Michael Baer, Daniel Bonrath, All rights reserved.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15  */
16 
22 #ifndef __M2ETIS_PUBSUB_ORDER_NULLORDER_H__
23 #define __M2ETIS_PUBSUB_ORDER_NULLORDER_H__
24 
27 
28 namespace m2etis {
29 namespace pubsub {
30 namespace order {
31 
36  template<class NetworkType>
37  class NullOrder : public BaseOrder<NetworkType> {
38  public:
40 
41  NullOrder(PubSubSystemEnvironment * pssi, bool b) : BaseOrder<NetworkType>(pssi, b) {}
42  virtual ~NullOrder() {}
43 
47  bool hasPending() {
48  return false;
49  }
50 
54  bool configureOrderInfo(uint64_t id, const message::ActionType, typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
55  // no infos, just send
57  return true;
58  }
59 
63  void processSubscribePayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
64  }
65 
69  void processPublishPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
70  }
71 
75  void processNotifyPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
76  }
77 
81  bool processControlPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
82  return false;
83  }
84 
89  void otherOrders(const std::vector<NullOrder *> &) {
90  }
91 
95  void receive(uint64_t id, typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
96  // deliver instant
98  }
99 
103  void notifyRemovedMessage(typename message::OrderInfo::Ptr, const typename NetworkType::Key &) {
104  }
105  };
106 
107 } /* namespace order */
108 } /* namespace pubsub */
109 } /* namespace m2etis */
110 
111 #endif /* __M2ETIS_PUBSUB_ORDER_NULLORDER_H__ */
112 
boost::shared_ptr< OrderInfo > Ptr
Definition: OrderInfo.h:31
message::NullOrderInfo OrderInfoType
Definition: NullOrder.h:39
void processSubscribePayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
nothing has to be done on arrival
Definition: NullOrder.h:63
void processPublishPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
nothing has to be done on arrival
Definition: NullOrder.h:69
void receive(uint64_t id, typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
deliver the message as soon as it arrived
Definition: NullOrder.h:95
bool configureOrderInfo(uint64_t id, const message::ActionType, typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
no extra informations need to be stored
Definition: NullOrder.h:54
void processNotifyPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
called for every NotifyMsg that arrived
Definition: NullOrder.h:75
This is the interface that should be used for all Order Strategies It specifies all functions that sh...
Definition: BaseOrder.h:39
bool processControlPayload(typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
nothing has to be done on arrival
Definition: NullOrder.h:81
This class implements the NullOrder Strategy This Strategy does nothing for ordering. All Messages are forwarded as fast as possible.
Definition: NullOrder.h:37
NullOrder(PubSubSystemEnvironment *pssi, bool b)
Definition: NullOrder.h:41
boost::function< void(uint64_t, msgProcess)> function_
stores the function to be called for delivering
Definition: BaseOrder.h:136
void otherOrders(const std::vector< NullOrder * > &)
this function is used to get the pointers to all other NullOrder instances of this Channel (other tre...
Definition: NullOrder.h:89
void notifyRemovedMessage(typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
notified when message dropped by filter or validity strategy
Definition: NullOrder.h:103
bool hasPending()
there are never pending messages
Definition: NullOrder.h:47