111 template <
typename T>
127 template <
typename T>
132 const auto value =
dynamic_cast<const PointerValue*
>(&val);
133 if (value ==
nullptr)
137 if (!value->GetObject())
142 T* ptr =
dynamic_cast<T*
>(
PeekPointer(value->GetObject()));
148 return "ns3::PointerValue";
158 TypeId tid = T::GetTypeId();
159 return "ns3::Ptr< " + tid.
GetName() +
" >";
164 return ns3::Create<PointerValue>();
169 const auto src =
dynamic_cast<const PointerValue*
>(&source);
171 if (src ==
nullptr || dst ==
nullptr)
181 return T::GetTypeId();
187 template <
typename T>
193 template <
typename T>
200 template <
typename T>
208 template <
typename T>
214 template <
typename T>
229 template <
typename T>
233 return Create<internal::PointerChecker<T>>();
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Represent the type of an attribute.
Hold a value for an Attribute.
virtual TypeId GetPointeeTypeId() const =0
Get the TypeId of the base type.
Hold objects of type Ptr<T>.
std::string SerializeToString(Ptr< const AttributeChecker > checker) const override
Ptr< AttributeValue > Copy() const override
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker) override
void Set(const Ptr< T > &value)
void SetObject(Ptr< Object > object)
Set the value from by reference an Object.
bool GetAccessor(Ptr< T > &value) const
a unique identifier for an interface.
std::string GetName() const
Get the name.
PointerChecker implementation.
std::string GetUnderlyingTypeInformation() const override
bool HasUnderlyingTypeInformation() const override
Ptr< AttributeValue > Create() const override
bool Check(const AttributeValue &val) const override
std::string GetValueTypeName() const override
bool Copy(const AttributeValue &source, AttributeValue &destination) const override
Copy the source to the destination.
TypeId GetPointeeTypeId() const override
Get the TypeId of the base type.
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
U * PeekPointer(const Ptr< U > &p)
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.