20 #ifndef OBJECT_PTR_CONTAINER_H
21 #define OBJECT_PTR_CONTAINER_H
41 typedef std::map<uint32_t, Ptr<Object> >::const_iterator
Iterator;
56 uint32_t
GetN (
void)
const;
73 template <
typename T,
typename U,
typename INDEX>
76 INDEX (T::*getN)(
void)
const);
78 template <
typename T,
typename U,
typename INDEX>
81 Ptr<U> (T::*
get)(INDEX)
const);
103 return T::GetTypeId ();
109 return "ns3::ObjectPtrContainerValue";
115 return "ns3::Ptr< " + T::GetTypeId ().GetName () +
" >";
118 return ns3::Create<ObjectPtrContainerValue> ();
123 if (src == 0 || dst == 0)
147 template <
typename T,
typename U,
typename INDEX>
150 INDEX (T::*getN)(
void)
const)
154 virtual bool DoGetN (
const ObjectBase *
object, uint32_t *n)
const {
155 const T *obj =
dynamic_cast<const T *
> (object);
160 *n = (obj->*m_getN)();
164 const T *obj =
static_cast<const T *
> (object);
166 return (obj->*m_get)(i);
168 Ptr<U> (T::*m_get)(INDEX)
const;
169 INDEX (T::*m_getN)(void)
const;
170 } *spec =
new MemberGetters ();
176 template <
typename T,
typename U,
typename INDEX>
177 Ptr<const AttributeAccessor>
179 Ptr<U> (T::*
get)(INDEX)
const)
184 template <
typename T>
187 return Create<internal::AnObjectPtrContainerChecker<T> > ();
virtual Ptr< AttributeValue > Copy(void) const
ObjectPtrContainerValue()
Represent the type of an attribute.
virtual std::string GetUnderlyingTypeInformation(void) const
virtual bool Copy(const AttributeValue &source, AttributeValue &destination) const
Copy the source to the destination.
virtual std::string GetValueTypeName(void) const
virtual bool HasSetter(void) const
virtual Ptr< Object > DoGet(const ObjectBase *object, uint32_t i, uint32_t *index) const =0
Hold a value for an Attribute.
implement the ns-3 type and attribute system
virtual TypeId GetItemTypeId(void) const =0
virtual Ptr< AttributeValue > Create(void) const
std::map< uint32_t, Ptr< Object > >::const_iterator Iterator
Ptr< Object > Get(uint32_t i) const
virtual bool Set(ObjectBase *object, const AttributeValue &value) const
virtual bool HasUnderlyingTypeInformation(void) const
virtual bool HasGetter(void) const
std::map< uint32_t, Ptr< Object > > m_objects
allow setting and getting the value of an attribute.
Ptr< const AttributeAccessor > MakeObjectPtrContainerAccessor(Ptr< U >(T::*get)(INDEX) const, INDEX(T::*getN)(void) const)
virtual bool Check(const AttributeValue &value) const
Iterator Begin(void) const
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
virtual bool DoGetN(const ObjectBase *object, uint32_t *n) const =0
virtual TypeId GetItemTypeId(void) const
uint32_t GetN(void) const
contain a set of ns3::Object pointers.
virtual bool Get(const ObjectBase *object, AttributeValue &value) const
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
a unique identifier for an interface.
Ptr< const AttributeChecker > MakeObjectPtrContainerChecker(void)