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


C++ CConnect::getAsObjRef方法代码示例

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


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

示例1: MAP_AS_ERRORS

extern "C" CEE_status
odbcas_ASSvc_GetObjRefHdl_(
    /* In    */ const CEE_handle_def *ph_
  , /* In    */ CEE_tag_def tag_
  , /* In    */ const CONNECTION_CONTEXT_def *inContext
  , /* In    */ const USER_DESC_def *userDesc
  , /* In    */ IDL_long srvrType
  , /* In    */ IDL_short retryCount
  , /* Out   */ odbcas_ASSvc_GetObjRefHdl_exc_ *exception_
  , /* Out   */	char 				*srvrObjRef
  , /* Out   */ DIALOGUE_ID_def 	*dialogueId
  , /* Out   */ char 				*dataSource
  , /* Out   */ USER_SID_def 		*userSid
  , /* Out   */ VERSION_LIST_def 	*versionList
  , /* Out   */ IDL_long		 	*isoMapping
  , /* Out   */ IDL_long		 	*srvrNodeId
  , /* Out   */ IDL_long		 	*srvrProcessId
  , /* Out   */ IDL_long_long	 	*timestamp
  )
{
	CEE_status retcode;
	bool sts;
	IDL_long wlength,rlength;
	IDL_char* wbuffer, *rbuffer;
	IDL_char* curptr;

	IDL_long msg_total_length = 0;
	IDL_long exceptionLength = 0;
	IDL_long datasourceLength = 0;
	IDL_long srvrObjRefLength = 0;
	IDL_long userSidLength = 0;
	IDL_long clusternameLength = 0;

	VERSION_def version[4];
	VERSION_def* versionPtr = &version[0];

	char srvrHostName[100] = {0};
	IDL_long srvrHostNameLength = 0;
	char srvrProcessName[100] = {0};
	IDL_long srvrProcessNameLength = 0;
	char srvrIpAddress[100] = {0};
	IDL_long srvrIpAddressLength = 0;
	IDL_long srvrPort = 0;
	
	SRVR_CALL_CONTEXT *srvrCallContext = (SRVR_CALL_CONTEXT *)tag_;
	CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;

	pConnection->m_asTCPIPSystem->odbcAPI = AS_API_GETOBJREF;
	pConnection->m_asTCPIPSystem->dialogueId = srvrCallContext->dialogueId;
	pConnection->m_asTCPIPSystem->dwTimeout = srvrCallContext->u.connectParams.loginTimeout;

//
// do marshaling of input parameters
//
	retcode = odbcas_ASSvc_GetObjRefHdl_param_pst_(
		  pConnection->m_asTCPIPSystem
		, wbuffer
		, wlength
		, inContext
		, userDesc
		, srvrType
		, retryCount);

	if (retcode != CEE_SUCCESS)
		return retcode;

	sts = OpenIO (pConnection->m_asTCPIPSystem,pConnection->getAsObjRef());
	if (sts == false)
		return MAP_AS_ERRORS((long)pConnection->m_asTCPIPSystem);

	sts = DoIO (pConnection->m_asTCPIPSystem, wbuffer, wlength, rbuffer, rlength,pConnection);
 	if (sts == false)
		return MAP_AS_ERRORS((long)pConnection->m_asTCPIPSystem);

	CloseIO (pConnection->m_asTCPIPSystem);

//
// process output parameters
//
	char swap = pConnection->m_asTCPIPSystem->swap();

	curptr = rbuffer;
	//
	// copy odbcas_ASSvc_GetObjRefHdl_exc_ *exception_
	//

	exception_->exception_nr = *(IDL_long *)(curptr + msg_total_length);
	msg_total_length += sizeof(exception_->exception_nr);
	LONG_swap(&exception_->exception_nr,swap);

	exception_->exception_detail = *(IDL_long *)(curptr + msg_total_length);
	msg_total_length += sizeof(exception_->exception_detail);
	LONG_swap(&exception_->exception_detail,swap);

	exceptionLength = *(IDL_long *)(curptr + msg_total_length);
	msg_total_length += sizeof(exceptionLength);
	LONG_swap(&exceptionLength,swap);

    if(exceptionLength > 0)
	{
//.........这里部分代码省略.........
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:101,代码来源:odbcas_drvr.cpp

示例2: OpenIO

/*
 * Synchronous object call for
 * operation 'odbcas_ASSvc_StopSrvr'
 */
extern "C" void
odbcas_ASSvc_StopSrvr(
    /* In    */ const CEE_handle_def *ph_
  , /* Out   */ struct odbcas_ASSvc_StopSrvr_exc_ *exception_
  , /* In    */ DIALOGUE_ID_def dialogueId
  , /* In    */ IDL_long srvrType
  , /* In    */ const IDL_char *srvrObjRef
  , /* In    */ IDL_long StopType
  )
{
	CEE_status retcode;
	bool sts;
	IDL_char *curptr;
	IDL_long  msg_total_len = 0;
	IDL_long  wlength,  rlength;
	IDL_char *wbuffer, *rbuffer;

	SRVR_CALL_CONTEXT *srvrCallContext = (SRVR_CALL_CONTEXT *)ph_;
	CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;

	pConnection->m_asTCPIPSystem->odbcAPI = AS_API_STOPSRVR;
	pConnection->m_asTCPIPSystem->dialogueId = srvrCallContext->dialogueId;
	pConnection->m_asTCPIPSystem->dwTimeout = srvrCallContext->u.connectParams.loginTimeout;
//
// do marshaling of input parameters
//
	retcode = odbcas_ASSvc_StopSrvr_param_pst_(
		  pConnection->m_asTCPIPSystem
		, wbuffer
		, wlength
		, dialogueId
		, srvrType
		, srvrObjRef
		, StopType);

	if (retcode != CEE_SUCCESS)
		return;

	sts = OpenIO (pConnection->m_asTCPIPSystem,pConnection->getAsObjRef());
	if (sts == false)
		return;

	sts = DoIO (pConnection->m_asTCPIPSystem, wbuffer, wlength, rbuffer, rlength,pConnection);
	if (sts == false)
		return;

	CloseIO (pConnection->m_asTCPIPSystem);


//
// process output parameters
//

	char swap = pConnection->m_asTCPIPSystem->swap();

    msg_total_len = 0;
	curptr = rbuffer;

//
//  exception_
//

	IDL_long ExceptionLength;

//
//   exception_ ->exception_nr
//
	exception_->exception_nr = *(IDL_long*)(curptr+msg_total_len);
	msg_total_len += sizeof(exception_->exception_nr);
	LONG_swap(&exception_->exception_nr,swap);

//
//   exception_ ->exception_detail
//
	exception_->exception_detail = *(IDL_long*)(curptr+msg_total_len);
	msg_total_len += sizeof(exception_->exception_detail);
	LONG_swap(&exception_->exception_detail,swap);

    ExceptionLength = *(IDL_long*)(curptr+msg_total_len);
    msg_total_len += sizeof(ExceptionLength);
	LONG_swap(&ExceptionLength,swap);

	if(ExceptionLength > 0)
	{
	   exception_->u.ASParamError.ErrorText = (IDL_char*)(curptr+msg_total_len);
	   msg_total_len += ExceptionLength;
	}
  
	return;
}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:94,代码来源:odbcas_drvr.cpp


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