AttributeValue implementation for Pair. More...
#include "pair.h"
Public Types | |
typedef std::invoke_result_t< decltype(&A::Get), A > | first_type |
Type of abscissa (first entry of pair). | |
typedef std::pair< first_type, second_type > | result_type |
Type returned by Get or passed in Set. | |
typedef std::invoke_result_t< decltype(&B::Get), B > | second_type |
Type of ordinal (second entry of pair). | |
typedef std::pair< Ptr< A >, Ptr< B > > | value_type |
Type of value stored in the PairValue. | |
Public Member Functions | |
PairValue () | |
PairValue (const result_type &value) | |
Construct this PairValue from a std::pair. | |
Ptr< AttributeValue > | Copy () const override |
bool | DeserializeFromString (std::string value, Ptr< const AttributeChecker > checker) override |
result_type | Get () const |
Get the stored value as a std::pair. | |
template<typename T > | |
bool | GetAccessor (T &value) const |
Access the Pair value as type T . | |
std::string | SerializeToString (Ptr< const AttributeChecker > checker) const override |
void | Set (const result_type &value) |
Set the value. | |
Public Member Functions inherited from ns3::AttributeValue | |
AttributeValue () | |
virtual | ~AttributeValue () |
Public Member Functions inherited from ns3::SimpleRefCount< AttributeValue > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Private Attributes | |
value_type | m_value |
The stored Pair instance. | |
AttributeValue implementation for Pair.
Hold objects of type std::pair<A, B>.
typedef std::invoke_result_t<decltype(&A::Get), A> ns3::PairValue< A, B >::first_type |
typedef std::pair<first_type, second_type> ns3::PairValue< A, B >::result_type |
typedef std::invoke_result_t<decltype(&B::Get), B> ns3::PairValue< A, B >::second_type |
typedef std::pair<Ptr<A>, Ptr<B> > ns3::PairValue< A, B >::value_type |
|
inline |
|
inline |
Construct this PairValue from a std::pair.
[in] | value | Value with which to construct. |
Definition at line 73 of file pair.h.
References ns3::PairValue< A, B >::Set().
|
overridevirtual |
Implements ns3::AttributeValue.
Definition at line 311 of file pair.h.
References ns3::Create(), and ns3::DynamicCast().
|
overridevirtual |
[in] | value | A string representation of the value |
[in] | checker | A pointer to the checker associated to the attribute. |
Upon return of this function, this AttributeValue instance contains the deserialized value. In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implements ns3::AttributeValue.
Definition at line 325 of file pair.h.
References ns3::DynamicCast().
PairValue< A, B >::result_type ns3::PairValue< A, B >::Get | ( | ) | const |
Get the stored value as a std::pair.
This differs from the actual value stored in the object which is a pair of Ptr<AV> where AV is a class derived from AttributeValue.
Definition at line 378 of file pair.h.
Referenced by PairValueTestCase::DoRun().
bool ns3::PairValue< A, B >::GetAccessor | ( | T & | value | ) | const |
|
overridevirtual |
[in] | checker | The checker associated to the attribute |
In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implements ns3::AttributeValue.
void ns3::PairValue< A, B >::Set | ( | const result_type & | value | ) |
Set the value.
[in] | value | The value to adopt. |
Definition at line 385 of file pair.h.
References ns3::Create().
Referenced by ns3::PairValue< A, B >::PairValue(), and PairValueTestCase::DoRun().
|
private |