1 #ifndef AL_DISCRETEPARAMETERVALUES_HPP
2 #define AL_DISCRETEPARAMETERVALUES_HPP
30 Datatype getDataType() {
return mDatatype; }
38 template <
typename SpaceDataType>
39 void append(std::vector<SpaceDataType> &values, std::string idprefix =
"") {
41 append(values.data(), values.size(), idprefix);
44 void append(
void *values,
size_t count, std::string idprefix =
"");
63 std::string idAt(
size_t x);
76 template <
typename VecDataType> std::vector<VecDataType> getValues() {
78 return std::vector<VecDataType>((VecDataType *)mValues,
79 (VecDataType *)mValues + size());
81 void *getValuesPtr() {
return mValues; }
83 void setIds(std::vector<std::string> newIds) { mIds = newIds; }
84 std::vector<std::string> getIds();
88 void lock() { mLock.lock(); }
89 void unlock() { mLock.unlock(); }
92 template <
typename VecDataType> std::vector<VecDataType> getAsVector() {
93 std::vector<VecDataType> vec;
94 VecDataType *castValues =
static_cast<VecDataType
>(mValues);
95 vec.assign(castValues, castValues + mSize);
98 std::string valueToString(
void *value);
99 double valueToFloat(
void *value);
100 int64_t valueToInt64(
void *value);
103 Datatype mDatatype{FLOAT};
106 unsigned char *mValues{
nullptr};
107 std::vector<std::string> mIds;
size_t getFirstIndexForId(std::string id, bool reverse=false)
getFirstIndexForId
size_t getIndexForValue(float value)
getIndexForValue