AttributeValue implementation for Pair. More...
#include "pair.h"
Inheritance diagram for ns3::PairValue< A, B >:
Collaboration diagram for ns3::PairValue< A, B >: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 |
|
overridevirtual |
Implements ns3::AttributeValue.
Definition at line 313 of file pair.h.
References ns3::Create(), ns3::DynamicCast(), and m_value.
Here is the call graph for this function:
|
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 327 of file pair.h.
References ns3::DynamicCast(), and m_value.
Here is the call graph for this function:| 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 380 of file pair.h.
References m_value.
Referenced by PairValueTestCase::DoRun(), and GetAccessor().
Here is the caller graph for this function:| 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.
Definition at line 368 of file pair.h.
References m_value.
| void ns3::PairValue< A, B >::Set | ( | const result_type & | value | ) |
Set the value.
| [in] | value | The value to adopt. |
Definition at line 387 of file pair.h.
References ns3::Create(), and m_value.
Referenced by ns3::PairValue< EnumValue< AcIndex >, AttributeContainerValue< UintegerValue, ',', std::vector > >::PairValue(), and PairValueTestCase::DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
The stored Pair instance.
Definition at line 109 of file pair.h.
Referenced by Copy(), DeserializeFromString(), Get(), SerializeToString(), and Set().