m2etis  0.4
GMSOrderInfo.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_MESSAGE_GMSORDERINFO_H__
23 #define __M2ETIS_MESSAGE_GMSORDERINFO_H__
24 
26 
27 #include "boost/serialization/base_object.hpp"
28 
29 namespace m2etis {
30 namespace message {
31 
32  enum class TYPE {
33  NONE,
34  UNSUB
35  };
36 
37  template<class NetworkType>
38  class GMSOrderInfo : public OrderInfo {
39  public:
40  typedef boost::shared_ptr<GMSOrderInfo> Ptr;
41 
42  GMSOrderInfo() : realTree(UINT64_MAX), msgNr(0), seqNr(0), mT(0), type(TYPE::NONE), sender() {
43  }
44 
48  static bool doSerialize(ActionType) {
49  return true;
50  }
51 
55  uint64_t realTree = UINT64_MAX;
56 
60  uint64_t msgNr = 0;
61 
65  uint64_t seqNr = 0;
66 
70  uint64_t mT = 0;
71 
76 
80  typename NetworkType::Key sender;
81 
82  private:
84  template<typename Archive>
85  void serialize(Archive & ar, const unsigned int) {
86  ar & boost::serialization::base_object<OrderInfo>(*this);
87  ar & msgNr;
88  ar & realTree;
89  ar & seqNr;
90  ar & mT;
91  ar & type;
92  }
93  };
94 
95 } /* namespace message */
96 } /* namespace m2etis */
97 
98 #endif /* __M2ETIS_MESSAGE_GMSORDERINFO_H__ */
99 
uint64_t mT
main tree for sender
Definition: GMSOrderInfo.h:70
uint64_t seqNr
id used to order msgs on a single link
Definition: GMSOrderInfo.h:65
uint64_t realTree
id on which the real Msg was published
Definition: GMSOrderInfo.h:55
NetworkType::Key sender
initial sender of this msg
Definition: GMSOrderInfo.h:80
TYPE type
type of this message
Definition: GMSOrderInfo.h:75
boost::shared_ptr< GMSOrderInfo > Ptr
Definition: GMSOrderInfo.h:40
friend class boost::serialization::access
Definition: GMSOrderInfo.h:83
uint64_t msgNr
globally unique msg id set by root
Definition: GMSOrderInfo.h:60
static bool doSerialize(ActionType)
serialise for ALL messages
Definition: GMSOrderInfo.h:48