14 #ifndef ECL_SIGSLOTS_SIGSLOT_HPP_ 15 #define ECL_SIGSLOTS_SIGSLOT_HPP_ 45 template <
typename Data=Vo
id>
107 typename PublicationMap::const_iterator topic_iter;
108 typename Subscribers::const_iterator slots_iter;
110 const Subscribers* subscribers = topic_iter->second;
111 for ( slots_iter = subscribers->begin(); slots_iter != subscribers->end(); ++slots_iter ) {
157 std::pair< std::set<std::string>::iterator,
bool > ret;
168 std::set<std::string>::const_iterator listen_iter =
subscriptions.find(topic);
178 std::set<std::string>::iterator iter;
183 typename std::map<std::string,const Subscribers*>::iterator emit_iter;
270 PublicationMap::const_iterator topic_iter;
271 Subscribers::const_iterator slots_iter;
273 const Subscribers* subscribers = topic_iter->second;
274 for ( slots_iter = subscribers->begin(); slots_iter != subscribers->end(); ++slots_iter ) {
275 SigSlot *sigslot = *slots_iter;
316 std::pair< std::set<std::string>::iterator,
bool > ret;
330 std::set<std::string>::const_iterator listen_iter =
subscriptions.find(topic);
340 std::set<std::string>::iterator iter;
345 std::map<std::string,const Subscribers*>::iterator emit_iter;
static void connectSlot(const std::string &topic, SigSlot< Data > *sigslot)
Topic< Data >::Subscribers Subscribers
A list of subscribers (slots) to a given topic.
void connectSlot(const std::string &topic)
Connect a slot to the specified topic.
void incrHandles()
Increment the counter for the number of copies of this object.
std::set< SigSlot< Data > * > Subscribers
A list of subscribers (slots) to a given topic.
void emit(Data data)
Emit a signal along with the specified data.
void connectSignal(const std::string &topic)
Connect a signal to the specified topic.
void disconnect()
Disconnect the sigslot from all topics.
const std::set< std::string > & subscribedTopics()
unsigned int number_of_handles
void emit()
Emit a signal.
const unsigned int & handles() const
Number of copies of this object.
void decrHandles()
Decrement the counter for the number of copies of this object.
const unsigned int & handles() const
Number of copies of this object.
void disconnect(const std::string &topic)
Disconnect the sigslot from the specified topic.
PublicationMap publications
void incrHandles()
Increment the counter for the number of copies of this object.
PublicationMap publications
The sigslots connection manager.
unsigned int number_of_handles
static void disconnect(const std::string &topic, SigSlot< Data > *sigslot)
Disconnect the sigslot from the specified topic.
void decrHandles()
Decrement the counter for the number of copies of this object.
unsigned int processing_count
~SigSlot()
Disconnects the sigslot completely.
std::map< std::string, const Subscribers * > PublicationMap
Stores publishing topics and their followers.
void process(Void void_arg=Void())
Process the callback function loaded into this sigslot.
std::map< std::string, const Subscribers * > PublicationMap
Stores publishing topics and their followers.
Not for direct use, provides the power behind both signals and slots.
void disconnect(const std::string &topic)
Disconnect the sigslot from the specified topic.
std::set< std::string > subscriptions
~SigSlot()
Disconnects the sigslot completely.
void f(int i) ecl_debug_throw_decl(StandardException)
std::set< std::string > subscriptions
void disconnect()
Disconnect the sigslot from all topics.
SigSlot(void(C::*f)(Data), C &c)
void connectSignal(const std::string &topic)
Connect a signal to the specified topic.
void connectSlot(const std::string &topic)
Connect a slot to the specified topic.
SigSlot(void(C::*f)(void), C &c)
Topic< Void >::Subscribers Subscribers
A list of subscribers (slots) to a given topic.
void process(Data data)
Process the callback function loaded into this sigslot.
unsigned int processing_count