LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007 INRIA, Mathieu Lacage | 3 * Copyright (c) 2007 INRIA, Mathieu Lacage |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 29 matching lines...) Expand all Loading... |
40 { | 40 { |
41 NS_LOG_FUNCTION (this); | 41 NS_LOG_FUNCTION (this); |
42 return m_objects.begin (); | 42 return m_objects.begin (); |
43 } | 43 } |
44 ObjectPtrContainerValue::Iterator | 44 ObjectPtrContainerValue::Iterator |
45 ObjectPtrContainerValue::End (void) const | 45 ObjectPtrContainerValue::End (void) const |
46 { | 46 { |
47 NS_LOG_FUNCTION (this); | 47 NS_LOG_FUNCTION (this); |
48 return m_objects.end (); | 48 return m_objects.end (); |
49 } | 49 } |
50 uint32_t | 50 std::size_t |
51 ObjectPtrContainerValue::GetN (void) const | 51 ObjectPtrContainerValue::GetN (void) const |
52 { | 52 { |
53 NS_LOG_FUNCTION (this); | 53 NS_LOG_FUNCTION (this); |
54 return m_objects.size (); | 54 return m_objects.size (); |
55 } | 55 } |
56 Ptr<Object> | 56 Ptr<Object> |
57 ObjectPtrContainerValue::Get (uint32_t i) const | 57 ObjectPtrContainerValue::Get (std::size_t i) const |
58 { | 58 { |
59 NS_LOG_FUNCTION (this << i); | 59 NS_LOG_FUNCTION (this << i); |
60 Iterator it = m_objects.find (i);· | 60 Iterator it = m_objects.find (i);· |
61 Ptr<Object> value = 0; | 61 Ptr<Object> value = 0; |
62 if ( it != m_objects.end () ) | 62 if ( it != m_objects.end () ) |
63 { | 63 { |
64 value = m_objects.find (i)->second; | 64 value = m_objects.find (i)->second; |
65 } | 65 } |
66 return value; | 66 return value; |
67 } | 67 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool· | 106 bool· |
107 ObjectPtrContainerAccessor::Get (const ObjectBase * object, AttributeValue &valu
e) const | 107 ObjectPtrContainerAccessor::Get (const ObjectBase * object, AttributeValue &valu
e) const |
108 { | 108 { |
109 NS_LOG_FUNCTION (this << object << &value); | 109 NS_LOG_FUNCTION (this << object << &value); |
110 ObjectPtrContainerValue *v = dynamic_cast<ObjectPtrContainerValue *> (&value); | 110 ObjectPtrContainerValue *v = dynamic_cast<ObjectPtrContainerValue *> (&value); |
111 if (v == 0) | 111 if (v == 0) |
112 { | 112 { |
113 return false; | 113 return false; |
114 } | 114 } |
115 v->m_objects.clear (); | 115 v->m_objects.clear (); |
116 uint32_t n; | 116 std::size_t n; |
117 bool ok = DoGetN (object, &n); | 117 bool ok = DoGetN (object, &n); |
118 if (!ok) | 118 if (!ok) |
119 { | 119 { |
120 return false; | 120 return false; |
121 } | 121 } |
122 for (uint32_t i = 0; i < n; i++) | 122 for (std::size_t i = 0; i < n; i++) |
123 { | 123 { |
124 uint32_t index; | 124 std::size_t index; |
125 Ptr<Object> o = DoGet (object, i, &index); | 125 Ptr<Object> o = DoGet (object, i, &index); |
126 v->m_objects.insert (std::pair <uint32_t, Ptr<Object> > (index, o)); | 126 v->m_objects[index] = o; |
127 } | 127 } |
128 return true; | 128 return true; |
129 } | 129 } |
130 bool· | 130 bool· |
131 ObjectPtrContainerAccessor::HasGetter (void) const | 131 ObjectPtrContainerAccessor::HasGetter (void) const |
132 { | 132 { |
133 NS_LOG_FUNCTION (this); | 133 NS_LOG_FUNCTION (this); |
134 return true; | 134 return true; |
135 } | 135 } |
136 bool· | 136 bool· |
137 ObjectPtrContainerAccessor::HasSetter (void) const | 137 ObjectPtrContainerAccessor::HasSetter (void) const |
138 { | 138 { |
139 NS_LOG_FUNCTION (this); | 139 NS_LOG_FUNCTION (this); |
140 return false; | 140 return false; |
141 } | 141 } |
142 | 142 |
143 } // name | 143 } // name |
LEFT | RIGHT |