We compile with GCC 4.7.4

This commit is contained in:
Lorenz Meier
2013-10-10 21:15:03 +02:00
parent 0cb8e782b0
commit 44deeb85c0
3 changed files with 54 additions and 37 deletions
+23 -6
View File
@@ -69,22 +69,39 @@ protected:
/**
* Parameters that are tied to blocks for updating and nameing.
*/
template<class T>
class __EXPORT BlockParam : public BlockParamBase
class __EXPORT BlockParamFloat : public BlockParamBase
{
public:
BlockParam(Block *block, const char *name, bool parent_prefix=true) :
BlockParamFloat(Block *block, const char *name, bool parent_prefix=true) :
BlockParamBase(block, name, parent_prefix),
_val() {
update();
}
T get() { return _val; }
void set(T val) { _val = val; }
float get() { return _val; }
void set(float val) { _val = val; }
void update() {
if (_handle != PARAM_INVALID) param_get(_handle, &_val);
}
protected:
T _val;
float _val;
};
class __EXPORT BlockParamInt : public BlockParamBase
{
public:
BlockParamInt(Block *block, const char *name, bool parent_prefix=true) :
BlockParamBase(block, name, parent_prefix),
_val() {
update();
}
int get() { return _val; }
void set(int val) { _val = val; }
void update() {
if (_handle != PARAM_INVALID) param_get(_handle, &_val);
}
protected:
int _val;
};
} // namespace control