m2etis  0.4
NullDeliver.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_DELIVER_NULLDELIVER_H__
23 #define __M2ETIS_PUBSUB_DELIVER_NULLDELIVER_H__
24 
25 #include <string>
26 
28 
31 
32 namespace m2etis {
33 namespace pubsub {
34 namespace deliver {
35 
36  template<class NetworkType>
37  class NullDeliver : public BaseDeliver<NetworkType> {
38  public:
40 
41  NullDeliver(PubSubSystemEnvironment * pssi, const typename NetworkType::Key &) : BaseDeliver<NetworkType>(pssi) {
42  }
43 
44  virtual ~NullDeliver() {}
45 
49  bool processPublishPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
50  return true;
51  }
52 
56  bool processNotifyPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
57  return true;
58  }
59 
63  bool processSubscribePayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
64  return true;
65  }
66 
70  bool processUnsubscribePayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
71  return true;
72  }
73 
74  bool processOtherControlPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
75  return true;
76  }
77 
81  void configureDeliverInfo(uint64_t id, const message::ActionType, typename message::DeliverInfo::Ptr, const typename NetworkType::Key &, message::ControlType) {
83  }
84 
88  bool processControlPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &) {
89  return false;
90  }
91  };
92 
93 } /* namespace deliver */
94 } /* namespace pubsub */
95 } /* namespace m2etis */
96 
97 #endif /* __M2ETIS_PUBSUB_DELIVER_NULLDELIVER_H__ */
98 
message::NullDeliverInfo DeliverInfoType
Definition: NullDeliver.h:39
bool processUnsubscribePayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
used to process payload
Definition: NullDeliver.h:70
boost::shared_ptr< DeliverInfo > Ptr
bool processControlPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
processes Control Messages (id got acked)
Definition: NullDeliver.h:88
NullDeliver(PubSubSystemEnvironment *pssi, const typename NetworkType::Key &)
Definition: NullDeliver.h:41
bool processNotifyPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
used to process payload
Definition: NullDeliver.h:56
bool processOtherControlPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
creates the DeliverInfo
Definition: NullDeliver.h:74
bool processSubscribePayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
used to process payload
Definition: NullDeliver.h:63
bool processPublishPayload(typename message::DeliverInfo::Ptr, const typename NetworkType::Key &)
used to process payload
Definition: NullDeliver.h:49
void configureDeliverInfo(uint64_t id, const message::ActionType, typename message::DeliverInfo::Ptr, const typename NetworkType::Key &, message::ControlType)
creates the DeliverInfo
Definition: NullDeliver.h:81
boost::function< void(uint64_t, msgProcess)> process_
stores the function to be called for delivering
Definition: BaseDeliver.h:107