Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 /* | 319 /* |
320 * Construct from a class get functor method. | 320 * Construct from a class get functor method. |
321 * \param [in] getter The class get functor method pointer. | 321 * \param [in] getter The class get functor method pointer. |
322 */ | 322 */ |
323 MemberMethod (U (T::*getter)(void) const) | 323 MemberMethod (U (T::*getter)(void) const) |
324 : AccessorHelper<T,V> (), | 324 : AccessorHelper<T,V> (), |
325 m_getter (getter) | 325 m_getter (getter) |
326 {} | 326 {} |
327 private: | 327 private: |
328 virtual bool DoSet (T *object, const V *v) const { | 328 virtual bool DoSet (T *object, const V *v) const { |
329 NS_UNUSED(object); | 329 NS_UNUSED (object); |
330 NS_UNUSED(v); | 330 NS_UNUSED (v); |
331 return false; | 331 return false; |
332 } | 332 } |
333 virtual bool DoGet (const T *object, V *v) const { | 333 virtual bool DoGet (const T *object, V *v) const { |
334 v->Set ((object->*m_getter)()); | 334 v->Set ((object->*m_getter)()); |
335 return true; | 335 return true; |
336 } | 336 } |
337 virtual bool HasGetter (void) const { | 337 virtual bool HasGetter (void) const { |
338 return true; | 338 return true; |
339 } | 339 } |
340 virtual bool HasSetter (void) const { | 340 virtual bool HasSetter (void) const { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 bool ok = v->GetAccessor (tmp); | 382 bool ok = v->GetAccessor (tmp); |
383 if (!ok) | 383 if (!ok) |
384 { | 384 { |
385 return false; | 385 return false; |
386 } | 386 } |
387 (object->*m_setter)(tmp); | 387 (object->*m_setter)(tmp); |
388 return true; | 388 return true; |
389 } | 389 } |
390 virtual bool DoGet (const T *object, V *v) const { | 390 virtual bool DoGet (const T *object, V *v) const { |
391 NS_UNUSED(object); | 391 NS_UNUSED(object); |
392 NS_UNUSED(v); | 392 NS_UNUSED(v); |
Peter Barnes
2018/05/11 21:58:11
Previous two lines need space before paren.
ammo6818-vandals.uidaho.edu
2018/05/16 15:06:28
Fixed
| |
393 return false; | 393 return false; |
394 } | 394 } |
395 virtual bool HasGetter (void) const { | 395 virtual bool HasGetter (void) const { |
396 return false; | 396 return false; |
397 } | 397 } |
398 virtual bool HasSetter (void) const { | 398 virtual bool HasSetter (void) const { |
399 return true; | 399 return true; |
400 } | 400 } |
401 void (T::*m_setter)(U); // The class set method pointer, returning void. | 401 void (T::*m_setter)(U); // The class set method pointer, returning void. |
402 }; | 402 }; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
582 inline | 582 inline |
583 Ptr<const AttributeAccessor> | 583 Ptr<const AttributeAccessor> |
584 MakeAccessorHelper (T1 a1, T2 a2) | 584 MakeAccessorHelper (T1 a1, T2 a2) |
585 { | 585 { |
586 return DoMakeAccessorHelperTwo<V> (a1, a2); | 586 return DoMakeAccessorHelperTwo<V> (a1, a2); |
587 } | 587 } |
588 | 588 |
589 } // namespace ns3 | 589 } // namespace ns3 |
590 | 590 |
591 #endif /* ATTRIBUTE_ACCESSOR_HELPER_H */ | 591 #endif /* ATTRIBUTE_ACCESSOR_HELPER_H */ |
LEFT | RIGHT |