本文整理汇总了C++中POVMS_Message::GetSourceAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ POVMS_Message::GetSourceAddress方法的具体用法?C++ POVMS_Message::GetSourceAddress怎么用?C++ POVMS_Message::GetSourceAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POVMS_Message
的用法示例。
在下文中一共展示了POVMS_Message::GetSourceAddress方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadFile
void RenderBackend::ReadFile(POVMS_Message& msg, POVMS_Message& result, int)
{
if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
return;
MakeFailedResult(kCannotHandleRequestErr, result);
}
示例2: CloseView
void RenderBackend::CloseView(POVMS_Message& msg, POVMS_Message& result, int)
{
if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
return;
try
{
ViewId vid = msg.GetInt(kPOVAttrib_ViewId);
ViewMap::iterator i(views.find(vid));
if(i == views.end())
throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);
try { views.erase(vid); } catch(pov_base::Exception&) { }
try { scene2views[view2scene[vid]].erase(vid); } catch(pov_base::Exception&) { }
try { view2scene.erase(vid); } catch(pov_base::Exception&) { }
MakeDoneResult(result);
}
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: ResumeRender
void RenderBackend::ResumeRender(POVMS_Message& msg, POVMS_Message& result, int)
{
if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
return;
try
{
ViewId vid = msg.GetInt(kPOVAttrib_ViewId);
ViewMap::iterator i(views.find(vid));
if(i == views.end())
throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);
if((i->second->IsRendering() == false) && (i->second->IsPaused() == false))
throw POV_EXCEPTION_CODE(kNotNowErr);
i->second->ResumeRender();
MakeDoneResult(result);
}
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: CloseScene
void RenderBackend::CloseScene(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);
if(scene2views[sid].size() > 0)
throw POV_EXCEPTION_CODE(kNotNowErr);
try { scenes.erase(sid); } catch(pov_base::Exception&) { }
try { scene2views.erase(sid); } catch(pov_base::Exception&) { }
MakeDoneResult(result);
}
catch(pov_base::Exception& e)
{
MakeFailedResult(e, result);
}
catch(std::runtime_error& e)
{
MakeFailedResult(e.what(), result);
}
catch(std::bad_alloc&)
{
MakeFailedResult(kOutOfMemoryErr, result);
}
}
示例5: 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);
}
}
示例6: StartRender
void RenderBackend::StartRender(POVMS_Message& msg, POVMS_Message&, int)
{
try
{
ViewId vid = msg.GetInt(kPOVAttrib_ViewId);
try
{
if(validateFrontendAddress(msg.GetSourceAddress()) == false)
throw POV_EXCEPTION_CODE(kAuthorisationErr);
ViewMap::iterator i(views.find(vid));
if(i == views.end())
throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);
if(i->second->IsRendering() == true)
throw POV_EXCEPTION_CODE(kNotNowErr);
i->second->StartRender(msg);
}
catch(pov_base::Exception& e)
{
SendViewFailedResult(vid, e, msg.GetSourceAddress());
}
}
catch(pov_base::Exception& e)
{
SendFailedResult(e, msg.GetSourceAddress());
}
catch(std::runtime_error& e)
{
SendFailedResult(e.what(), msg.GetSourceAddress());
}
catch(std::bad_alloc&)
{
SendFailedResult(kOutOfMemoryErr, msg.GetSourceAddress());
}
}
示例7: StartParser
void RenderBackend::StartParser(POVMS_Message& msg, POVMS_Message&, int)
{
try
{
SceneId sid = msg.GetInt(kPOVAttrib_SceneId);
try
{
if(validateFrontendAddress(msg.GetSourceAddress()) == false)
throw POV_EXCEPTION_CODE(kAuthorisationErr);
SceneMap::iterator i(scenes.find(sid));
if(i == scenes.end())
throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);
i->second->StartParser(msg);
}
catch(pov_base::Exception& e)
{
SendSceneFailedResult(sid, e, msg.GetSourceAddress());
}
}
catch(pov_base::Exception& e)
{
SendFailedResult(e, msg.GetSourceAddress());
}
catch(std::runtime_error& e)
{
SendFailedResult(e.what(), msg.GetSourceAddress());
}
catch(std::bad_alloc&)
{
SendFailedResult(kOutOfMemoryErr, msg.GetSourceAddress());
}
}
示例8: 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);
}
}