1#ifndef VISTLE_PARAMETER_MANAGER_H
2#define VISTLE_PARAMETER_MANAGER_H
22 void setCurrentParameterGroup(
const std::string &group = std::string());
23 const std::string ¤tParameterGroup()
const;
25 virtual Parameter *addParameterGeneric(
const std::string &name, std::shared_ptr<Parameter> parameter);
30 Parameter *addParameter(
const std::string &name,
const std::string &description,
const T &value,
33 bool setParameter(
const std::string &name,
const T &value,
const message::SetParameter *inResponseTo =
nullptr);
41 bool setParameterRange(
const std::string &name,
const T &minimum,
const T &maximum);
43 bool setParameterRange(
ParameterBase<T> *param,
const T &minimum,
const T &maximum);
45 bool getParameter(
const std::string &name, T &value)
const;
46 void setParameterChoices(
const std::string &name,
const std::vector<std::string> &choices);
47 void setParameterChoices(
Parameter *param,
const std::vector<std::string> &choices);
48 void setParameterFilters(
const std::string &name,
const std::string &filters);
49 void setParameterFilters(StringParameter *param,
const std::string &filters);
51 StringParameter *addStringParameter(
const std::string &name,
const std::string &description,
53 bool setStringParameter(
const std::string &name,
const std::string &value,
55 std::string getStringParameter(
const std::string &name)
const;
57 FloatParameter *addFloatParameter(
const std::string &name,
const std::string &description,
const Float value);
58 bool setFloatParameter(
const std::string &name,
const Float value,
60 Float getFloatParameter(
const std::string &name)
const;
62 IntParameter *addIntParameter(
const std::string &name,
const std::string &description,
const Integer value,
64 bool setIntParameter(
const std::string &name,
const Integer value,
66 Integer getIntParameter(
const std::string &name)
const;
68 VectorParameter *addVectorParameter(
const std::string &name,
const std::string &description,
70 bool setVectorParameter(
const std::string &name,
const ParamVector &value,
72 ParamVector getVectorParameter(
const std::string &name)
const;
74 IntVectorParameter *addIntVectorParameter(
const std::string &name,
const std::string &description,
76 bool setIntVectorParameter(
const std::string &name,
const IntParamVector &value,
78 IntParamVector getIntVectorParameter(
const std::string &name)
const;
81 virtual bool removeParameter(
Parameter *param);
83 std::shared_ptr<Parameter> findParameter(
const std::string &name)
const;
89 template<
class Payload>
90 void sendParameterMessageWithPayload(
message::Message &message, Payload &payload);
91 virtual bool changeParameters(std::set<const Parameter *> params);
92 virtual bool changeParameter(
const Parameter *p);
95 void setName(
const std::string &name);
97 void applyDelayedChanges();
100 bool parameterChangedWrapper(
const Parameter *p);
102 int m_id = message::Id::Invalid;
103 std::string m_name = std::string(
"ParameterManager");
104 std::string m_currentParameterGroup;
105 std::map<std::string, std::shared_ptr<Parameter>> parameters;
106 bool m_inParameterChanged =
false;
107 std::vector<const Parameter *> m_delayedChanges;
Definition: parameter.h:100
Definition: parametermanager.h:16
virtual void sendParameterMessage(const message::Message &message, const buffer *payload=nullptr) const =0
bool removeParameter(const std::string &name)
Definition: paramvector.h:18
Definition: parameter.h:26
Generic(Filename)(ExistingFilename)(Directory)(ExistingDirectory)(NewPathname)(Boolean)(Choice)(Slider)(Color)(InvalidPresentation)) DEFINE_ENUM_WITH_STRING_CONVERSIONS(RangeType
Minimum() Value(Maximum)) Parameter(int moduleId
Minimum() const std::string Presentation
Definition: parameter.h:52
Definition: message.h:157
request parameter value update or notify that a parameter value has been changed
Definition: messages.h:501
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
std::vector< char, allocator< char > > buffer
Definition: buffer.h:9
double Float
Definition: scalar.h:18
int64_t Integer
Definition: scalar.h:19