Is there an NS3 object that is equivalent to/child of std::vector that
I can use? I can write one very easily, but I think I shouldn't be
duplicating code if one exists already.
I actually just want to pass in a generic std::vector (not necessarily
a vector of Ptr) into an ns3::Object as an Attribute. (ie. something
like template <typename T, typename _Alloc> class Blah : ns3::Object,
std::vector<double, _Alloc>).
Alternatively, are there anyway I can pass in an STL container or
similar (or pointer to) as Attribute to an Object?
What I'm trying to do is to pass in a mapping between an integer (from
0 to N) and a double such that the ns3::Object can look up the value
at run time. My view is that it is more appropriate to pass in the
mapping than to pass in a Callback that looks up the mapping as the
mapping should be internal to that object, and the object may want to
change the mapping during run time.
Quincy
On Mar 16, 5:51 am, Mihal Brumbulli <mbrumbu...@gmail.com> wrote:
> have a look at
>
> http://groups.google.com/group/ns-3-users/browse_thread/thread/c85ae2...
I had the same problem some time ago. The solution I adopted was to
create e generic Container class,
based essentially on NodeContainer, but able to add any data type:
template<typename T>
class Container : public Object
This way I can use PointerValue() to pass a Container to any
Application as attribute.
Of course there may be better solutions, but this worked for me and I
did not bother to find
something better :)
Hope it helps