22 for (
const auto& param : list) {
23 if (name == param.name()) {
32 for (
const auto& param : list) {
33 if (name == param.name()) {
37 yCError(YRI_TYPES) <<
"Param" << name <<
"not found";
43 for (
const auto& param : list) {
44 if (param.isGroup() && name == param.name()) {
53 for (
const auto& param : list) {
54 if (param.isGroup() && name == param.name()) {
58 yCError(YRI_TYPES) <<
"Param" << name <<
"not found";
65 for (
auto it1 = params.begin(); it1 != params.end(); ++it1) {
67 for (
auto it2 = it1 + 1; it2 != params.end();) {
69 if (param1.
name() == param2.
name()) {
71 yCFatal(YRI_TYPES) <<
"Duplicate parameter \"" << param1.
name() <<
"\" found and at least one of them is not a group.";
73 param1.
value() += std::string(
" ");
75 it2 = params.erase(it2);
87 if (phase ==
"startup") {
89 }
else if (phase ==
"run") {
91 }
else if (phase ==
"interrupt1") {
93 }
else if (phase ==
"interrupt2") {
95 }
else if (phase ==
"interrupt3") {
97 }
else if (phase ==
"shutdown") {
105 switch (actionphase) {
107 return std::string(
"startup");
109 return std::string(
"run");
111 return std::string(
"interrupt1");
113 return std::string(
"interrupt2");
115 return std::string(
"interrupt3");
117 return std::string(
"shutdown");
132 if (type ==
"configure") {
134 }
else if (type ==
"calibrate") {
136 }
else if (type ==
"attach") {
138 }
else if (type ==
"abort") {
140 }
else if (type ==
"detach") {
142 }
else if (type ==
"park") {
144 }
else if (type ==
"custom") {
153 switch (actiontype) {
155 return std::string(
"configure");
157 return std::string(
"calibrate");
159 return std::string(
"attach");
161 return std::string(
"abort");
163 return std::string(
"detach");
165 return std::string(
"park");
167 return std::string(
"custom");
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
#define yCFatal(component,...)
robotinterface::ParamList mergeDuplicateGroups(const robotinterface::ParamList &list)
std::string ActionTypeToString(robotinterface::ActionType actiontype)
void operator>>(const std::stringstream &sstream, robotinterface::ActionPhase &actionphase)
bool hasParam(const robotinterface::ParamList &list, const std::string &name)
std::vector< robotinterface::Param > ParamList
std::string findGroup(const robotinterface::ParamList &list, const std::string &name)
robotinterface::ActionPhase StringToActionPhase(const std::string &phase)
robotinterface::ActionType StringToActionType(const std::string &type)
bool hasGroup(const robotinterface::ParamList &list, const std::string &name)
std::string findParam(const robotinterface::ParamList &list, const std::string &name)
std::string ActionPhaseToString(robotinterface::ActionPhase actionphase)