AAX SDK  2.4.1
Avid Audio Extensions Development Kit
List of all members | Public Member Functions | Protected Attributes
AAX_CUnitDisplayDelegateDecorator< T > Class Template Reference

#include <AAX_CUnitDisplayDelegateDecorator.h>

Inheritance diagram for AAX_CUnitDisplayDelegateDecorator< T >:
[legend]
Collaboration diagram for AAX_CUnitDisplayDelegateDecorator< T >:
[legend]

Description

template<typename T>
class AAX_CUnitDisplayDelegateDecorator< T >

A unit type decorator conforming to AAX_IDisplayDelegateDecorator.

This class is an AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for other display delegates or concrete display types. For more information about display delegate decorators in AAX, see Display delegate decorators

The behavior of this class it to decorate parameter value strings with arbitrary units, such as "Hz" or "V". The inverse is also supported, so the unit string is pulled off of value strings when they are converted to real parameter values.

Public Member Functions

 AAX_CUnitDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate, const AAX_CString &unitString)
 Constructor. More...
 
AAX_CUnitDisplayDelegateDecorator< T > * Clone () const AAX_OVERRIDE
 Constructs and returns a copy of the display delegate. More...
 
bool ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE
 Converts a real parameter value to a string representation. More...
 
bool ValueToString (T value, int32_t maxNumChars, AAX_CString *valueString) const AAX_OVERRIDE
 Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays. More...
 
bool StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE
 Converts a string to a real parameter value. More...
 
- Public Member Functions inherited from AAX_IDisplayDelegateDecorator< T >
 AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate)
 Constructor. More...
 
 AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegateDecorator &other)
 Copy constructor. More...
 
 ~AAX_IDisplayDelegateDecorator () AAX_OVERRIDE
 Virtual destructor. More...
 
AAX_IDisplayDelegateDecorator< T > * Clone () const AAX_OVERRIDE
 Constructs and returns a copy of the display delegate decorator. More...
 
bool ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE
 Converts a string to a real parameter value. More...
 
bool ValueToString (T value, int32_t maxNumChars, AAX_CString *valueString) const AAX_OVERRIDE
 Converts a string to a real parameter value with a size constraint. More...
 
bool StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE
 Converts a string to a real parameter value. More...
 
- Public Member Functions inherited from AAX_IDisplayDelegateBase
virtual ~AAX_IDisplayDelegateBase ()
 Virtual destructor. More...
 

Protected Attributes

const AAX_CString mUnitString
 

Constructor & Destructor Documentation

◆ AAX_CUnitDisplayDelegateDecorator()

template<typename T >
AAX_CUnitDisplayDelegateDecorator< T >::AAX_CUnitDisplayDelegateDecorator ( const AAX_IDisplayDelegate< T > &  displayDelegate,
const AAX_CString unitString 
)

Constructor.

Along with the standard decorator pattern argument, this class also takes a unit string. This is the string that will be added to the end of valueString.

Parameters
[in]displayDelegate
[in]unitString

Member Function Documentation

◆ Clone()

template<typename T >
AAX_CUnitDisplayDelegateDecorator< T > * AAX_CUnitDisplayDelegateDecorator< T >::Clone ( ) const
virtual

Constructs and returns a copy of the display delegate.

In general, this method's implementation can use a simple copy constructor:

template <typename T>
AAX_CSubclassDisplayDelegate<T>* AAX_CSubclassDisplayDelegate<T>::Clone() const
{
return new AAX_CSubclassDisplayDelegate(*this);
}

Implements AAX_IDisplayDelegate< T >.

◆ ValueToString() [1/2]

template<typename T >
bool AAX_CUnitDisplayDelegateDecorator< T >::ValueToString ( value,
AAX_CString valueString 
) const
virtual

Converts a real parameter value to a string representation.

Parameters
[in]valueThe real parameter value that will be converted
[out]valueStringA string corresponding to value
Return values
trueThe string conversion was successful
falseThe string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_IDisplayDelegateDecorator< T >::ValueToString().

Here is the call graph for this function:

◆ ValueToString() [2/2]

template<typename T >
bool AAX_CUnitDisplayDelegateDecorator< T >::ValueToString ( value,
int32_t  maxNumChars,
AAX_CString valueString 
) const
virtual

Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays.

Parameters
[in]valueThe real parameter value that will be converted
[in]maxNumCharsSize hint for the desired maximum number of characters in the string (not including null termination)
[out]valueStringA string corresponding to value
Return values
trueThe string conversion was successful
falseThe string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_CString::Length(), and AAX_IDisplayDelegateDecorator< T >::ValueToString().

Here is the call graph for this function:

◆ StringToValue()

template<typename T >
bool AAX_CUnitDisplayDelegateDecorator< T >::StringToValue ( const AAX_CString valueString,
T *  value 
) const
virtual

Converts a string to a real parameter value.

Parameters
[in]valueStringThe string that will be converted
[out]valueThe real parameter value corresponding to valueString
Return values
trueThe string conversion was successful
falseThe string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_CString::Length(), AAX_IDisplayDelegateDecorator< T >::StringToValue(), and AAX_CString::SubString().

Here is the call graph for this function:

Member Data Documentation

◆ mUnitString

template<typename T >
const AAX_CString AAX_CUnitDisplayDelegateDecorator< T >::mUnitString
protected

The documentation for this class was generated from the following file: