ProxyPointer.inl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. namespace AZ
  9. {
  10. namespace SceneAPI
  11. {
  12. namespace Containers
  13. {
  14. template<typename Type>
  15. ProxyPointer<Type>::ProxyPointer(const Type& value)
  16. : m_value(value)
  17. {
  18. }
  19. template<typename Type>
  20. Type& ProxyPointer<Type>::operator*()
  21. {
  22. return m_value;
  23. }
  24. template<typename Type>
  25. const Type& ProxyPointer<Type>::operator*() const
  26. {
  27. return m_value;
  28. }
  29. template<typename Type>
  30. Type* ProxyPointer<Type>::operator->()
  31. {
  32. return &m_value;
  33. }
  34. template<typename Type>
  35. const Type* ProxyPointer<Type>::operator->() const
  36. {
  37. return &m_value;
  38. }
  39. template<typename Type>
  40. ProxyPointer<Type&>::ProxyPointer(Type& value)
  41. : m_value(value)
  42. {
  43. }
  44. template<typename Type>
  45. Type& ProxyPointer<Type&>::operator*()
  46. {
  47. return m_value;
  48. }
  49. template<typename Type>
  50. const Type& ProxyPointer<Type&>::operator*() const
  51. {
  52. return m_value;
  53. }
  54. template<typename Type>
  55. Type* ProxyPointer<Type&>::operator->()
  56. {
  57. return &m_value;
  58. }
  59. template<typename Type>
  60. const Type* ProxyPointer<Type&>::operator->() const
  61. {
  62. return &m_value;
  63. }
  64. } // Containers
  65. } // SceneAPI
  66. } // AZ