A Discrete-Event Network Simulator
API
ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 > Class Template Reference

Forward calls to a chain of Callback. More...

#include "traced-callback.h"

+ Collaboration diagram for ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >:

Public Types

typedef void(* Uint32Callback) (const uint32_t value)
 TracedCallback signature for POD. More...
 

Public Member Functions

 TracedCallback ()
 Constructor. More...
 
void Connect (const CallbackBase &callback, std::string path)
 Append a Callback to the chain with a context. More...
 
void ConnectWithoutContext (const CallbackBase &callback)
 Append a Callback to the chain (without a context). More...
 
void Disconnect (const CallbackBase &callback, std::string path)
 Remove from the chain a Callback which was connected with a context. More...
 
void DisconnectWithoutContext (const CallbackBase &callback)
 Remove from the chain a Callback which was connected without a context. More...
 
Functors taking various numbers of arguments.

The version selected is determined by the number of arguments at the point where the Callback is invoked in the class which fires the Callback.

void operator() (void) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3, T4 a4) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const
 Functor which invokes the chain of Callbacks. More...
 
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const
 Functor which invokes the chain of Callbacks. More...
 

Private Types

typedef std::list< Callback< void, T1, T2, T3, T4, T5, T6, T7, T8 > > CallbackList
 Container type for holding the chain of Callbacks. More...
 

Private Attributes

CallbackList m_callbackList
 The chain of Callbacks. More...
 

Detailed Description

template<typename T1 = empty, typename T2 = empty, typename T3 = empty, typename T4 = empty, typename T5 = empty, typename T6 = empty, typename T7 = empty, typename T8 = empty>
class ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >

Forward calls to a chain of Callback.

An TracedCallback has almost exactly the same API as a normal Callback but instead of forwarding calls to a single function (as a Callback normally does), it forwards calls to a chain of Callback. Connect adds a Callback at the end of the chain of callbacks. Disconnect removes a Callback from the chain of callbacks.

This is a functor: the chain of Callbacks is invoked by calling one of the operator() forms with the appropriate number of arguments.

Template Parameters
T1[explicit] Type of the first argument to the functor.
T2[explicit] Type of the second argument to the functor.
T3[explicit] Type of the third argument to the functor.
T4[explicit] Type of the fourth argument to the functor.
T5[explicit] Type of the fifth argument to the functor.
T6[explicit] Type of the sixth argument to the functor.
T7[explicit] Type of the seventh argument to the functor.
T8[explicit] Type of the eighth argument to the functor.

Definition at line 62 of file traced-callback.h.

Member Typedef Documentation

◆ CallbackList

template<typename T1 = empty, typename T2 = empty, typename T3 = empty, typename T4 = empty, typename T5 = empty, typename T6 = empty, typename T7 = empty, typename T8 = empty>
typedef std::list<Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> > ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::CallbackList
private

Container type for holding the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
T5[deduced] Type of the fifth argument to the functor.
T6[deduced] Type of the sixth argument to the functor.
T7[deduced] Type of the seventh argument to the functor.
T8[deduced] Type of the eighth argument to the functor.

Definition at line 236 of file traced-callback.h.

◆ Uint32Callback

template<typename T1 = empty, typename T2 = empty, typename T3 = empty, typename T4 = empty, typename T5 = empty, typename T6 = empty, typename T7 = empty, typename T8 = empty>
typedef void(* ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::Uint32Callback) (const uint32_t value)

TracedCallback signature for POD.

Parameters
[in]valueValue of the traced variable.

Definition at line 220 of file traced-callback.h.

Constructor & Destructor Documentation

◆ TracedCallback()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::TracedCallback ( )

Constructor.

Definition at line 254 of file traced-callback.h.

Member Function Documentation

◆ Connect()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::Connect ( const CallbackBase callback,
std::string  path 
)

Append a Callback to the chain with a context.

The context string will be provided as the first argument to the Callback.

Parameters
[in]callbackCallback to add to chain.
[in]pathContext string to provide when invoking the Callback.

Definition at line 276 of file traced-callback.h.

Referenced by ns3::TracedValue< uint64_t >::Connect().

+ Here is the caller graph for this function:

◆ ConnectWithoutContext()

