76 void SetParent (uint16_t uid, uint16_t parent);
80 uint16_t
GetUid (std::string name)
const;
82 std::string
GetName (uint16_t uid)
const;
126 typedef std::vector<struct IidInformation>::const_iterator
Iterator;
153 static ns3::Hasher hasher ( Create<Hash::Function::Murmur3> () );
163 "Trying to allocate twice the same uid: " << name);
167 NS_LOG_ERROR (
"Hash chaining TypeId for '" << name <<
"'. "
168 <<
"This is not a bug, but is extremely unlikely. "
169 <<
"Please contact the ns3 developers.");
183 "Triplicate hash detected while chaining TypeId for '"
185 <<
"'. Please contact the ns3 developers for assistance.");
194 if (name > hinfo->
name)
196 NS_LOG_LOGIC (
"New TypeId '" << name <<
"' getting chained.");
211 information.
name = name;
212 information.
hash = hash;
222 m_namemap.insert (std::make_pair (name, uid));
223 m_hashmap.insert (std::make_pair (hash, uid));
241 information->
parent = parent;
275 namemap_t::const_iterator it =
m_namemap.find (name);
288 hashmap_t::const_iterator it =
m_hashmap.find (hash);
303 return information->
name;
310 return information->
hash;
317 return information->
parent;
334 NS_FATAL_ERROR (
"Requested constructor for "<<information->
name<<
" but it does not have one.");
368 for (std::vector<struct TypeId::AttributeInformation>::const_iterator i = information->
attributes.begin ();
377 if (parent == information)
383 information = parent;
397 NS_LOG_FUNCTION (
this << uid << name << help << flags << initialValue << accessor << checker);
401 NS_FATAL_ERROR (
"Attribute \"" << name <<
"\" already registered on tid=\"" <<
402 information->
name <<
"\"");
421 NS_ASSERT (i < information->attributes.size ());
422 information->
attributes[i].initialValue = initialValue;
439 NS_ASSERT (i < information->attributes.size ());
440 return information->attributes[i];
451 for (std::vector<struct TypeId::TraceSourceInformation>::const_iterator i = information->
traceSources.begin ();
460 if (parent == information)
466 information = parent;
481 NS_FATAL_ERROR (
"Trace source \"" << name <<
"\" already registered on tid=\"" <<
482 information->
name <<
"\"");
502 NS_ASSERT (i < information->traceSources.size ());
503 return information->traceSources[i];
540 NS_ASSERT_MSG (uid != 0,
"Assert in TypeId::LookupByName: " << name <<
" not found");
559 NS_ASSERT_MSG (uid != 0,
"Assert in TypeId::LookupByHash: 0x"
560 << std::hex << hash << std::dec <<
" not found");
599 if (tmp.
name == name)
606 }
while (nextTid != tid);
636 return parent !=
m_tid;
643 while (tmp != other && tmp != tmp.
GetParent ())
647 return tmp == other && *
this != other;
677 return hasConstructor;
694 NS_LOG_FUNCTION (
this << name << help << &initialValue << accessor << checker);
707 NS_LOG_FUNCTION (
this << name << help << flags << &initialValue << accessor << checker);
802 if (info.
name == name)
808 }
while (nextTid != tid);
832 std::string tidString;
837 is.setstate (std::ios_base::badbit);
uint32_t GetAttributeN(void) const
static TypeId::hash_t Hasher(const std::string name)
uint32_t hash_t
Type of hash values.
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
bool HasAttribute(uint16_t uid, std::string name)
Callback< ObjectBase * > GetConstructor(uint16_t uid) const
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
bool HasTraceSource(uint16_t uid, std::string name)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
std::vector< struct IidInformation > m_information
std::string GetGroupName(uint16_t uid) const
static TypeId LookupByHash(hash_t hash)
std::map< TypeId::hash_t, uint16_t > hashmap_t
Hold a value for an Attribute.
void SetGroupName(uint16_t uid, std::string groupName)
#define NS_ASSERT(condition)
TypeId GetParent(void) const
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
bool operator<(const Room &a, const Room &b)
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
uint32_t GetRegisteredN(void) const
The attribute can be read, and written at any time.
#define NS_FATAL_ERROR(msg)
fatal error handling
Callback< ObjectBase * > GetConstructor(void) const
static bool LookupByHashFailSafe(hash_t hash, TypeId *tid)
bool HasConstructor(void) const
bool MustHideFromDocumentation(void) const
TypeId information manager.
static uint32_t GetRegisteredN(void)
Ptr< const TraceSourceAccessor > LookupTraceSourceByName(std::string name) const
uint32_t GetAttributeN(uint16_t uid) const
bool HasParent(void) const
uint32_t GetHash32(const char *buffer, const size_t size)
Compute 32-bit hash of a byte buffer.
uint32_t GetTraceSourceN(void) const
static TypeId GetRegistered(uint32_t i)
uint32_t GetTraceSourceN(uint16_t uid) const
void AddAttribute(uint16_t uid, std::string name, std::string help, uint32_t flags, Ptr< const AttributeValue > initialValue, Ptr< const AttributeAccessor > spec, Ptr< const AttributeChecker > checker)
void SetAttributeInitialValue(uint16_t uid, uint32_t i, Ptr< const AttributeValue > initialValue)
#define NS_LOG_LOGIC(msg)
void HideFromDocumentation(uint16_t uid)
bool MustHideFromDocumentation(uint16_t uid) const
TypeId SetGroupName(std::string groupName)
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
TypeId AddAttribute(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker)
virtual Ptr< AttributeValue > Copy(void) const =0
Hasher & clear(void)
Restore initial state.
void SetUid(uint16_t tid)
bool LookupAttributeByName(std::string name, struct AttributeInformation *info) const
std::map< std::string, uint16_t > namemap_t
uint16_t GetRegistered(uint32_t i) const
std::string GetName(void) const
uint16_t GetUid(void) const
void DoAddConstructor(Callback< ObjectBase * > callback)
hash_t GetHash(void) const
#define NS_ASSERT_MSG(condition, message)
bool SetAttributeInitialValue(uint32_t i, Ptr< const AttributeValue > initialValue)
TypeId AddTraceSource(std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor)
uint16_t AllocateUid(std::string name)
void SetParent(uint16_t uid, uint16_t parent)
uint16_t GetParent(uint16_t uid) const
std::string GetName(uint16_t uid) const
TypeId::hash_t GetHash(uint16_t uid) const
std::string GetAttributeFullName(uint32_t i) const
bool HasConstructor(uint16_t uid) const
bool IsChildOf(TypeId other) const
#define NS_LOG_ERROR(msg)
void AddTraceSource(uint16_t uid, std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor)
struct TypeId::TraceSourceInformation GetTraceSource(uint32_t i) const
std::string GetGroupName(void) const
ATTRIBUTE_HELPER_CPP(ObjectFactory)
struct IidManager::IidInformation * LookupInformation(uint16_t uid) const
struct TypeId::AttributeInformation GetAttribute(uint32_t i) const
void AddConstructor(uint16_t uid, Callback< ObjectBase * > callback)
a unique identifier for an interface.
std::vector< struct IidInformation >::const_iterator Iterator
Generic Hash function interface.
TypeId HideFromDocumentation(void)
static TypeId LookupByName(std::string name)
uint16_t GetUid(std::string name) const