OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TSelectionIndexMapper< TValue > Class Template Reference

Maps between application-specific value and a selection index, such as a radio-button group index or a list box selection. More...

#include <owl/transfer.h>

Public Member Functions

template<int N, class TGet , class TSet >
 TSelectionIndexMapper (const TValue(&values)[N], TGet get, TSet set)
 Constructs a new mapper given an array of values, a getter and a setter.
 
template<int N, class D , class R , class A >
 TSelectionIndexMapper (const TValue(&values)[N], D *d, R(D::*get)() const, void(D::*set)(A))
 Overload; specialized for member functions.
 
int Get () const
 Uses the stored getter to get the application-specific value, then converts it to a selection index.
 
void Set (int index)
 Converts the given selection index to an application-specific value, then calls the stored setter, passing the value as an argument.
 

Detailed Description

template<class TValue>
class owl::TSelectionIndexMapper< TValue >

Maps between application-specific value and a selection index, such as a radio-button group index or a list box selection.

Definition at line 1561 of file transfer.h.

Constructor & Destructor Documentation

◆ TSelectionIndexMapper() [1/2]

template<class TValue >
template<int N, class TGet , class TSet >
owl::TSelectionIndexMapper< TValue >::TSelectionIndexMapper ( const TValue(&) values[N],
TGet get,
TSet set )
inline

Constructs a new mapper given an array of values, a getter and a setter.

The order of the values passed determines the mapping of the selection indexes.

Definition at line 1570 of file transfer.h.

◆ TSelectionIndexMapper() [2/2]

template<class TValue >
template<int N, class D , class R , class A >
owl::TSelectionIndexMapper< TValue >::TSelectionIndexMapper ( const TValue(&) values[N],
D * d,
R(D::*)() const get,
void(D::*)(A) set )
inline

Overload; specialized for member functions.

Definition at line 1578 of file transfer.h.

Member Function Documentation

◆ Get()

template<class TValue >
int owl::TSelectionIndexMapper< TValue >::Get ( ) const
inline

Uses the stored getter to get the application-specific value, then converts it to a selection index.

Returns N, the size of the value array, if the conversion can not be done.

Definition at line 1588 of file transfer.h.

◆ Set()

template<class TValue >
void owl::TSelectionIndexMapper< TValue >::Set ( int index)
inline

Converts the given selection index to an application-specific value, then calls the stored setter, passing the value as an argument.

Does nothing if the conversion can not be done.

Definition at line 1595 of file transfer.h.


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