21 #ifndef TRACED_CALLBACK_H
22 #define TRACED_CALLBACK_H
51 template<
typename... Ts>
129 template<
typename... Ts>
133 template<
typename... Ts>
138 if (!cb.Assign (callback))
142 m_callbackList.push_back (cb);
144 template<
typename... Ts>
148 Callback<void,std::string,Ts...> cb;
149 if (!cb.Assign (callback))
154 m_callbackList.push_back (realCb);
156 template<
typename... Ts>
160 for (
typename CallbackList::iterator i = m_callbackList.begin ();
161 i != m_callbackList.end (); )
163 if ((*i).IsEqual (callback))
165 i = m_callbackList.erase (i);
173 template<
typename... Ts>
177 Callback<void,std::string,Ts...> cb;
178 if (!cb.Assign (callback))
185 template<
typename... Ts>
189 for (
typename CallbackList::const_iterator i = m_callbackList.begin ();
190 i != m_callbackList.end (); i++)
196 template <
typename... Ts>
200 return m_callbackList.empty ();
Declaration of the various callback functions.
Base class for Callback class.
Callback< R, T2, T3, T4, T5, T6, T7, T8, T9 > Bind(T a)
Bind the first arguments.
Forward calls to a chain of Callback.
CallbackList m_callbackList
The chain of Callbacks.
void(* Uint32Callback)(const uint32_t value)
TracedCallback signature for POD.
void Disconnect(const CallbackBase &callback, std::string path)
Remove from the chain a Callback which was connected with a context.
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
TracedCallback()
Constructor.
bool IsEmpty() const
Checks if the Callbacks list is empty.
void operator()(Ts... args) const
Functor which invokes the chain of Callbacks.
void DisconnectWithoutContext(const CallbackBase &callback)
Remove from the chain a Callback which was connected without a context.
std::list< Callback< void, Ts... > > CallbackList
Container type for holding the chain of Callbacks.
void Connect(const CallbackBase &callback, std::string path)
Append a Callback to the chain with a context.
void Disconnect(std::string path, const CallbackBase &cb)
void Connect(std::string path, const CallbackBase &cb)
void DisconnectWithoutContext(std::string path, const CallbackBase &cb)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_FATAL_ERROR_NO_MSG()
Report a fatal error and terminate.
Every class exported by the ns3 library is enclosed in the ns3 namespace.