本文整理汇总了C++中ArgumentList::getArgument方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentList::getArgument方法的具体用法?C++ ArgumentList::getArgument怎么用?C++ ArgumentList::getArgument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentList
的用法示例。
在下文中一共展示了ArgumentList::getArgument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearOutputAgumentValues
void Action::clearOutputAgumentValues() {
ArgumentList *outArgList = getOutputArgumentList();
int nArgs = outArgList->size();
for (int n = 0; n < nArgs; n++) {
Argument *arg = outArgList->getArgument(n);
arg->setValue("");
}
}
示例2: getArgumentList
Argument *Action::getArgument(const std::string &name) {
ArgumentList *argList = getArgumentList();
int nArgs = argList->size();
for (int n = 0; n < nArgs; n++) {
Argument *arg = argList->getArgument(n);
const char *argName = arg->getName();
if (argName == NULL)
continue;
string argNameStr = argName;
if (argNameStr.compare(name) == 0)
return arg;
}
return NULL;
}
示例3: 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;
}
}
}
}