⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gaugethreshold_impl.cpp

📁 270的linux说明
💻 CPP
📖 第 1 页 / 共 5 页
字号:
__int64 Int64GaugeThresholdImpl::GetOffset()          {     //return reinterpret_cast<ServerInt64GaugeThreshold*> (GetInterface())->GetOffset();	//IPC support	EnterCriticalSection(&m_csIpc);	__int64 retValue;	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("GetOffset"));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error retrieving Offset value"), m_sThresholdType.c_str(), IntelMobileText("GetOffset"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }	else	{		CStringHelper::Str2Param(vectRtn[0], retValue);	 	LeaveCriticalSection(&m_csIpc);		return retValue;	}} // GetOffset()//==============================================================================// SetOffset() : //==============================================================================bool Int64GaugeThresholdImpl::SetOffset( __int64 offset )          { 	//(reinterpret_cast<ServerInt64GaugeThreshold*>(GetInterface()))->SetOffset( offset );	//IPC support	EnterCriticalSection(&m_csIpc);	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("SetOffset"));	vectParam.push_back(CStringHelper::Param2Str(offset));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error setting Offset value"), m_sThresholdType.c_str(), IntelMobileText("SetOffset"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }			LeaveCriticalSection(&m_csIpc);    return true;} // SetOffset()//==============================================================================// GetInterface() : Returns the interface pointer, having instantiated it if needed.//==============================================================================void* Int64GaugeThresholdImpl::GetInterface(){	EnterCriticalSection(&m_csIpc);    if (m_pSvrThresholdObject == NULL)	{		//m_pSvrThresholdObject = GetNewServerThreshold(IntelMobileText("Int64GaugeThreshold"));		//IPC support		m_sName = "Int64GaugeThreshold";		m_nDataType = ID_TYPE_THRESHOLD;		vector<string> vectParam, vectRtn;			vectParam.push_back(CStringHelper::Param2Str(m_sName));		//printf("want to send %s\n",vectParam[0].c_str());				HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, /*GetSvrObj()*/NULL, vectParam, vectRtn); //now GetSvrObj() should be null		if ( FAILED( hr ) )        {            IntelMobileException ex( IntelMobileText("Error setting GetInterface value"),                                 m_sThresholdType.c_str(), IntelMobileText("GetInterface"), hr );	 		LeaveCriticalSection(&m_csIpc);            throw( ex );         }					else            CStringHelper::Str2Param(vectRtn[0], (int &)m_pSvrThresholdObject);		//printf("getted  %s\n",vectRtn[0].c_str());	}		LeaveCriticalSection(&m_csIpc);	return m_pSvrThresholdObject;} // GetInterface()// END CLASS DEFINITION GaugeThreshold//------------------------------------------------------------------------// // Class: UInt64GaugeThreshold////------------------------------------------------------------------------//==============================================================================// C-Tor() : Explicit constructor//==============================================================================UInt64GaugeThresholdImpl::UInt64GaugeThresholdImpl( Object*                 pOwner,                                                    unsigned __int64        highThreshold,                                                     unsigned __int64        lowThreshold,                                                     unsigned __int64        offset )                      : GaugeThresholdImpl( pOwner, IntelMobileText("UInt64GaugeThreshold") ){    SetHighThreshold( highThreshold );    SetLowThreshold ( lowThreshold  );    if ( offset != 0U )    {        SetOffset( offset );    }}  //==============================================================================// Accessor methods//==============================================================================// GetHighThreshold() : //==============================================================================unsigned __int64 UInt64GaugeThresholdImpl::GetHighThreshold()          {     //return reinterpret_cast<ServerUInt64GaugeThreshold*> (GetInterface())->GetHighThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned __int64 retValue;	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("GetHighThreshold"));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error retrieving HighThreshold value"), m_sThresholdType.c_str(), IntelMobileText("GetHighThreshold"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }	else	{		CStringHelper::Str2Param(vectRtn[0], retValue);	 	LeaveCriticalSection(&m_csIpc);		return retValue;	}} // GetHighThreshold()//==============================================================================// SetHighThreshold() : //==============================================================================bool UInt64GaugeThresholdImpl::SetHighThreshold( unsigned __int64 highThreshold )          {   	//(reinterpret_cast<ServerUInt64GaugeThreshold*>(GetInterface()))->SetHighThreshold( highThreshold );	//IPC support	EnterCriticalSection(&m_csIpc);	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("SetHighThreshold"));	vectParam.push_back(CStringHelper::Param2Str(highThreshold));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error setting HighThreshold value"), m_sThresholdType.c_str(), IntelMobileText("SetHighThreshold"), hr);	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }			LeaveCriticalSection(&m_csIpc);    return true;} // SetHighThreshold()//==============================================================================// GetLowThreshold() : //==============================================================================unsigned __int64 UInt64GaugeThresholdImpl::GetLowThreshold()          {     //return reinterpret_cast<ServerUInt64GaugeThreshold*> (GetInterface())->GetLowThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned __int64 retValue;	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("GetLowThreshold"));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error retrieving LowThreshold value"), m_sThresholdType.c_str(), IntelMobileText("GetLowThreshold"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }	else	{		CStringHelper::Str2Param(vectRtn[0], retValue);	 	LeaveCriticalSection(&m_csIpc);		return retValue;	}} // GetLowThreshold()//==============================================================================// SetLowThreshold() : //==============================================================================bool UInt64GaugeThresholdImpl::SetLowThreshold( unsigned __int64 lowThreshold )          {   	//(reinterpret_cast<ServerUInt64GaugeThreshold*>(GetInterface()))->SetLowThreshold( lowThreshold );	//IPC support	EnterCriticalSection(&m_csIpc);	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("SetLowThreshold"));	vectParam.push_back(CStringHelper::Param2Str(lowThreshold));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error setting LowThreshold value"), m_sThresholdType.c_str(), IntelMobileText("SetLowThreshold"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }	LeaveCriticalSection(&m_csIpc);    return true;} // SetLowThreshold()//==============================================================================// GetOffset() : //==============================================================================unsigned __int64 UInt64GaugeThresholdImpl::GetOffset()          {     //return reinterpret_cast<ServerUInt64GaugeThreshold*> (GetInterface())->GetOffset();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned __int64 retValue;	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("GetOffset"));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error retrieving Offset value"), m_sThresholdType.c_str(), IntelMobileText("GetOffset"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }	else	{		CStringHelper::Str2Param(vectRtn[0], retValue);	 	LeaveCriticalSection(&m_csIpc);		return retValue;	}} // GetOffset()//==============================================================================// SetOffset() : //==============================================================================bool UInt64GaugeThresholdImpl::SetOffset( unsigned __int64 offset )          {  	//(reinterpret_cast<ServerUInt64GaugeThreshold*>(GetInterface()))->SetOffset( offset );	//IPC support	EnterCriticalSection(&m_csIpc);	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("SetOffset"));	vectParam.push_back(CStringHelper::Param2Str(offset));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {        IntelMobileException ex( IntelMobileText("Error setting Offset value"), m_sThresholdType.c_str(), IntelMobileText("SetOffset"), hr );	 	LeaveCriticalSection(&m_csIpc);        throw( ex );     }			LeaveCriticalSection(&m_csIpc);    return true;} // SetOffset()//==============================================================================// GetInterface() : Returns the interface pointer, having instantiated it if needed.//==============================================================================void* UInt64GaugeThresholdImpl::GetInterface(){	//cout<<"good2"<<endl;    //cout << "m_pSvrThresholdObject " << m_pSvrThresholdObject << endl;	EnterCriticalSection(&m_csIpc);    if (m_pSvrThresholdObject == NULL)	{		//m_pSvrThresholdObject = GetNewServerThreshold(IntelMobileText("UInt64GaugeThreshold"));		//IPC support		m_sName = "UInt64GaugeThreshold";		m_nDataType = ID_TYPE_THRESHOLD;		vector<string> vectParam, vectRtn;			vectParam.push_back(CStringHelper::Param2Str(m_sName));		//printf("want to send %s\n",vectParam[0].c_str());				HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, /*GetSvrObj()*/NULL, vectParam, vectRtn); //now GetSvrObj() should be null		if ( FAILED( hr ) )        {            IntelMobileException ex( IntelMobileText("Error setting GetInterface value"),                                 m_sThresholdType.c_str(), IntelMobileText("GetInterface"), hr );	 		LeaveCriticalSection(&m_csIpc);            throw( ex );         }					else            CStringHelper::Str2Param(vectRtn[0], (int &)m_pSvrThresholdObject);		//printf("getted  %s\n",vectRtn[0].c_str());	}	//cout<<m_pSvrThresholdObject<<endl;		LeaveCriticalSection(&m_csIpc);	return m_pSvrThresholdObject;} // GetInterface()// END CLASS DEFINITION UInt64GaugeThreshold//------------------------------------------------------------------------// // Class: DateGaugeThresholdImpl////------------------------------------------------------------------------//==============================================================================// C-Tor() : Explicit constructor//==============================================================================DateGaugeThresholdImpl::DateGaugeThresholdImpl( Object*                 pOwner,                                                DATE                    highThreshold,                                                 DATE                    lowThreshold,                                                 DATE                    offset )                      : GaugeThresholdImpl( pOwner, IntelMobileText("DateGaugeThreshold") ){    SetHighThreshold( highThreshold );    SetLowThreshold ( lowThreshold  );    if ( offset != 0.0 )    {        SetOffset( offset );    }} //==============================================================================// Accessor methods//==============================================================================// GetHighThreshold() : //==============================================================================DATE DateGaugeThresholdImpl::GetHighThreshold()          {    //return reinterpret_cast<ServerDateGaugeThreshold*> (GetInterface())->GetHighThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	DATE retValue;	vector<string> vectParam, vectRtn;	vectParam.push_back(IntelMobileText("GetHighThreshold"));		HRESULT hr = GetIpcClient()->IpcCall(m_nDataType, GetInterface(), vectParam, vectRtn);	if ( FAILED( hr ) )    {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -