22 #ifndef __M2ETIS_MESSAGE_INTERNALMESSAGE_H__
23 #define __M2ETIS_MESSAGE_INTERNALMESSAGE_H__
36 #include "boost/serialization/export.hpp"
37 #include "boost/serialization/base_object.hpp"
38 #include "boost/serialization/list.hpp"
39 #include "boost/serialization/map.hpp"
40 #include "boost/serialization/shared_ptr.hpp"
41 #include "boost/serialization/variant.hpp"
42 #include "boost/serialization/vector.hpp"
58 template<
class NetworkType,
class ChannelType,
class EventType>
62 typedef boost::shared_ptr<InternalMessage>
Ptr;
64 typedef typename ChannelType::DeliverStrategy::DeliverInfoType
DInfo;
65 typedef typename ChannelType::FilterStrategy::FilterInfoType
FInfo;
66 typedef typename ChannelType::OrderStrategy::OrderInfoType
OInfo;
67 typedef typename ChannelType::PersistenceStrategy::PersistenceInfoType
PInfo;
68 typedef typename ChannelType::RoutingStrategy::RoutingInfoType
RInfo;
69 typedef typename ChannelType::SecurityStrategy::SecurityInfoType
SInfo;
70 typedef typename ChannelType::ValidityStrategy::ValidityInfoType
VInfo;
74 boost::shared_ptr<pubsub::filter::FilterExp<EventType>>
predicates;
75 typename NetworkType::Key
root;
82 template <
class Archive>
155 deliverInfo(
boost::make_shared<DInfo>()),
156 filterInfo(
boost::make_shared<FInfo>()),
157 orderInfo(
boost::make_shared<OInfo>()),
158 persistenceInfo(
boost::make_shared<PInfo>()),
159 routingInfo(
boost::make_shared<RInfo>()),
160 securityInfo(
boost::make_shared<SInfo>()),
161 validityInfo(
boost::make_shared<VInfo>()),
171 deliverInfo(
boost::make_shared<DInfo>()),
172 filterInfo(
boost::make_shared<FInfo>()),
173 orderInfo(
boost::make_shared<OInfo>()),
174 persistenceInfo(
boost::make_shared<PInfo>()),
175 routingInfo(
boost::make_shared<RInfo>()),
176 securityInfo(
boost::make_shared<SInfo>()),
177 validityInfo(
boost::make_shared<VInfo>()),
187 deliverInfo(
boost::make_shared<DInfo>(*msg.deliverInfo)),
188 filterInfo(
boost::make_shared<FInfo>(*msg.filterInfo)),
189 orderInfo(
boost::make_shared<OInfo>(*msg.orderInfo)),
190 persistenceInfo(
boost::make_shared<PInfo>(*msg.persistenceInfo)),
191 routingInfo(
boost::make_shared<RInfo>(*msg.routingInfo)),
192 securityInfo(
boost::make_shared<SInfo>(*msg.securityInfo)),
193 validityInfo(
boost::make_shared<VInfo>(*msg.validityInfo)),
194 ctrlType_(msg.ctrlType_),
195 _nodeList(msg._nodeList),
198 _topics(msg._topics) {
205 std::stringstream ss;
206 ss <<
"IMessage(" << int(type) <<
", " << int(ctrlType_) <<
", removeTopics: " << _topics.size() <<
", trees: " << _trees.size() <<
"(";
207 for (
int i = 0; i < _trees.size(); i++) {
208 ss << _trees[i].topic <<
":" << _trees[i].root.toStr() <<
", ";
210 ss <<
"), nodelist: " << _nodeList.size() <<
"(";
211 for (
size_t i = 0; i < _nodeList.size(); i++) {
212 ss << _nodeList[i].toStr() <<
", ";
221 template<
class Archive>
222 void serialize(Archive & ar,
const unsigned int) {
226 ar & boost::serialization::base_object<m2etis::message::M2Message<EventType>>(*this);
228 ar & boost::serialization::base_object<m2etis::message::NetworkMessage<NetworkType>>(*this);
229 if (RInfo::doSerialize(actionType)) {
232 if (FInfo::doSerialize(actionType)) {
235 if (PInfo::doSerialize(actionType)) {
238 if (VInfo::doSerialize(actionType)) {
241 if (SInfo::doSerialize(actionType)) {
244 if (OInfo::doSerialize(actionType)) {
247 if (DInfo::doSerialize(actionType)) {
253 if (actionType ==
STATE) {
258 if (actionType ==
LEAVE) {
ChannelType::DeliverStrategy::DeliverInfoType DInfo
ControlType ctrlType_
type containing the strategie that sent this message
RInfo::Ptr routingInfo
contains message dependent datas for Routing
InternalMessage(const EventType &v)
ChannelType::PersistenceStrategy::PersistenceInfoType PInfo
std::vector< TreeHelper > _trees
list of all trees existing
SInfo::Ptr securityInfo
contains message dependent datas for Security
ChannelType::RoutingStrategy::RoutingInfoType RInfo
std::set< uint16_t > _topics
list of all topics being removed during leave
boost::shared_ptr< pubsub::filter::FilterExp< EventType > > predicates
FInfo::Ptr filterInfo
contains message dependent datas for Filtering
ChannelType::OrderStrategy::OrderInfoType OInfo
TreeHelper(uint16_t t, boost::shared_ptr< pubsub::filter::FilterExp< EventType >> p, typename NetworkType::Key r)
InternalMessage(const InternalMessage &msg)
std::vector< typename NetworkType::Key > _nodeList
list of all nodes for join
ChannelType::SecurityStrategy::SecurityInfoType SInfo
ChannelType::ValidityStrategy::ValidityInfoType VInfo
ChannelType::FilterStrategy::FilterInfoType FInfo
PInfo::Ptr persistenceInfo
contains message dependent datas for Persistency
VInfo::Ptr validityInfo
contains message dependent datas for Validity
friend class boost::serialization::access
uint64_t _time
current time of RP
OInfo::Ptr orderInfo
contains message dependent datas for Odering
void serialize(Archive &ar, const unsigned int)
friend class boost::serialization::access
boost::shared_ptr< InternalMessage > Ptr
struct m2etis::message::InternalMessage::TreeHelper TreeHelper
static const uint32_t ACTION_TYPE_MASK
DInfo::Ptr deliverInfo
contains message dependent datas for Delivering