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>
156 T *p =
dynamic_cast<T*
> (obj);
165 T *p =
dynamic_cast<T*
> (obj);
170 (p->*m_source).
Connect (cb, context);
174 T *p =
dynamic_cast<T*
> (obj);
183 T *p =
dynamic_cast<T*
> (obj);
192 } *accessor =
new Accessor ();
193 accessor->m_source = a;
197 template <
typename T>
Smart pointer class similar to boost::intrusive_ptr.
ns3::Ptr smart pointer declaration and implementation.
virtual bool ConnectWithoutContext(ObjectBase *obj, const CallbackBase &cb) const =0
Connect a Callback to a TraceSource (without context.)
virtual bool DisconnectWithoutContext(ObjectBase *obj, const CallbackBase &cb) const =0
Disconnect a Callback from a TraceSource (without context).
TraceSourceAccessor()
Constructor.
Base class for Callback class.
void DisconnectWithoutContext(std::string path, const CallbackBase &cb)
Anchor the ns-3 type and attribute system.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Declaration of the various callback functions.
virtual ~TraceSourceAccessor()
Destructor.
Ptr< const TraceSourceAccessor > DoMakeTraceSourceAccessor(SOURCE T::*a)
MakeTraceSourceAccessor() implementation.
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
void Connect(std::string path, const CallbackBase &cb)
virtual bool Disconnect(ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
Disconnect a Callback from a TraceSource with a context string.
virtual bool Connect(ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
Connect a Callback to a TraceSource with a context string.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Control access to objects' trace sources.
static Ptr< const TraceSourceAccessor > MakeEmptyTraceSourceAccessor()
Create an empty TraceSourceAccessor.
void Disconnect(std::string path, const CallbackBase &cb)
A template-based reference counting class.
ns3::SimpleRefCount declaration and template implementation.