m2etis  0.4
DecisionTreeFilterInfo.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_DECISIONTREEFILTERINFO_H__
23 #define __M2ETIS_MESSAGE_DECISIONTREEFILTERINFO_H__
24 
27 
28 #include "boost/serialization/base_object.hpp"
29 #include "boost/shared_ptr.hpp"
30 
31 namespace m2etis {
32 namespace message {
33 
34  template<class EventType, class NetworkType>
36  public:
37  typedef boost::shared_ptr<DecisionTreeFilterInfo<EventType, NetworkType>> Ptr;
38 
39  static bool doSerialize(ActionType t) {
40  if (t == NOTIFY || t == PUBLISH || t == JOIN || t == STATE || t == LEAVE) {
41  return false;
42  }
43 
44  return true;
45  }
46 
47  boost::shared_ptr<pubsub::filter::DecisionTreeNode<EventType, NetworkType>> dynamic_filter_;
48  boost::shared_ptr<pubsub::filter::FilterExp<EventType>> unsubscribe_filter_;
49 
50  private:
52  template <typename Archive>
53  void serialize(Archive & ar, const unsigned int version) {
54  ar & boost::serialization::base_object<FilterInfo>(*this);
55  ar & dynamic_filter_;
57  }
58  };
59 
60 } /* namespace message */
61 } /* namespace m2etis */
62 
63 #endif /* __M2ETIS_MESSAGE_DECISIONTREEFILTERINFO_H__ */
64 
boost::shared_ptr< DecisionTreeFilterInfo< EventType, NetworkType > > Ptr
boost::shared_ptr< pubsub::filter::DecisionTreeNode< EventType, NetworkType > > dynamic_filter_
boost::shared_ptr< pubsub::filter::FilterExp< EventType > > unsubscribe_filter_
friend class boost::serialization::access