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

#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. 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...
 

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]displayDelegateThe decorated display delegate.

◆ AAX_IDisplayDelegateDecorator() [2/2]

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]otherThe display delegate decorator that will be set as the wrapped delegate of this object

◆ ~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 ( 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]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 >.

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 ( 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]valueStringThe string that will be converted
[in]maxNumCharsSize hint for the desired maximum number of characters in the string (not including null termination)
[out]valueThe real parameter value corresponding to valueString
Return values
trueThe string conversion was successful
falseThe 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]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 >.

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: