Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
TCustomViewCreator< TView >::TAttribute< T, TGetter, TSetter > Class Template Reference

Generic base class that implements the logic for a ViewAttribute that uses a getter and setter in TView. More...

Inherits ViewAttribute.

Public Types

using Getter = TGetter
using Setter = TSetter

Public Member Functions

bool apply (CView *iView, const UIAttributes &iAttributes, const IUIDescription *iDescription) override
 apply => calls the setter on the view to set the attribute (use fromString)
virtual bool fromString (IUIDescription const *iDescription, std::string const &iAttributeValue, T &oValue) const
 Subclasses need to implement this method to convert a string (iAttributeValue) to a T.
IViewCreator::AttrType getType () override
 TAttribute (std::string const &iName, Getter iGetter, Setter iSetter)
Public Member Functions inherited from ViewAttribute
std::string getName () const
 Name of the attribute (which ends up being an attribute in the xml file) Ex: <view back-color="~ BlackCColor" .../> => back-color.
 ViewAttribute (std::string iName)

Private Attributes

Setter fSetter

Detailed Description

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
class pongasoft::VST::GUI::Views::TCustomViewCreator< TView >::TAttribute< T, TGetter, TSetter >

Generic base class that implements the logic for a ViewAttribute that uses a getter and setter in TView.

Template Parameters
Tthe type of the attribute

Member Typedef Documentation

◆ Getter

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
using Getter = TGetter

◆ Setter

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
using Setter = TSetter

Constructor & Destructor Documentation

◆ TAttribute()

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
TAttribute ( std::string const & iName,
Getter iGetter,
Setter iSetter )
inline

Member Function Documentation

◆ apply()

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
bool apply ( CView * iView,
const UIAttributes & iAttributes,
const IUIDescription * iDescription )
inlineoverridevirtual

apply => calls the setter on the view to set the attribute (use fromString)

Implements ViewAttribute.

◆ fromString()

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
virtual bool fromString ( IUIDescription const * iDescription,
std::string const & iAttributeValue,
T & oValue ) const
inlinevirtual

Subclasses need to implement this method to convert a string (iAttributeValue) to a T.

Returns true if the conversion is possible in which case the result is written to oValue, false otherwise.

Reimplemented in TCustomViewCreator< TView >::ListAttribute< T >.

◆ getType()

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
IViewCreator::AttrType getType ( )
inlineoverridevirtual
Returns
the type of this attribute => subclass will define it

Implements ViewAttribute.

Member Data Documentation

◆ fSetter

template<typename TView>
template<typename T, typename TGetter, typename TSetter>
Setter fSetter
private

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