Back to index

unity  6.0.0
Public Member Functions | Protected Attributes
unity::glib::SignalManager Class Reference

#include <GLibSignal.h>

Inheritance diagram for unity::glib::SignalManager:
Inheritance graph
[legend]
Collaboration diagram for unity::glib::SignalManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SignalManager ()
void Add (SignalBase *signal)
void Add (SignalBase::Ptr const &signal)
template<typename R , typename G , typename... Ts>
void Add (G object, std::string const &signal_name, typename Signal< R, G, Ts...>::SignalCallback const &callback)
void Disconnect (void *object, std::string const &signal_name="")

Protected Attributes

std::vector< SignalBase::Ptrconnections_

Detailed Description

Definition at line 85 of file GLibSignal.h.


Constructor & Destructor Documentation

Definition at line 57 of file GLibSignal.cpp.

{}

Member Function Documentation

Definition at line 65 of file GLibSignal.cpp.

{
  Add(SignalBase::Ptr(signal));
}

Here is the caller graph for this function:

Definition at line 70 of file GLibSignal.cpp.

{
  connections_.push_back(signal);
}
template<typename R , typename G , typename... Ts>
void unity::glib::SignalManager::Add ( object,
std::string const &  signal_name,
typename Signal< R, G, Ts...>::SignalCallback const &  callback 
) [inline]

Definition at line 92 of file GLibSignal.h.

  {
    Add(std::make_shared<Signal<R, G, Ts...>>(object, signal_name, callback));
  }

Here is the call graph for this function:

void unity::glib::SignalManager::Disconnect ( void *  object,
std::string const &  signal_name = "" 
)

Definition at line 77 of file GLibSignal.cpp.

{
  for (auto it = connections_.begin(); it != connections_.end(); ++it)
  {
    if ((*it)->object() == object &&
        (signal_name.empty() || (*it)->name() == signal_name))
    {
      (*it)->Disconnect();
      connections_.erase(it, it);
    }
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 100 of file GLibSignal.h.


The documentation for this class was generated from the following files: