swarm.h
Go to the documentation of this file.
1 
23 #ifndef SWARM_H_
24 #define SWARM_H_
25 
26 #include <iostream>
27 #include <vector>
28 #include <set>
29 #include <ros/ros.h>
30 
31 #include "micros_swarm/singleton.h"
35 #include "micros_swarm/serialize.h"
36 #include "gsdf_msgs/CommPacket.h"
37 #include "gsdf_msgs/JoinSwarm.h"
38 #include "gsdf_msgs/LeaveSwarm.h"
39 
40 namespace micros_swarm{
41 
42  class Swarm{
43  public:
44  Swarm();
45  Swarm(int swarm_id);
46  Swarm(const Swarm& s);
47  Swarm& operator=(const Swarm& s);
48  ~Swarm();
49  const int id() const;
50  const std::set<int> members();
51  void join();
52  void leave();
53  void select(const boost::function<bool()>& bf);
54  void unselect(const boost::function<bool()>& bf);
55  const bool in() const;
56  //execute a function
57  void execute(const boost::function<void()>& f);
58  void breakup();
59  const Swarm intersection(const Swarm& s, int new_swarm_id);
60  const Swarm swarm_union(const Swarm& s, int new_swarm_id);
61  const Swarm difference(const Swarm& s, int new_swarm_id);
62  const Swarm negation(int new_swarm_id);
63  void print() const;
64  private:
65  int swarm_id_;
68  };
69 };
70 #endif
boost::shared_ptr< micros_swarm::RuntimeHandle > rth_
Definition: swarm.h:66
Swarm & operator=(const Swarm &s)
Definition: swarm.cpp:47
f
const bool in() const
Definition: swarm.cpp:139
XmlRpcServer s
const std::set< int > members()
Definition: swarm.cpp:69
void execute(const boost::function< void()> &f)
Definition: swarm.cpp:148
void unselect(const boost::function< bool()> &bf)
Definition: swarm.cpp:129
void print() const
Definition: swarm.cpp:257
const Swarm negation(int new_swarm_id)
Definition: swarm.cpp:241
const int id() const
Definition: swarm.cpp:64
const Swarm difference(const Swarm &s, int new_swarm_id)
Definition: swarm.cpp:216
boost::shared_ptr< micros_swarm::MsgQueueManager > mqm_
Definition: swarm.h:67
const Swarm swarm_union(const Swarm &s, int new_swarm_id)
Definition: swarm.cpp:190
void select(const boost::function< bool()> &bf)
Definition: swarm.cpp:119
const Swarm intersection(const Swarm &s, int new_swarm_id)
Definition: swarm.cpp:164


micros_swarm
Author(s):
autogenerated on Mon Jun 10 2019 14:02:06