AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX_IDisplayDelegateDecorator.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2014-2017, 2019 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
22 /*================================================================================================*/
23 
24 
25 #ifndef AAX_IDISPLAYDELEGATEDECORATOR_H
26 #define AAX_IDISPLAYDELEGATEDECORATOR_H
27 
28 #include "AAX_IDisplayDelegate.h"
29 
30 
42 template <typename T>
44 {
45 public:
59 
73 
80 
99 
114  bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE;
115 
132  bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE;
133 
148  bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE;
149 
150 private:
151  const AAX_IDisplayDelegate<T>* mWrappedDisplayDelegate;
152 
155 };
156 
157 template <typename T>
160  mWrappedDisplayDelegate(displayDelegate.Clone())
161 {
162 
163 }
164 
165 template <typename T>
167  mWrappedDisplayDelegate(other.mWrappedDisplayDelegate->Clone())
168 {
169 
170 }
171 
172 template <typename T>
174 {
175  delete mWrappedDisplayDelegate;
176 }
177 
178 template <typename T>
180 {
181  return new AAX_IDisplayDelegateDecorator(*this);
182 }
183 
184 template <typename T>
186 {
187  return mWrappedDisplayDelegate->ValueToString(value, valueString);
188 }
189 
190 template <typename T>
191 bool AAX_IDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
192 {
193  return mWrappedDisplayDelegate->ValueToString(value, maxNumChars, valueString);
194 }
195 
196 template <typename T>
197 bool AAX_IDisplayDelegateDecorator<T>::StringToValue(const AAX_CString& valueString, T* value) const
198 {
199  return mWrappedDisplayDelegate->StringToValue(valueString, value);
200 }
201 
202 
203 
204 
205 #endif //AAX_IDISPLAYDELEGATEDECORATOR_H
206 
207 
208 
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:141
Defines the display behavior for a parameter.
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:46
Classes for parameter value string conversion.
Definition: AAX_IDisplayDelegate.h:69
The base class for all concrete display delegate decorators.
Definition: AAX_IDisplayDelegateDecorator.h:44
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:197
~AAX_IDisplayDelegateDecorator() AAX_OVERRIDE
Virtual destructor.
Definition: AAX_IDisplayDelegateDecorator.h:173
AAX_IDisplayDelegateDecorator< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the display delegate decorator.
Definition: AAX_IDisplayDelegateDecorator.h:179
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:185