5 #include <sigc++/sigc++.h>
6 #include "libr2c2/object.h"
11 sigc::signal<void> signal_changed;
14 std::set<R2C2::Object *> objects;
17 const std::set<R2C2::Object *> &get_objects() const { return objects; }
18 R2C2::Object *get_object() const;
21 std::set<T *> get_objects() const
24 for(std::set<R2C2::Object *>::const_iterator i=objects.begin(); i!=objects.end(); ++i)
25 if(T *to = dynamic_cast<T *>(*i))
33 for(std::set<R2C2::Object *>::const_iterator i=objects.begin(); i!=objects.end(); ++i)
34 if(T *to = dynamic_cast<T *>(*i))
39 unsigned size() const { return objects.size(); }
40 bool empty() const { return objects.empty(); }
44 template<typename Iter>
45 void replace(Iter begin, Iter end)
48 objects.insert(begin, end);
49 signal_changed.emit();
52 void add_object(R2C2::Object *);
53 void remove_object(R2C2::Object *);
54 void toggle_object(R2C2::Object *);