当前位置: 首页>>代码示例>>C++>>正文


C++ DataSet::GetType方法代码示例

本文整理汇总了C++中DataSet::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSet::GetType方法的具体用法?C++ DataSet::GetType怎么用?C++ DataSet::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSet的用法示例。


在下文中一共展示了DataSet::GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Execute

	WebResponse* GetPreviewHandler::Execute(WebRequest* pWebRequest, User* pUser)
	{
		GetPreviewRequest* pRequest = static_cast<GetPreviewRequest*>(pWebRequest);

		const char* sourceName = pRequest->GetSourceName();
		const char* dataSetName= pRequest->GetDataSetName();

		if(sourceName==NULL)
		{
			const char* msg = "Parameter [sourceName] is NULL";
			GLogger* pLogger = augeGetLoggerInstance();
			pLogger->Error(msg, __FILE__, __LINE__);
			WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
			pExpResponse->SetMessage(msg);
			return pExpResponse;
		}

		Workspace* pWorkspace = NULL;
		ConnectionManager* pConnectionManager = augeGetConnectionManagerInstance();
		pWorkspace = pConnectionManager->GetWorkspace(pUser->GetID(), sourceName);
		if( pWorkspace==NULL )
		{
			char msg[AUGE_PATH_MAX] = {0};
			g_sprintf(msg, "Cannot load datasource [%s].", sourceName);
			GLogger* pLogger = augeGetLoggerInstance();
			pLogger->Error(msg, __FILE__, __LINE__);
			WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
			pExpResponse->SetMessage(msg);
			return pExpResponse;
		}

		DataSet* pDataSet = pWorkspace->OpenDataSet(dataSetName);
		if(pDataSet==NULL)
		{
			char msg[AUGE_PATH_MAX] = {0};
			g_sprintf(msg, "Cannot load data set [%s].", dataSetName);
			GLogger* pLogger = augeGetLoggerInstance();
			pLogger->Error(msg, __FILE__, __LINE__);
			WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
			pExpResponse->SetMessage(msg);
			return pExpResponse;
		}

		WebResponse* pWebResponse = NULL;
		switch(pDataSet->GetType())
		{
		case augeDataSetFeature:
			{
				FeatureClass* pFeatureClass = static_cast<FeatureClass*>(pDataSet);
				char img_sfix[AUGE_EXT_MAX] = {0};
				char img_path[AUGE_PATH_MAX] = {0};
				auge_get_image_suffix(pRequest->GetMimeType(), img_sfix, AUGE_EXT_MAX);
				WebContext* pWebContext = augeGetWebContextInstance();
				auge_make_path(img_path, NULL, pWebContext->GetCacheMapPath(), pFeatureClass->GetUUID(), img_sfix);
				if(!g_access(img_path, 4))
				{
					GetPreviewResponse* pMapResponse = new GetPreviewResponse(pRequest);
					pMapResponse->SetPath(img_path);
					pWebResponse = pMapResponse;
				}
				else
				{
					pWebResponse = DrawFeature(pFeatureClass,pRequest);
				}
			}			
			break;
		case augeDataSetRaster:
			break;
		}

		return pWebResponse;
	}
开发者ID:marsprj,项目名称:Auge.GIS,代码行数:72,代码来源:GetPreviewHandler.cpp


注:本文中的DataSet::GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。