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

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise