A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::AttributeChecker Class Referenceabstract

Represent the type of an attribute. More...

#include <attribute.h>

+ Inheritance diagram for ns3::AttributeChecker:

Public Member Functions

virtual bool Check (const AttributeValue &value) const =0
 
virtual bool Copy (const AttributeValue &source, AttributeValue &destination) const =0
 
virtual Ptr< AttributeValueCreate (void) const =0
 
Ptr< AttributeValueCreateValidValue (const AttributeValue &value) const
 
virtual std::string GetUnderlyingTypeInformation (void) const =0
 
virtual std::string GetValueTypeName (void) const =0
 
virtual bool HasUnderlyingTypeInformation (void) const =0
 
- Public Member Functions inherited from ns3::SimpleRefCount< AttributeChecker >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::SimpleRefCount< AttributeChecker >
static void Cleanup (void)
 

Detailed Description

Represent the type of an attribute.

Each type of attribute has an associated unique AttributeChecker subclass. The type of the subclass can be safely used by users to infer the type of the associated attribute. i.e., we expect binding authors to use the checker associated to an attribute to detect the type of the associated attribute.

Most subclasses of this base class are implemented by the ATTRIBUTE_HELPER_HEADER and ATTRIBUTE_HELPER_CPP macros.

Definition at line 149 of file attribute.h.

Member Function Documentation

virtual bool ns3::AttributeChecker::Check ( const AttributeValue value) const
pure virtual
Parameters
valuea pointer to the value to check
Returns
true if the input value is both of the right type and if its value is within the requested range. Returns false otherwise.

Implemented in ns3::internal::AnObjectPtrContainerChecker< T >, ns3::internal::APointerChecker< T >, and ns3::EnumChecker.

virtual Ptr<AttributeValue> ns3::AttributeChecker::Create ( void  ) const
pure virtual
Returns
a new instance of an AttributeValue (wrapper in an Attribute instance) which matches the type of the underlying attribute.

This method is typically used to create a temporary variable prior to calling Attribute::DeserializeFromString.

Implemented in ns3::internal::AnObjectPtrContainerChecker< T >, ns3::internal::APointerChecker< T >, and ns3::EnumChecker.

Referenced by ns3::ObjectBase::GetAttribute(), and ns3::ObjectBase::GetAttributeFailSafe().

virtual std::string ns3::AttributeChecker::GetUnderlyingTypeInformation ( void  ) const
pure virtual
Returns
a human-readable representation of information about the underlying C++ type.

Implemented in ns3::internal::AnObjectPtrContainerChecker< T >, ns3::internal::APointerChecker< T >, and ns3::EnumChecker.

Referenced by ns3::cell_tooltip_callback(), and ns3::cell_tooltip_callback_config_default().

virtual std::string ns3::AttributeChecker::GetValueTypeName ( void  ) const
pure virtual
Returns
the c++ fully-qualified typename of the subclass of the ns3::AttributeValue base class which is associated to this checker.

A typical return value here is FooValue where Foo is the name of the type being wrapped.

Implemented in ns3::internal::AnObjectPtrContainerChecker< T >, ns3::internal::APointerChecker< T >, and ns3::EnumChecker.

Referenced by ns3::cell_tooltip_callback(), and ns3::cell_tooltip_callback_config_default().

virtual bool ns3::AttributeChecker::HasUnderlyingTypeInformation ( void  ) const
pure virtual
Returns
true if this checker has information about the underlying C++ type, false otherwise.

If this method returns false, the return value of the GetUnderlyingTypeInformation method cannot be relied upon.

Implemented in ns3::internal::AnObjectPtrContainerChecker< T >, ns3::internal::APointerChecker< T >, and ns3::EnumChecker.

Referenced by ns3::cell_tooltip_callback(), and ns3::cell_tooltip_callback_config_default().


The documentation for this class was generated from the following files: