20 #ifndef TRACE_SOURCE_ACCESSOR_H
21 #define TRACE_SOURCE_ACCESSOR_H
115 template <
typename T>
149 template <
typename T,
typename SOURCE>
150 Ptr<const TraceSourceAccessor>
157 T *p =
dynamic_cast<T*
> (obj);
167 T *p =
dynamic_cast<T*
> (obj);
172 (p->*m_source).
Connect (cb, context);
177 T *p =
dynamic_cast<T*
> (obj);
187 T *p =
dynamic_cast<T*
> (obj);
196 } *accessor =
new Accessor ();
197 accessor->m_source = a;
201 template <
typename T>
Declaration of the various callback functions.
Base class for Callback class.
Anchor the ns-3 type and attribute system.
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Control access to objects' trace sources.
virtual bool ConnectWithoutContext(ObjectBase *obj, const CallbackBase &cb) const =0
Connect a Callback to a TraceSource (without context.)
virtual bool Connect(ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
Connect a Callback to a TraceSource with a context string.
virtual bool Disconnect(ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
Disconnect a Callback from a TraceSource with a context string.
TraceSourceAccessor()
Constructor.
virtual bool DisconnectWithoutContext(ObjectBase *obj, const CallbackBase &cb) const =0
Disconnect a Callback from a TraceSource (without context).
virtual ~TraceSourceAccessor()
Destructor.
void Disconnect(std::string path, const CallbackBase &cb)
void Connect(std::string path, const CallbackBase &cb)
void DisconnectWithoutContext(std::string path, const CallbackBase &cb)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Ptr< const TraceSourceAccessor > DoMakeTraceSourceAccessor(SOURCE T::*a)
MakeTraceSourceAccessor() implementation.
static Ptr< const TraceSourceAccessor > MakeEmptyTraceSourceAccessor()
Create an empty TraceSourceAccessor.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ptr smart pointer declaration and implementation.
ns3::SimpleRefCount declaration and template implementation.