SourceControlContainers.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*******************************************************************************
  2. The content of this file includes portions of the AUDIOKINETIC Wwise Technology
  3. released in source code form as part of the SDK installer package.
  4. Commercial License Usage
  5. Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
  6. may use this file in accordance with the end user license agreement provided
  7. with the software or, alternatively, in accordance with the terms contained in a
  8. written agreement between you and Audiokinetic Inc.
  9. Apache License Usage
  10. Alternatively, this file may be used under the Apache License, Version 2.0 (the
  11. "Apache License"); you may not use this file except in compliance with the
  12. Apache License. You may obtain a copy of the Apache License at
  13. http://www.apache.org/licenses/LICENSE-2.0.
  14. Unless required by applicable law or agreed to in writing, software distributed
  15. under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  16. OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
  17. the specific language governing permissions and limitations under the License.
  18. Copyright (c) 2023 Audiokinetic Inc.
  19. *******************************************************************************/
  20. /// \file AK/Wwise/SourceControl/SourceControlContainers.h
  21. /// \brief Wwise source control containers interface that is used to pass data containers (list and map) in parameters.
  22. #ifndef _AK_WWISE_SOURCECONTROLCONTAINERS_H
  23. #define _AK_WWISE_SOURCECONTROLCONTAINERS_H
  24. // Audiokinetic namespace
  25. namespace AK
  26. {
  27. // Audiokinetic Wwise namespace
  28. namespace Wwise
  29. {
  30. /// Source Control Containers namespace
  31. namespace SourceControlContainers
  32. {
  33. /// Container position
  34. struct __AkPos{};
  35. /// Pointer to a container position
  36. typedef __AkPos* AkPos;
  37. // IAkList
  38. /// Template parameters:
  39. /// - Type: Class of object stored in the list.
  40. /// - Arg_Type: Type used to reference objects stored in the list. Can be a reference. By default, this is a reference to the type.
  41. ///
  42. /// \akwarning
  43. /// The functions in this interface are not thread-safe, unless stated otherwise.
  44. /// \endakwarning
  45. ///
  46. /// \aknote The class implementing this interface is a wrapper around the MFC \b CList class. Documentation can be found on MSDN.
  47. /// \endaknote
  48. template <class Type, class Arg_Type = const Type&>
  49. class IAkList
  50. {
  51. public:
  52. virtual void Reserve(size_t in_capacity) {}
  53. [[deprecated("Use GetSize() instead.")]]
  54. unsigned int GetCount() const { return GetSize(); }
  55. virtual unsigned int GetSize() const = 0;
  56. virtual bool IsEmpty() const = 0;
  57. /// \warning Invalidates previously obtained AkPos
  58. [[deprecated("Use InsertBefore(GetHeadPosition(), in_newElement) instead.")]]
  59. virtual void AddHead( Arg_Type in_newElement ) = 0;
  60. /// \warning Invalidates previously obtained AkPos
  61. virtual void AddTail( Arg_Type in_newElement ) = 0;
  62. /// \warning Invalidates previously obtained AkPos
  63. [[deprecated("Use RemoveAt(GetHeadPosition()) instead.")]]
  64. virtual void RemoveHead() = 0;
  65. /// \warning Invalidates previously obtained AkPos
  66. virtual void RemoveTail() = 0;
  67. /// \warning Invalidates previously obtained AkPos
  68. virtual void RemoveAt( AkPos in_position ) = 0;
  69. /// \warning Invalidates previously obtained AkPos
  70. virtual void RemoveAll() = 0;
  71. virtual Type& GetHead() = 0;
  72. virtual const Type& GetHead() const = 0;
  73. virtual Type& GetTail() = 0;
  74. virtual const Type& GetTail() const = 0;
  75. /// \warning Invalidates previously obtained AkPos (do not call while iterating)
  76. virtual AkPos GetHeadPosition() const = 0;
  77. /// \warning Invalidates previously obtained AkPos (do not call while iterating)
  78. virtual AkPos GetTailPosition() const = 0;
  79. /// \warning Must be called with a AkPos obtained from the same container instance
  80. virtual Type& GetNext( AkPos& in_rPosition ) = 0;
  81. /// \warning Must be called with a AkPos obtained from the same container instance
  82. virtual const Type& GetNext( AkPos& in_rPosition ) const = 0;
  83. /// \warning Must be called with a AkPos obtained from the same container instance
  84. virtual Type& GetPrev( AkPos& in_rPosition ) = 0;
  85. /// \warning Must be called with a AkPos obtained from the same container instance
  86. virtual const Type& GetPrev( AkPos& in_rPosition ) const = 0;
  87. virtual Type& GetAt( AkPos in_position ) = 0;
  88. virtual const Type& GetAt( AkPos in_position ) const = 0;
  89. virtual Type& GetAt( unsigned int in_index ) = 0;
  90. virtual const Type& GetAt( unsigned int in_index ) const = 0;
  91. virtual void SetAt( AkPos in_pos, Arg_Type in_newElement ) = 0;
  92. /// \warning Invalidates previously obtained AkPos
  93. virtual AkPos InsertBefore( AkPos in_position, Arg_Type in_newElement ) = 0;
  94. /// \warning Invalidates previously obtained AkPos
  95. virtual AkPos InsertAfter( AkPos in_position, Arg_Type in_newElement ) = 0;
  96. };
  97. // IAkMap
  98. /// Template parameters:
  99. /// - Key: Class of the object used as the map key.
  100. /// - Arg_Key: Data type used for Key arguments.
  101. /// - Value: Class of the object stored in the map.
  102. /// - Arg_Value: Data type used for Value arguments; usually a reference to Value.
  103. ///
  104. /// \akwarning
  105. /// The functions in this interface are not thread-safe, unless stated otherwise.
  106. /// \endakwarning
  107. ///
  108. /// \aknote The class implementing this interface is a wrapper around the MFC \b CMap class. Documentation can be found on MSDN.
  109. /// \endaknote
  110. template <class Key, class Arg_Key, class Value, class Arg_Value>
  111. class IAkMap
  112. {
  113. public:
  114. [[deprecated("Use GetSize() instead.")]]
  115. unsigned int GetCount() const { return GetSize(); }
  116. virtual unsigned int GetSize() const = 0;
  117. virtual bool IsEmpty() const = 0;
  118. virtual bool Lookup( Arg_Key in_key, Value& in_rValue ) const = 0;
  119. virtual Value& operator[]( Arg_Key in_key ) = 0;
  120. virtual void SetAt( Arg_Key in_key, Arg_Value in_newValue ) = 0;
  121. virtual bool RemoveKey( Arg_Key in_key ) = 0;
  122. virtual void RemoveAll() = 0;
  123. virtual AkPos GetStartPosition() const = 0;
  124. virtual void GetNextAssoc( AkPos& in_rNextPosition, Key& in_rKey, Value& in_rValue ) const = 0;
  125. };
  126. };
  127. }
  128. }
  129. #endif // _AK_WWISE_SOURCECONTROLCONTAINERS_H