◆ Disconnect()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::Disconnect ( const CallbackBase callback,
std::string  path 
)

Remove from the chain a Callback which was connected with a context.

Parameters
[in]callbackCallback to remove from the chain.
[in]pathContext path which was used to connect the Callback.

Definition at line 311 of file traced-callback.h.

Referenced by ns3::TracedValue< uint64_t >::Disconnect().

+ Here is the caller graph for this function:

◆ DisconnectWithoutContext()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::DisconnectWithoutContext ( const CallbackBase callback)

Remove from the chain a Callback which was connected without a context.

Parameters
[in]callbackCallback to remove from the chain.

Definition at line 291 of file traced-callback.h.

Referenced by ns3::TracedValue< uint64_t >::DisconnectWithoutContext(), and BasicTracedCallbackTestCase::DoRun().

+ Here is the caller graph for this function:

◆ operator()() [1/9]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( void  ) const

Functor which invokes the chain of Callbacks.

Definition at line 326 of file traced-callback.h.

◆ operator()() [2/9]

template<typename T1, typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
Parameters
[in]a1The first argument to the functor.

Definition at line 339 of file traced-callback.h.

◆ operator()() [3/9]

template<typename T1, typename T2, typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.

Definition at line 352 of file traced-callback.h.

◆ operator()() [4/9]

template<typename T1, typename T2, typename T3, typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.

Definition at line 365 of file traced-callback.h.

◆ operator()() [5/9]

template<typename T1, typename T2, typename T3, typename T4, typename T5 , typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3,
T4  a4 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.
[in]a4The fourth argument to the functor.

Definition at line 378 of file traced-callback.h.

◆ operator()() [6/9]

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 , typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3,
T4  a4,
T5  a5 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
T5[deduced] Type of the fifth argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.
[in]a4The fourth argument to the functor.
[in]a5The fifth argument to the functor.

Definition at line 391 of file traced-callback.h.

◆ operator()() [7/9]

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 , typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3,
T4  a4,
T5  a5,
T6  a6 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
T5[deduced] Type of the fifth argument to the functor.
T6[deduced] Type of the sixth argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.
[in]a4The fourth argument to the functor.
[in]a5The fifth argument to the functor.
[in]a6The sixth argument to the functor.

Definition at line 404 of file traced-callback.h.

◆ operator()() [8/9]

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 >
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3,
T4  a4,
T5  a5,
T6  a6,
T7  a7 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
T5[deduced] Type of the fifth argument to the functor.
T6[deduced] Type of the sixth argument to the functor.
T7[deduced] Type of the seventh argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.
[in]a4The fourth argument to the functor.
[in]a5The fifth argument to the functor.
[in]a6The sixth argument to the functor.
[in]a7The seventh argument to the functor.

Definition at line 417 of file traced-callback.h.

◆ operator()() [9/9]

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
void ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::operator() ( T1  a1,
T2  a2,
T3  a3,
T4  a4,
T5  a5,
T6  a6,
T7  a7,
T8  a8 
) const

Functor which invokes the chain of Callbacks.

Template Parameters
T1[deduced] Type of the first argument to the functor.
T2[deduced] Type of the second argument to the functor.
T3[deduced] Type of the third argument to the functor.
T4[deduced] Type of the fourth argument to the functor.
T5[deduced] Type of the fifth argument to the functor.
T6[deduced] Type of the sixth argument to the functor.
T7[deduced] Type of the seventh argument to the functor.
T8[deduced] Type of the eighth argument to the functor.
Parameters
[in]a1The first argument to the functor.
[in]a2The second argument to the functor.
[in]a3The third argument to the functor.
[in]a4The fourth argument to the functor.
[in]a5The fifth argument to the functor.
[in]a6The sixth argument to the functor.
[in]a7The seventh argument to the functor.
[in]a8The eighth argument to the functor.

Definition at line 430 of file traced-callback.h.

Member Data Documentation

◆ m_callbackList

template<typename T1 = empty, typename T2 = empty, typename T3 = empty, typename T4 = empty, typename T5 = empty, typename T6 = empty, typename T7 = empty, typename T8 = empty>
CallbackList ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::m_callbackList
private

The chain of Callbacks.

Definition at line 238 of file traced-callback.h.


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