AttributeValue implementation for Tuple. More...
#include "tuple.h"
Public Types | |
typedef std::tuple< std::invoke_result_t< decltype(&Args::Get), Args >... > | result_type |
Type returned by Get or passed in Set. | |
typedef std::tuple< Args... > | value_type |
Type of value stored in the TupleValue. | |
Public Member Functions | |
TupleValue () | |
TupleValue (const result_type &value) | |
Construct this TupleValue from a std::tuple. | |
Ptr< AttributeValue > | Copy () const override |
bool | DeserializeFromString (std::string value, Ptr< const AttributeChecker > checker) override |
result_type | Get () const |
Get the stored values as a std::tuple. | |
template<typename T > | |
bool | GetAccessor (T &value) const |
Set the given variable to the values stored by this TupleValue object. | |
value_type | GetValue () const |
Get the attribute values as a tuple. | |
std::string | SerializeToString (Ptr< const AttributeChecker > checker) const override |
void | Set (const result_type &value) |
Set the stored values. | |
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 Member Functions | |
template<std::size_t... Is> | |
bool | SetValueImpl (std::index_sequence< Is... >, const std::vector< Ptr< AttributeValue > > &values) |
Set the attribute values starting from the given values. | |
Private Attributes | |
value_type | m_value |
Tuple of attribute values. | |
AttributeValue implementation for Tuple.
Hold objects of type std::tuple<Args...>.
Args | [explicit] The list of AttributeValues to be held by this TupleValue |
typedef std::tuple<std::invoke_result_t<decltype(&Args::Get), Args>...> ns3::TupleValue< Args >::result_type |
typedef std::tuple<Args...> ns3::TupleValue< Args >::value_type |
Type of value stored in the TupleValue.
ns3::TupleValue< Args >::TupleValue | ( | ) |
ns3::TupleValue< Args >::TupleValue | ( | const result_type & | value | ) |
Construct this TupleValue from a std::tuple.
[in] | value | Value with which to construct. |
|
overridevirtual |
Implements ns3::AttributeValue.
Definition at line 239 of file tuple.h.
References ns3::Create().
|
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 263 of file tuple.h.
References ns3::DynamicCast().
TupleValue< Args... >::result_type ns3::TupleValue< Args >::Get | ( | ) | const |
Get the stored values as a std::tuple.
This differs from the actual value stored in the object which is a tuple of Ptr<AV> where AV is a class derived from AttributeValue.
Definition at line 322 of file tuple.h.
Referenced by TupleValueTestCase::DoRun().
bool ns3::TupleValue< Args >::GetAccessor | ( | T & | value | ) | const |
Set the given variable to the values stored by this TupleValue object.
T | [deduced] the type of the given variable (normally, the argument type of a set method or the type of a data member) |
[out] | value | The stored value |
TupleValue< Args... >::value_type ns3::TupleValue< Args >::GetValue | ( | ) | 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::TupleValue< Args >::Set | ( | const result_type & | value | ) |
|
private |
Set the attribute values starting from the given values.
Used by DeserializeFromString method.
Is | [deduced] index sequence |
values | the given attribute values |
Definition at line 247 of file tuple.h.
References ns3::DynamicCast().
|
private |