Hold objects of type std::pair<A, B>. More...
#include "pair.h"
Public Types | |
typedef std::invoke_result_t< decltype(&A::Get), A > | first_type |
Type of abscissa (first entry of pair). More... | |
typedef std::pair< first_type, second_type > | result_type |
Type returned by Get or passed in Set. More... | |
typedef std::invoke_result_t< decltype(&B::Get), B > | second_type |
Type of ordinal (second entry of pair). More... | |
typedef std::pair< Ptr< A >, Ptr< B > > | value_type |
Type of value stored in the PairValue. More... | |
Public Member Functions | |
PairValue () | |
PairValue (const result_type &value) | |
Construct this PairValue from a std::pair. More... | |
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. More... | |
template<typename T > | |
bool | GetAccessor (T &value) const |
std::string | SerializeToString (Ptr< const AttributeChecker > checker) const override |
void | Set (const result_type &value) |
Public Member Functions inherited from ns3::AttributeValue | |
AttributeValue () | |
virtual | ~AttributeValue () |
Public Member Functions inherited from ns3::SimpleRefCount< AttributeValue > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Private Attributes | |
value_type | m_value |
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 |
ns3::PairValue< A, B >::PairValue |
ns3::PairValue< A, B >::PairValue | ( | const result_type & | value | ) |
Construct this PairValue from a std::pair.
[in] | value | Value with which to construct. |
|
overridevirtual |
Implements ns3::AttributeValue.
|
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.
PairValue< A, B >::result_type ns3::PairValue< A, B >::Get |
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 356 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 | ) |
Definition at line 363 of file pair.h.
Referenced by PairValueTestCase::DoRun().
|
private |