本文整理汇总了C++中MHUnion::GetValueFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ MHUnion::GetValueFrom方法的具体用法?C++ MHUnion::GetValueFrom怎么用?C++ MHUnion::GetValueFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MHUnion
的用法示例。
在下文中一共展示了MHUnion::GetValueFrom方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetString
// Extract a string value.
static void GetString(MHParameter *parm, MHOctetString &str, MHEngine *engine)
{
MHUnion un;
un.GetValueFrom(*parm, engine);
un.CheckType(MHUnion::U_String);
str.Copy(un.m_StrVal);
}
示例2: GetBool
// Return a bool value. May throw an exception if it isn't the correct type.
static bool GetBool(MHParameter *parm, MHEngine *engine)
{
MHUnion un;
un.GetValueFrom(*parm, engine);
un.CheckType(MHUnion::U_Bool);
return un.m_fBoolVal;
}
示例3: GetInt
// Return an integer value. May throw an exception if it isn't the correct type.
static int GetInt(MHParameter *parm, MHEngine *engine)
{
MHUnion un;
un.GetValueFrom(*parm, engine);
un.CheckType(MHUnion::U_Int);
return un.m_nIntVal;
}
示例4: Perform
void MHTestVariable::Perform(MHEngine *engine)
{
MHObjectRef target;
m_Target.GetValue(target, engine); // Get the target
MHUnion testValue;
testValue.GetValueFrom(m_Comparison, engine); // Get the actual value to compare.
engine->FindObject(target)->TestVariable(m_nOperator, testValue, engine); // Do the test.
}
示例5: Perform
void MHSendEvent::Perform(MHEngine *engine)
{
// The target is always the current scene so we ignore it here.
MHObjectRef target, source;
m_Target.GetValue(target, engine); // TODO: Check this is the scene?
m_EventSource.GetValue(source, engine);
// Generate the event.
if (m_EventData.m_Type == MHParameter::P_Null)
engine->EventTriggered(engine->FindObject(source), m_EventType);
else {
MHUnion data;
data.GetValueFrom(m_EventData, engine);
engine->EventTriggered(engine->FindObject(source), m_EventType, data);
}
}
示例6: CallProgram
//.........这里部分代码省略.........
// Look the information up in the database.
bool res = engine->GetContext()->GetServiceInfo(channelId, netId, origNetId,
transportId, serviceId);
if (res)
{
engine->FindObject(*(args.GetAt(1)->GetReference()))->SetVariableValue(netId);
engine->FindObject(*(args.GetAt(2)->GetReference()))->SetVariableValue(origNetId);
engine->FindObject(*(args.GetAt(3)->GetReference()))->SetVariableValue(transportId);
engine->FindObject(*(args.GetAt(4)->GetReference()))->SetVariableValue(serviceId);
}
SetSuccessFlag(success, res, engine);
}
else
{
SetSuccessFlag(success, false, engine);
}
}
else if (m_Name.Equal("GBI")) // GetBootInfo
{
// Gets the NB_info field.
MHERROR("GetBootInfo ResidentProgram is not implemented");
}
else if (m_Name.Equal("CCR")) // CheckContentRef
{
// Sees if an item with a particular content reference is available
// in the carousel. This looks like it should block until the file
// is available. The profile recommends that this should be forked
// rather than called.
if (args.Size() == 3)
{
MHUnion un;
un.GetValueFrom(*(args.GetAt(0)), engine);
un.CheckType(MHUnion::U_ContentRef);
MHContentRef fileName;
fileName.Copy(un.m_ContentRefVal);
QString csPath = engine->GetPathName(fileName.m_ContentRef);
bool result = false;
QByteArray text;
// Try to load the object.
if (! csPath.isEmpty())
{
result = engine->GetContext()->GetCarouselData(csPath, text);
}
// Set the result variable.
MHParameter *pResFlag = args.GetAt(1);
engine->FindObject(*(pResFlag->GetReference()))->SetVariableValue(result);
MHParameter *pResCR = args.GetAt(2);
// Copy the file name to the resulting content ref.
engine->FindObject(*(pResCR->GetReference()))->SetVariableValue(fileName);
SetSuccessFlag(success, true, engine);
}
else
{
SetSuccessFlag(success, false, engine);
}
}
else if (m_Name.Equal("CGR")) // CheckGroupIDRef
{
// Sees if an application or scene with a particular group id
// is available in the carousel.
MHERROR("CheckGroupIDRef ResidentProgram is not implemented");
}