author | Tom Henderson <tomh@tomh.org> |
Sat, 16 Jan 2016 08:14:40 -0800 | |
changeset 11683 | 9142266fbb25 |
parent 11136 | 03bf8fa63bda |
permissions | -rw-r--r-- |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
2 |
/* |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA, Mathieu Lacage |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
4 |
* |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
7 |
* published by the Free Software Foundation; |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
8 |
* |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
12 |
* GNU General Public License for more details. |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
13 |
* |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
17 |
* |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
18 |
* Authors: Mathieu Lacage <mathieu.lacage@gmail.com> |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
19 |
*/ |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#ifndef OBJECT_VECTOR_H |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#define OBJECT_VECTOR_H |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "object.h" |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "ptr.h" |
2438
e2ac9f9aeeb9
value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
25 |
#include "attribute.h" |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
26 |
#include "object-ptr-container.h" |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
11136
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
28 |
/** |
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
29 |
* \file |
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
30 |
* \ingroup attribute_ObjectVector |
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
31 |
* ObjectVector attribute value declarations and template implementations. |
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
32 |
*/ |
03bf8fa63bda
[Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11131
diff
changeset
|
33 |
|
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
namespace ns3 { |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
36 |
/** |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
37 |
* \ingroup attribute_ObjectVector |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
38 |
* ObjectVectorValue is an alias for ObjectPtrContainerValue |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
39 |
*/ |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
40 |
typedef ObjectPtrContainerValue ObjectVectorValue; |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
42 |
/** |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
43 |
* \ingroup attribute_ObjectVector |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
44 |
* MakeAccessorHelper implementation for ObjectVector. |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
45 |
* \copydetails ns3::DoMakeAccessorHelperOne(U T::*) |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
46 |
*/ |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
template <typename T, typename U> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
48 |
Ptr<const AttributeAccessor> |
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
49 |
MakeObjectVectorAccessor (U T::*memberVariable); |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
50 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
51 |
// Documentation generated by print-introspected-doxygen.cc |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
52 |
template <typename T> |
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
53 |
Ptr<const AttributeChecker> |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
54 |
MakeObjectVectorChecker (void); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
56 |
/** |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
57 |
* \ingroup attribute_ObjectVector |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
58 |
* \copydoc ns3::MakeObjectPtrContainerAccessor() |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
59 |
*/ |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
60 |
template <typename T, typename U, typename INDEX> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
61 |
Ptr<const AttributeAccessor> |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
62 |
MakeObjectVectorAccessor (Ptr<U> (T::*get)(INDEX) const, |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
63 |
INDEX (T::*getN)(void) const); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
65 |
/** |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
66 |
* \ingroup attribute_ObjectVector |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
67 |
* \copydoc ns3::MakeObjectPtrContainerAccessor() |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
68 |
*/ |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
template <typename T, typename U, typename INDEX> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
70 |
Ptr<const AttributeAccessor> |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
71 |
MakeObjectVectorAccessor (INDEX (T::*getN)(void) const, |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
72 |
Ptr<U> (T::*get)(INDEX) const); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
|
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
74 |
|
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
75 |
/*************************************************************** |
11131
6a448ac28669
[Doxygen] Various in src/core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11036
diff
changeset
|
76 |
* Implementation of the templates declared above. |
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
77 |
***************************************************************/ |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8749
diff
changeset
|
78 |
|
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
79 |
template <typename T, typename U> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
80 |
Ptr<const AttributeAccessor> |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
81 |
MakeObjectVectorAccessor (U T::*memberVector) |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
82 |
{ |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
83 |
struct MemberStdContainer : public ObjectPtrContainerAccessor |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
84 |
{ |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
85 |
virtual bool DoGetN (const ObjectBase *object, uint32_t *n) const { |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
86 |
const T *obj = dynamic_cast<const T *> (object); |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
87 |
if (obj == 0) |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
88 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
89 |
return false; |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
90 |
} |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
91 |
*n = (obj->*m_memberVector).size (); |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
92 |
return true; |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
93 |
} |
7884
963d5bfe9c52
Fixed bug 1352 (Object attribute map / vector issue)
Jaume Nin <jnin@cttc.cat>
parents:
7412
diff
changeset
|
94 |
virtual Ptr<Object> DoGet (const ObjectBase *object, uint32_t i, uint32_t *index) const { |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
const T *obj = static_cast<const T *> (object); |
2497
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
96 |
typename U::const_iterator begin = (obj->*m_memberVector).begin (); |
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
97 |
typename U::const_iterator end = (obj->*m_memberVector).end (); |
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
98 |
uint32_t k = 0; |
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
99 |
for (typename U::const_iterator j = begin; j != end; j++, k++) |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
100 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
101 |
if (k == i) |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
102 |
{ |
7884
963d5bfe9c52
Fixed bug 1352 (Object attribute map / vector issue)
Jaume Nin <jnin@cttc.cat>
parents:
7412
diff
changeset
|
103 |
*index = k; |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
104 |
return *j; |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
105 |
break; |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
106 |
} |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
107 |
} |
2497
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
108 |
NS_ASSERT (false); |
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
109 |
// quiet compiler. |
9dfbcd50df64
do not use operator []. Use iterators instead to work with std::list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
110 |
return 0; |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
} |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
112 |
U T::*m_memberVector; |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
113 |
} *spec = new MemberStdContainer (); |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
114 |
spec->m_memberVector = memberVector; |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
115 |
return Ptr<const AttributeAccessor> (spec, false); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
116 |
} |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
117 |
|
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
118 |
template <typename T> |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
119 |
Ptr<const AttributeChecker> MakeObjectVectorChecker (void) |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
120 |
{ |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
121 |
return MakeObjectPtrContainerChecker<T> (); |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
122 |
} |
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
123 |
|
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
124 |
template <typename T, typename U, typename INDEX> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
125 |
Ptr<const AttributeAccessor> |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
126 |
MakeObjectVectorAccessor (Ptr<U> (T::*get)(INDEX) const, |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
127 |
INDEX (T::*getN)(void) const) |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
128 |
{ |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
129 |
return MakeObjectPtrContainerAccessor<T,U,INDEX>(get, getN); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
130 |
} |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
131 |
|
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
132 |
template <typename T, typename U, typename INDEX> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
133 |
Ptr<const AttributeAccessor> |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
134 |
MakeObjectVectorAccessor (INDEX (T::*getN)(void) const, |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
135 |
Ptr<U> (T::*get)(INDEX) const) |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
136 |
{ |
7412
d79278c6e51c
refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
137 |
return MakeObjectPtrContainerAccessor<T,U,INDEX>(get, getN); |
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
} |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
|
2933
c7983cfa2cb3
add ObjectVector::GetItemTypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2930
diff
changeset
|
140 |
|
c7983cfa2cb3
add ObjectVector::GetItemTypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2930
diff
changeset
|
141 |
|
2405
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
142 |
} // namespace ns3 |
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
143 |
|
17f406c71505
add ObjectVector value support.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
144 |
#endif /* OBJECT_VECTOR_H */ |