本文整理汇总了C++中Ptr::AddSpatialData方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::AddSpatialData方法的具体用法?C++ Ptr::AddSpatialData怎么用?C++ Ptr::AddSpatialData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ptr
的用法示例。
在下文中一共展示了Ptr::AddSpatialData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSpatialContexts
MgSpatialContextReader* MgServerGetSpatialContexts::GetSpatialContexts(MgResourceIdentifier* resId)
{
Ptr<MgSpatialContextReader> mgSpatialContextReader;
MG_FEATURE_SERVICE_TRY()
mgSpatialContextReader = m_featureServiceCache->GetSpatialContextReader(resId);
if (NULL == mgSpatialContextReader.p)
{
// Connect to provider
Ptr<MgServerFeatureConnection> msfc = new MgServerFeatureConnection(resId);
// Connection must be open to retrieve a list of available contexts.
if ((NULL != msfc.p) && ( msfc->IsConnectionOpen() ))
{
// The reference to the FDO connection from the MgServerFeatureConnection object must be cleaned up before the parent object
// otherwise it leaves the FDO connection marked as still in use.
FdoPtr<FdoIConnection> fdoConn = msfc->GetConnection();
m_providerName = msfc->GetProviderName();
Ptr<MgSpatialContextCacheItem> cacheItem = MgCacheManager::GetInstance()->GetSpatialContextCacheItem(resId);
MgSpatialContextInfo* spatialContextInfo = cacheItem->Get();
// Check whether command is supported by provider
if (!msfc->SupportsCommand((INT32)FdoCommandType_GetSpatialContexts))
{
// TODO: specify which argument and message, once we have the mechanism
STRING message = MgServerFeatureUtil::GetMessage(L"MgCommandNotSupported");
throw new MgInvalidOperationException(L"MgServerGetSpatialContexts.GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
}
FdoPtr<FdoIGetSpatialContexts> fdoCommand = (FdoIGetSpatialContexts*)fdoConn->CreateCommand(FdoCommandType_GetSpatialContexts);
CHECKNULL((FdoIGetSpatialContexts*)fdoCommand, L"MgServerGetSpatialContexts.GetSpatialContexts");
// Execute the command
FdoPtr<FdoISpatialContextReader> spatialReader = fdoCommand->Execute();
CHECKNULL((FdoISpatialContextReader*)spatialReader, L"MgServerGetSpatialContexts.GetSpatialContexts");
mgSpatialContextReader = new MgSpatialContextReader();
while (spatialReader->ReadNext())
{
// Set providername for which spatial reader is executed
mgSpatialContextReader->SetProviderName(m_providerName);
Ptr<MgSpatialContextData> spatialData = GetSpatialContextData(spatialReader, spatialContextInfo);
CHECKNULL((MgSpatialContextData*)spatialData, L"MgServerGetSpatialContexts.GetSpatialContexts");
// Add spatial data to the spatialcontext reader
mgSpatialContextReader->AddSpatialData(spatialData);
}
m_featureServiceCache->SetSpatialContextReader(resId, mgSpatialContextReader.p);
}
else
{
throw new MgConnectionFailedException(L"MgServerGetSpatialContexts.GetSpatialContexts()", __LINE__, __WFILE__, NULL, L"", NULL);
}
}
else
{
MgCacheManager::GetInstance()->CheckPermission(resId, MgResourcePermission::ReadOnly);
}
MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resId, L"MgServerGetSpatialContexts.GetSpatialContexts")
return mgSpatialContextReader.Detach();
}