20#ifndef TRACED_CALLBACK_H
21#define TRACED_CALLBACK_H
52template <
typename... Ts>
130template <
typename... Ts>
136template <
typename... Ts>
141 if (!cb.Assign(callback))
145 m_callbackList.push_back(cb);
148template <
typename... Ts>
152 Callback<void, std::string, Ts...> cb;
153 if (!cb.Assign(callback))
158 m_callbackList.push_back(realCb);
161template <
typename... Ts>
165 for (
typename CallbackList::iterator i = m_callbackList.begin(); i != m_callbackList.end();
168 if ((*i).IsEqual(callback))
170 i = m_callbackList.erase(i);
179template <
typename... Ts>
183 Callback<void, std::string, Ts...> cb;
184 if (!cb.Assign(callback))
189 DisconnectWithoutContext(realCb);
192template <
typename... Ts>
196 for (
typename CallbackList::const_iterator i = m_callbackList.begin();
197 i != m_callbackList.end();
204template <
typename... Ts>
208 return m_callbackList.empty();
Declaration of the various callback functions.
Base class for Callback class.
auto Bind(BoundArgs &&... bargs)
Bind a variable number of 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.
std::list< Callback< void, Ts... > > CallbackList
Container type for holding the chain of Callbacks.
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.
void Connect(const CallbackBase &callback, std::string path)
Append a Callback to the chain with a context.
#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.