本文整理汇总了C++中openhome::net::Parameter::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameter::Name方法的具体用法?C++ Parameter::Name怎么用?C++ Parameter::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openhome::net::Parameter
的用法示例。
在下文中一共展示了Parameter::Name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteServiceActionParams
void DviProtocolUpnpServiceXmlWriter::WriteServiceActionParams(WriterBwh& aWriter, const Action& aAction, TBool aIn)
{
const Action::VectorParameters& params = (aIn? aAction.InputParameters() : aAction.OutputParameters());
for (TUint i=0; i<params.size(); i++) {
OpenHome::Net::Parameter* param = params[i];
aWriter.Write("<argument>");
aWriter.Write("<name>");
aWriter.Write(param->Name());
aWriter.Write("</name>");
aWriter.Write("<direction>");
aWriter.Write(aIn? "in" : "out");
aWriter.Write("</direction>");
aWriter.Write("<relatedStateVariable>");
if (param->Type() == OpenHome::Net::Parameter::eTypeRelated) {
const Brx& relatedVar = static_cast<ParameterRelated*>(param)->Related().Parameter().Name();
aWriter.Write(relatedVar);
}
else {
Bwh relatedVar;
GetRelatedVariableName(relatedVar, aAction.Name(), param->Name());
aWriter.Write(relatedVar);
}
aWriter.Write("</relatedStateVariable>");
aWriter.Write("</argument>");
}
}
示例2: ValidationFailed
void Argument::ValidationFailed(const OpenHome::Net::Parameter& aParameter)
{
Log::Print("Validation of Parameter ");
Log::Print(aParameter.Name());
Log::Print(" failed, asserting\n");
ASSERTS();
}
示例3: WriteStateVariable
void DviProtocolUpnpServiceXmlWriter::WriteStateVariable(IWriter& aWriter, const OpenHome::Net::Parameter& aParam, TBool aEvented, const Action* aAction)
{
aWriter.Write(Brn("<stateVariable sendEvents="));
if (aEvented) {
aWriter.Write(Brn("\"yes\">"));
}
else {
aWriter.Write(Brn("\"no\">"));
}
aWriter.Write(Brn("<name>"));
if (aEvented) {
aWriter.Write(aParam.Name());
}
else {
Bwh name;
GetRelatedVariableName(name, aAction->Name(), aParam.Name());
aWriter.Write(name);
}
aWriter.Write(Brn("</name>"));
aWriter.Write(Brn("<dataType>"));
switch (aParam.Type())
{
case OpenHome::Net::Parameter::eTypeBool:
aWriter.Write(Brn("boolean"));
break;
case OpenHome::Net::Parameter::eTypeInt:
aWriter.Write(Brn("i4"));
break;
case OpenHome::Net::Parameter::eTypeUint:
aWriter.Write(Brn("ui4"));
break;
case OpenHome::Net::Parameter::eTypeString:
aWriter.Write(Brn("string"));
break;
case OpenHome::Net::Parameter::eTypeBinary:
aWriter.Write(Brn("bin.base64"));
break;
case OpenHome::Net::Parameter::eTypeRelated:
ASSERTS();
break;
}
aWriter.Write(Brn("</dataType>"));
switch (aParam.Type())
{
case OpenHome::Net::Parameter::eTypeBool:
case OpenHome::Net::Parameter::eTypeBinary:
break;
case OpenHome::Net::Parameter::eTypeInt:
{
const OpenHome::Net::ParameterInt& paramInt = static_cast<const OpenHome::Net::ParameterInt&>(aParam);
if (paramInt.MinValue() != ParameterInt::kValueMin ||
paramInt.MaxValue() != ParameterInt::kValueMax ||
paramInt.Step() != ParameterInt::kStep) {
aWriter.Write(Brn("<allowedValueRange>"));
aWriter.Write(Brn("<minimum>"));
WriterAscii writerAscii(aWriter);
writerAscii.WriteInt(paramInt.MinValue());
aWriter.Write(Brn("</minimum>"));
aWriter.Write(Brn("<maximum>"));
writerAscii.WriteInt(paramInt.MaxValue());
aWriter.Write(Brn("</maximum>"));
aWriter.Write(Brn("<step>"));
writerAscii.WriteInt(paramInt.Step());
aWriter.Write(Brn("</step>"));
aWriter.Write(Brn("</allowedValueRange>"));
}
}
break;
case OpenHome::Net::Parameter::eTypeUint:
{
const OpenHome::Net::ParameterUint& paramUint = static_cast<const OpenHome::Net::ParameterUint&>(aParam);
if (paramUint.MinValue() != ParameterUint::kValueMin ||
paramUint.MaxValue() != ParameterUint::kValueMax ||
paramUint.Step() != ParameterUint::kStep) {
aWriter.Write(Brn("<allowedValueRange>"));
aWriter.Write(Brn("<minimum>"));
WriterAscii writerAscii(aWriter);
writerAscii.WriteUint(paramUint.MinValue());
aWriter.Write(Brn("</minimum>"));
aWriter.Write(Brn("<maximum>"));
writerAscii.WriteUint(paramUint.MaxValue());
aWriter.Write(Brn("</maximum>"));
aWriter.Write(Brn("<step>"));
writerAscii.WriteUint(paramUint.Step());
aWriter.Write(Brn("</step>"));
aWriter.Write(Brn("</allowedValueRange>"));
}
}
break;
case OpenHome::Net::Parameter::eTypeString:
{
const OpenHome::Net::ParameterString& paramStr = static_cast<const OpenHome::Net::ParameterString&>(aParam);
const ParameterString::Map& allowedVals = paramStr.AllowedValues();
if (allowedVals.size() > 0) {
aWriter.Write(Brn("<allowedValueList>"));
ParameterString::Map::const_iterator it = allowedVals.begin();
while (it != allowedVals.end()) {
aWriter.Write(Brn("<allowedValue>"));
aWriter.Write(*(it->second));
aWriter.Write(Brn("</allowedValue>"));
//.........这里部分代码省略.........