Convenience method IParamManager::isParamValueEmpty()

This commit is contained in:
Pavel Kirienko
2015-03-23 18:34:19 +03:00
parent 6598b15d88
commit 0affb0eaec
2 changed files with 13 additions and 12 deletions
@@ -64,6 +64,17 @@ public:
* @return Negative if failed.
*/
virtual int eraseAllParams() = 0;
/**
* Convenience method that can be used to check if a param value is empty.
*/
static bool isParamValueEmpty(const ParamValue& val)
{
return val.value_bool.empty() &&
val.value_int.empty() &&
val.value_float.empty() &&
val.value_string.empty();
}
};
/**
@@ -83,8 +94,6 @@ class UAVCAN_EXPORT ParamServer
ServiceServer<protocol::param::ExecuteOpcode, ExecuteOpcodeCallback> save_erase_srv_;
IParamManager* manager_;
static bool isValueNonEmpty(const protocol::param::Value& value);
void handleGetSet(const protocol::param::GetSet::Request& request, protocol::param::GetSet::Response& response);
void handleExecuteOpcode(const protocol::param::ExecuteOpcode::Request& request,