本文整理汇总了C++中ActionList::getAction方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionList::getAction方法的具体用法?C++ ActionList::getAction怎么用?C++ ActionList::getAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionList
的用法示例。
在下文中一共展示了ActionList::getAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintDeviceInfo
void PrintDeviceInfo(Device *dev, int indent)
{
string indentStr;
GetIndentString(indent, indentStr);
const char *devName = dev->getFriendlyName();
cout << indentStr << devName << endl;
int i, n, j;
ServiceList *serviceList = dev->getServiceList();
int serviceCnt = serviceList->size();
for (n=0; n<serviceCnt; n++) {
Service *service = serviceList->getService(n);
cout << indentStr << " service[" << n << "] = "<< service->getServiceType() << endl;
ActionList *actionList = service->getActionList();
int actionCnt = actionList->size();
for (i=0; i<actionCnt; i++) {
Action *action = actionList->getAction(i);
cout << indentStr << " action[" << i << "] = "<< action->getName() << endl;
ArgumentList *argList = action->getArgumentList();
int argCnt = argList->size();
for (j=0; j<argCnt; j++) {
Argument *arg = argList->getArgument(j);
cout << indentStr << " arg[" << j << "] = " << arg->getName() << "(" << arg->getDirection() << ")";
StateVariable *stateVar = arg->getRelatedStateVariable();
if (stateVar != NULL)
cout << " - " << stateVar->getName();
cout << endl;
}
}
ServiceStateTable *stateTable = service->getServiceStateTable();
int varCnt = stateTable->size();
for (i=0; i<varCnt; i++) {
StateVariable *stateVar = stateTable->getStateVariable(i);
cout << indentStr << " stateVar[" << i << "] = " << stateVar->getName() << endl;
AllowedValueList *valueList = stateVar->getAllowedValueList();
int valueListCnt = valueList->size();
if (0 < valueListCnt) {
for (j=0; j<valueListCnt; j++)
cout << indentStr << " AllowedValueList[" << j << "] = " << valueList->getAllowedValue(j) << endl;
}
AllowedValueRange *valueRange = stateVar->getAllowedValueRange();
if (valueRange != NULL) {
cout << indentStr << " AllowedRange[minimum] = " << valueRange->getMinimum() << endl;
cout << indentStr << " AllowedRange[maximum] = " << valueRange->getMaximum() << endl;
cout << indentStr << " AllowedRange[step] = " << valueRange->getStep() << endl;
}
}
}
}