Allolib  1.0
C++ Components For Interactive Multimedia
al::DiscreteParameterValues Class Reference

Public Types

enum  Datatype {
  BOOL , FLOAT , DOUBLE , INT8 ,
  UINT8 , INT32 , UINT32 , INT64 ,
  UINT64 , STRING
}
 

Public Member Functions

 DiscreteParameterValues (Datatype datatype=FLOAT)
 
Datatype getDataType ()
 
size_t size ()
 
void sort ()
 
void clear ()
 
template<typename SpaceDataType >
void append (std::vector< SpaceDataType > &values, std::string idprefix="")
 
void append (void *values, size_t count, std::string idprefix="")
 
size_t getFirstIndexForId (std::string id, bool reverse=false)
 getFirstIndexForId More...
 
float at (size_t x)
 
std::string idAt (size_t x)
 
size_t getIndexForValue (float value)
 getIndexForValue More...
 
template<typename VecDataType >
std::vector< VecDataType > getValues ()
 
void * getValuesPtr ()
 
void setIds (std::vector< std::string > newIds)
 
std::vector< std::string > getIds ()
 
void lock ()
 
void unlock ()
 

Protected Member Functions

template<typename VecDataType >
std::vector< VecDataType > getAsVector ()
 
std::string valueToString (void *value)
 
double valueToFloat (void *value)
 
int64_t valueToInt64 (void *value)
 

Detailed Description

Definition at line 10 of file al_DiscreteParameterValues.hpp.

Member Function Documentation

◆ getFirstIndexForId()

size_t al::DiscreteParameterValues::getFirstIndexForId ( std::string  id,
bool  reverse = false 
)

getFirstIndexForId

Parameters
id
reverse
Returns

Returns numeric_limits<size_t>::max() if id is not found.

◆ getIndexForValue()

size_t al::DiscreteParameterValues::getIndexForValue ( float  value)

getIndexForValue

Parameters
value
Returns
the index of the value

Approximates to the closest extant value, except beyond minimum and maximum values. Returns SIZE_MAX if value outside the range.


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