本文整理汇总了C++中POVMS_Message::GetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ POVMS_Message::GetClass方法的具体用法?C++ POVMS_Message::GetClass怎么用?C++ POVMS_Message::GetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POVMS_Message
的用法示例。
在下文中一共展示了POVMS_Message::GetClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeFailedResult
void RenderBackend::MakeFailedResult(int error, POVMS_Message& result)
{
POVMS_Message newmsg(result, result.GetClass(), kPOVMsgIdent_Failed);
result = newmsg;
result.SetInt(kPOVAttrib_ErrorNumber, error);
result.SetString(kPOVAttrib_EnglishText, pov_base::Exception::lookup_code(error).c_str());
}
示例2: CreateScene
void RenderBackend::CreateScene(POVMS_Message& msg, POVMS_Message& result, int)
{
if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
return;
try
{
POVMSAddress backendAddress = POVMSInvalidAddress;
int err = POVMS_GetContextAddress(context, &backendAddress);
if(err != kNoErr)
throw POV_EXCEPTION_CODE (err);
shared_ptr<Scene> scene(new Scene(backendAddress, msg.GetSourceAddress(), scenecounter + 1));
scenecounter++;
POVMS_Message newresult(result, result.GetClass(), kPOVMsgIdent_Done);
result = newresult;
result.SetInt(kPOVAttrib_SceneId, scenecounter);
scenes[scenecounter] = scene;
try
{
scene2views[scenecounter] = ViewIdSet();
}
catch(std::exception&)
{
scenes.erase(scenecounter);
throw;
}
}
catch(pov_base::Exception& e)
{
MakeFailedResult(e, result);
}
catch(std::runtime_error& e)
{
MakeFailedResult(e.what(), result);
}
catch(std::bad_alloc&)
{
MakeFailedResult(kOutOfMemoryErr, result);
}
}
示例3: CreateView
void RenderBackend::CreateView(POVMS_Message& msg, POVMS_Message& result, int)
{
if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
return;
try
{
SceneId sid = msg.GetInt(kPOVAttrib_SceneId);
SceneMap::iterator i(scenes.find(sid));
if(i == scenes.end())
throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);
shared_ptr<View> view(i->second->NewView(msg.TryGetInt(kPOVAttrib_Width, 160), msg.TryGetInt(kPOVAttrib_Height, 120), viewcounter + 1));
viewcounter++;
POVMS_Message newresult(result, result.GetClass(), kPOVMsgIdent_Done);
result = newresult;
result.SetInt(kPOVAttrib_ViewId, viewcounter);
views[viewcounter] = view;
try { view2scene[viewcounter] = sid; } catch(std::exception&) { views.erase(viewcounter); throw; }
try { scene2views[sid].insert(viewcounter); } catch(std::exception&) { views.erase(viewcounter); view2scene.erase(viewcounter); throw; }
}
catch(pov_base::Exception& e)
{
MakeFailedResult(e, result);
}
catch(std::runtime_error& e)
{
MakeFailedResult(e.what(), result);
}
catch(std::bad_alloc&)
{
MakeFailedResult(kOutOfMemoryErr, result);
}
}
示例4: MakeDoneResult
void RenderBackend::MakeDoneResult(POVMS_Message& result)
{
POVMS_Message newmsg(result, result.GetClass(), kPOVMsgIdent_Done);
result = newmsg;
}