coriolis/chamsin/src/analogic/ChoiceParameter.h

24 lines
597 B
C
Raw Normal View History

2008-07-04 02:54:41 -05:00
#ifndef CHOICEPARAMETER_H
#define CHOICEPARAMETER_H
#include "DeviceParameter.h"
template <class Class>
class ChoiceParameter : public Parameter<Class> {
2008-07-04 02:54:41 -05:00
public:
typedef vector<string> Choices;
ChoiceParameter<Class>(string id, Choices& choices,
unsigned value, CallBack<Class>* callBack):
Parameter<Class>(id, callBack), _choices(), _value(value) {
2008-07-04 02:54:41 -05:00
if (_value > choices.size()) {
throw Error("");
}
}
private:
Choices _choices;
unsigned _value;
};
#endif // CHOICEPARAMETER_H