Left: | ||
Right: |
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 if (obj == 0) | 252 if (obj == 0) |
253 { | 253 { |
254 return false; | 254 return false; |
255 } | 255 } |
256 *n = (obj->*m_getN)(); | 256 *n = (obj->*m_getN)(); |
257 return true; | 257 return true; |
258 } | 258 } |
259 virtual Ptr<Object> DoGet(const ObjectBase *object, std::size_t i, std::size _t *index) const { | 259 virtual Ptr<Object> DoGet(const ObjectBase *object, std::size_t i, std::size _t *index) const { |
260 const T *obj = static_cast<const T *> (object); | 260 const T *obj = static_cast<const T *> (object); |
261 *index = i; | 261 *index = i; |
262 return (obj->*m_get)(i); | 262 return (obj->*m_get)(static_cast<uint32_t> (i)); |
Peter Barnes
2018/04/17 00:04:13
I think this is a bug: the three uses of std::siz
ammo6818-vandals.uidaho.edu
2018/05/02 05:06:32
I had to do this to resolve a Visual Studio compil
| |
263 } | 263 } |
264 Ptr<U> (T::*m_get)(INDEX) const; | 264 Ptr<U> (T::*m_get)(INDEX) const; |
265 INDEX (T::*m_getN)(void) const; | 265 INDEX (T::*m_getN)(void) const; |
266 } *spec = new MemberGetters (); | 266 } *spec = new MemberGetters (); |
267 spec->m_get = get; | 267 spec->m_get = get; |
268 spec->m_getN = getN; | 268 spec->m_getN = getN; |
269 return Ptr<const AttributeAccessor> (spec, false); | 269 return Ptr<const AttributeAccessor> (spec, false); |
270 } | 270 } |
271 | 271 |
272 template <typename T, typename U, typename INDEX> | 272 template <typename T, typename U, typename INDEX> |
273 Ptr<const AttributeAccessor> | 273 Ptr<const AttributeAccessor> |
274 MakeObjectPtrContainerAccessor (INDEX (T::*getN)(void) const, | 274 MakeObjectPtrContainerAccessor (INDEX (T::*getN)(void) const, |
275 Ptr<U> (T::*get)(INDEX) const) | 275 Ptr<U> (T::*get)(INDEX) const) |
276 { | 276 { |
277 return MakeObjectPtrContainerAccessor (get, getN); | 277 return MakeObjectPtrContainerAccessor (get, getN); |
278 } | 278 } |
279 | 279 |
280 template <typename T> | 280 template <typename T> |
281 Ptr<const AttributeChecker> MakeObjectPtrContainerChecker (void) | 281 Ptr<const AttributeChecker> MakeObjectPtrContainerChecker (void) |
282 { | 282 { |
283 return Create<internal::ObjectPtrContainerChecker<T> > (); | 283 return Create<internal::ObjectPtrContainerChecker<T> > (); |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 } // namespace ns3 | 287 } // namespace ns3 |
288 | 288 |
289 #endif /* OBJECT_PTR_CONTAINER_H */ | 289 #endif /* OBJECT_PTR_CONTAINER_H */ |
LEFT | RIGHT |