| AAX SDK 2.8.0 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
List of all members | Public Member Functions
AAX_IDisplayDelegateDecorator< T > Class Template Reference
AAX SDK Manual » AAX Library features » Parameter Manager » Display delegates » Display delegate decorators

`#include <AAX_IDisplayDelegateDecorator.h>`

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

## Description

template<typename T>
class AAX_IDisplayDelegateDecorator< T >

The base class for all concrete display delegate decorators.

The AAX parameter display strategy uses a decorator pattern for parameter value formatting. This approach allows developers to maximize code re-use across display delegates with many different kinds of varying formatting, all without creating interdependencies between the different display delegates themselves.

For more information, see Display delegate decorators. For even more information, about the Decorator design pattern, please consult the GOF design patterns book.

Note
  This class is not part of the AAX ABI and must not be passed between the plug-in and the host.

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

## Constructor & Destructor Documentation

## ◆ AAX_IDisplayDelegateDecorator() [1/2]

template<typename T >

AAX_IDisplayDelegateDecorator< T >::AAX_IDisplayDelegateDecorator | ( | const AAX_IDisplayDelegate< T > & | displayDelegate | ) |

Constructor.

This class implements the decorator pattern, which is a sort of wrapper. The object that is being wrapped is passed into this constructor. This object is passed by reference because it must be copied to prevent any potential memory ambigities.

This constructor sets the local mWrappedDisplayDelegate member to a clone of the provided AAX_IDisplayDelegate.

Parameters

  [in] | displayDelegate | The decorated display delegate.

## ◆ AAX_IDisplayDelegateDecorator() [2/2]

template<typename T >

AAX_IDisplayDelegateDecorator< T >::AAX_IDisplayDelegateDecorator | ( | const AAX_IDisplayDelegateDecorator< T > & | other | ) |

Copy constructor.

This class implements the decorator pattern, which is a sort of wrapper. The object that is being wrapped is passed into this constructor. This object is passed by reference because it must be copied to prevent any potential memory ambigities.

This constructor sets the local mWrappedDisplayDelegate member to a clone of the provided AAX_IDisplayDelegateDecorator, allowing multiply-decorated display delegates.

Parameters

  [in] | other | The display delegate decorator that will be set as the wrapped delegate of this object

## ◆ ~AAX_IDisplayDelegateDecorator()

template<typename T >

AAX_IDisplayDelegateDecorator< T >::~AAX_IDisplayDelegateDecorator

Virtual destructor.

Note
  This destructor must be overriden here in order to delete the wrapped display delegate object upon decorator destruction.

## Member Function Documentation

## ◆ Clone()

template<typename T >

AAX_IDisplayDelegateDecorator< T > * AAX_IDisplayDelegateDecorator< T >::Clone
| virtual

Constructs and returns a copy of the display delegate decorator.

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);
}

Note
  This is an idiomatic method in the decorator pattern, so watch for potential problems if this method is ever changed or removed.

Implements AAX_IDisplayDelegate< T >.

## ◆ ValueToString() [1/2]

template<typename T >

bool AAX_IDisplayDelegateDecorator< T >::ValueToString | ( | T | value,
|  | AAX_CString * | valueString
| ) |  | const
| virtual

Converts a string to a real parameter value.

Override of the AAX_IDisplayDelegate implementation to call into the wrapped object. Display delegate decorators should call into this implementation to pass ValueToString() calls on to the wrapped object after applying their own value-to-string decoration.

Parameters

  [in] | valueString | The string that will be converted
  [out] | value | The real parameter value corresponding to valueString

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

Referenced by AAX_CDecibelDisplayDelegateDecorator< T >::ValueToString(), AAX_CPercentDisplayDelegateDecorator< T >::ValueToString(), AAX_CUnitDisplayDelegateDecorator< T >::ValueToString(), and AAX_CUnitPrefixDisplayDelegateDecorator< T >::ValueToString().

Here is the caller graph for this function:

## ◆ ValueToString() [2/2]

template<typename T >

bool AAX_IDisplayDelegateDecorator< T >::ValueToString | ( | T | value,
|  | int32_t | maxNumChars,
|  | AAX_CString * | valueString
| ) |  | const
| virtual

Converts a string to a real parameter value with a size constraint.

Override of the AAX_IDisplayDelegate implementation to call into the wrapped object. Display delegate decorators should call into this implementation to pass ValueToString() calls on to the wrapped object after applying their own value-to-string decoration.

Parameters

  [in] | valueString | The string that will be converted
  [in] | maxNumChars | Size hint for the desired maximum number of characters in the string (not including null termination)
  [out] | value | The real parameter value corresponding to valueString

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

## ◆ StringToValue()

template<typename T >

bool AAX_IDisplayDelegateDecorator< T >::StringToValue | ( | const AAX_CString & | valueString,
|  | T * | value
| ) |  | const
| virtual

Converts a string to a real parameter value.

Override of the DisplayDecorator implementation to call into the wrapped object. Display delegate decorators should call into this implementation to pass StringToValue() calls on to the wrapped object after applying their own string-to-value decoding.

Parameters

  [in] | valueString | The string that will be converted
  [out] | value | The real parameter value corresponding to valueString

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

Referenced by AAX_CDecibelDisplayDelegateDecorator< T >::StringToValue(), AAX_CPercentDisplayDelegateDecorator< T >::StringToValue(), AAX_CUnitDisplayDelegateDecorator< T >::StringToValue(), and AAX_CUnitPrefixDisplayDelegateDecorator< T >::StringToValue().

Here is the caller graph for this function:

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

- AAX_IDisplayDelegateDecorator.h