46 #define NS_OBJECT_ENSURE_REGISTERED(type) \
47 static struct Object##type##RegistrationClass \
49 Object##type##RegistrationClass() \
51 NS_WARNING_PUSH_DEPRECATED; \
52 ns3::TypeId tid = type::GetTypeId(); \
53 tid.SetSize(sizeof(type)); \
57 } Object##type##RegistrationVariable
78 #define NS_OBJECT_TEMPLATE_CLASS_DEFINE(type, param) \
79 template class type<param>; \
81 std::string DoGetTemplateClassName<type<param>>() \
83 return std::string("ns3::") + std::string(#type) + std::string("<") + \
84 std::string(#param) + std::string(">"); \
86 static struct Object##type##param##RegistrationClass \
88 Object##type##param##RegistrationClass() \
90 ns3::TypeId tid = type<param>::GetTypeId(); \
91 tid.SetSize(sizeof(type<param>)); \
94 } Object##type##param##RegistrationVariable
116 #define NS_OBJECT_TEMPLATE_CLASS_TWO_DEFINE(type, param1, param2) \
117 template class type<param1, param2>; \
119 std::string DoGetTemplateClassName<type<param1, param2>>() \
121 return std::string("ns3::") + std::string(#type) + std::string("<") + \
122 std::string(#param1) + std::string(",") + std::string(#param2) + std::string(">"); \
124 static struct Object##type##param1##param2##RegistrationClass \
126 Object##type##param1##param2##RegistrationClass() \
128 ns3::TypeId tid = type<param1, param2>::GetTypeId(); \
129 tid.SetSize(sizeof(type<param1, param2>)); \
132 } Object##type##param1##param2##RegistrationVariable
145 template <
typename T>
153 template <
typename T>
157 return DoGetTemplateClassName<T>();
160 class AttributeConstructionList;
Declaration of the various callback functions.
List of Attribute name, value and checker triples used to construct Objects.
Hold a value for an Attribute.
Base class for Callback class.
CallbackImpl class with varying numbers of argument types.
Anchor the ns-3 type and attribute system.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
bool TraceDisconnect(std::string name, std::string context, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected with a context.
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected without a context.
virtual TypeId GetInstanceTypeId() const =0
Get the most derived TypeId for this Object.
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
virtual ~ObjectBase()
Virtual destructor.
bool GetAttributeFailSafe(std::string name, AttributeValue &value) const
Get the value of an attribute without raising errors.
virtual void NotifyConstructionCompleted()
Notifier called once the ObjectBase is fully constructed.
static TypeId GetTypeId()
Get the type ID.
bool SetAttributeFailSafe(std::string name, const AttributeValue &value)
Set a single attribute without raising errors.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
bool TraceConnect(std::string name, std::string context, const CallbackBase &cb)
Connect a TraceSource to a Callback with a context.
bool DoSet(Ptr< const AttributeAccessor > spec, Ptr< const AttributeChecker > checker, const AttributeValue &value)
Attempt to set the value referenced by the accessor spec to a valid value according to the checker,...
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::string DoGetTemplateClassName()
Helper function to get the name (as a string) of the type of a template class.
std::string GetTemplateClassName()
Helper function to get the name (as a string) of the type of a template class.
template Callback< ObjectBase * > MakeCallback< ObjectBase * >(ObjectBase *(*)())
ns3::TypeId declaration; inline and template implementations.