33 #ifndef DART_COMMON_SIGNAL_HPP_
34 #define DART_COMMON_SIGNAL_HPP_
75 template <
typename _Signature,
template <
class>
class Combiner>
81 const std::weak_ptr<signal::detail::ConnectionBodyBase>& _connectionBody);
85 std::weak_ptr<signal::detail::ConnectionBodyBase>&& _connectionBody);
112 template <
typename _Res,
typename... _ArgTypes,
template <
class>
class Combiner>
113 class Signal<_Res(_ArgTypes...), Combiner>
122 std::shared_ptr<ConnectionBodyType>,
123 std::owner_less<std::shared_ptr<ConnectionBodyType>>>;
138 void disconnect(
const Connection& _connection)
const;
141 void disconnect(
const std::shared_ptr<ConnectionBodyType>& connectionBody);
144 void disconnectAll();
148 void cleanupConnections();
153 std::
size_t getNumConnections() const;
156 template <typename... ArgTypes>
160 template <typename... ArgTypes>
169 template <typename... _ArgTypes>
173 using SlotType = std::function<void(_ArgTypes...)>;
178 std::shared_ptr<ConnectionBodyType>,
179 std::owner_less<std::shared_ptr<ConnectionBodyType>>>;
194 void disconnect(
const Connection& _connection)
const;
197 void disconnect(
const std::shared_ptr<ConnectionBodyType>& connectionBody);
200 void disconnectAll();
204 void cleanupConnections();
209 std::
size_t getNumConnections() const;
212 template <typename... ArgTypes>
213 void raise(ArgTypes&&... _args);
216 template <typename... ArgTypes>
217 void operator()(ArgTypes&&... _args);
227 template <typename T>
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
class Connection
Definition: Signal.hpp:48
void disconnect() const
Disconnect the connection.
Definition: Signal.cpp:101
virtual ~Connection()
Destructor.
Definition: Signal.cpp:89
Connection & operator=(const Connection &_other)
Assignment operator.
Definition: Signal.cpp:59
std::weak_ptr< signal::detail::ConnectionBodyBase > mWeakConnectionBody
Weak pointer to connection body in the signal.
Definition: Signal.hpp:89
Connection()
Default constructor.
Definition: Signal.cpp:39
bool isConnected() const
Get true if the slot is connected.
Definition: Signal.cpp:95
class ScopedConnection
Definition: Signal.hpp:94
virtual ~ScopedConnection()
Destructor.
Definition: Signal.cpp:122
ScopedConnection(const Connection &_other)
Default constructor.
Definition: Signal.cpp:108
Signal implements a signal/slot mechanism.
Definition: Signal.hpp:114
std::set< std::shared_ptr< ConnectionBodyType >, std::owner_less< std::shared_ptr< ConnectionBodyType > >> ConnectionSetType
Definition: Signal.hpp:123
void disconnect(const std::shared_ptr< ConnectionBodyType > &connectionBody)
Disconnect a connection.
_Res ResultType
Definition: Signal.hpp:116
std::function< ResultType(_ArgTypes...)> SlotType
Definition: Signal.hpp:117
Signal implements a signal/slot mechanism for the slots don't return a value.
Definition: Signal.hpp:171
std::set< std::shared_ptr< ConnectionBodyType >, std::owner_less< std::shared_ptr< ConnectionBodyType > >> ConnectionSetType
Definition: Signal.hpp:179
std::function< void(_ArgTypes...)> SlotType
Definition: Signal.hpp:173
void disconnect(const std::shared_ptr< ConnectionBodyType > &connectionBody)
Disconnect given connection.
Definition: Signal.hpp:109
SlotRegister can be used as a public member for connecting slots to a private Signal member.
Definition: Signal.hpp:229
typename T::SignalType SignalType
Definition: Signal.hpp:232
typename T::SlotType SlotType
Definition: Signal.hpp:231
T::SignalType & mSignal
Signal.
Definition: Signal.hpp:242
class ConnectionBody
Definition: ConnectionBody.hpp:63
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46
DefaultCombiner – return the last result.
Definition: ConnectionBody.hpp:135