add InterfaceId::HasConstructor
This commit is contained in:
@@ -43,6 +43,7 @@ public:
|
||||
std::string GetName (uint16_t uid) const;
|
||||
uint16_t GetParent (uint16_t uid) const;
|
||||
ns3::CallbackBase GetConstructor (uint16_t uid, uint32_t nArguments);
|
||||
bool HasConstructor (uint16_t uid);
|
||||
uint32_t GetRegisteredN (void);
|
||||
uint16_t GetRegistered (uint32_t i);
|
||||
private:
|
||||
@@ -160,6 +161,13 @@ IidManager::GetConstructor (uint16_t uid, uint32_t nArguments)
|
||||
return ns3::CallbackBase ();
|
||||
}
|
||||
|
||||
bool
|
||||
IidManager::HasConstructor (uint16_t uid)
|
||||
{
|
||||
struct IidInformation *information = LookupInformation (uid);
|
||||
return !information->constructors.empty ();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
IidManager::GetRegisteredN (void)
|
||||
{
|
||||
@@ -295,6 +303,13 @@ InterfaceId::GetName (void) const
|
||||
return name;
|
||||
}
|
||||
|
||||
bool
|
||||
InterfaceId::HasConstructor (void) const
|
||||
{
|
||||
bool hasConstructor = Singleton<IidManager>::Get ()->HasConstructor (m_iid);
|
||||
return hasConstructor;
|
||||
}
|
||||
|
||||
void
|
||||
InterfaceId::DoAddConstructor (CallbackBase cb, uint32_t nArguments)
|
||||
{
|
||||
|
||||
@@ -66,6 +66,11 @@ public:
|
||||
*/
|
||||
std::string GetName (void) const;
|
||||
|
||||
/**
|
||||
* \returns true if this InterfaceId has a constructor
|
||||
*/
|
||||
bool HasConstructor (void) const;
|
||||
|
||||
InterfaceId (std::string);
|
||||
|
||||
InterfaceId SetParent (InterfaceId iid);
|
||||
|
||||
Reference in New Issue
Block a user