core: (fixes #43) Check if ObjectFactory has been configured

This commit is contained in:
Tom Henderson
2019-03-31 09:54:35 -07:00
parent 63ce6b6869
commit d4cd46fbfe
3 changed files with 18 additions and 0 deletions

View File

@@ -63,6 +63,8 @@ us a note on ns-developers mailing list.</p>
<li>Added a new trace source <b>EndOfHePreamble</b> in WifiPhy for tracing end of preamble (after training fields) for received 802.11ax packets.</li>
<li>Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the frame capture model</li>
<li>Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the preamble detection model</li>
<li>Added a method to ObjectFactory to check whether a TypeId has been configured on the factory</li>
</ul>
</ul>
<h2>Changes to existing API:</h2>
<ul>

View File

@@ -60,6 +60,15 @@ ObjectFactory::SetTypeId (const char *tid)
NS_LOG_FUNCTION (this << tid);
m_tid = TypeId::LookupByName (tid);
}
bool
ObjectFactory::IsTypeIdSet (void) const
{
if (m_tid.GetUid () != 0)
{
return true;
}
return false;
}
void
ObjectFactory::Set (std::string name, const AttributeValue &value)
{

View File

@@ -72,6 +72,13 @@ public:
void SetTypeId (std::string tid);
/**@}*/
/**
* Check if the ObjectFactory has been configured with a TypeId
*
* \return true if a TypeId has been configured to the ObjectFactory
*/
bool IsTypeIdSet (void) const;
/**
* Set an attribute to be set during construction.
*