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

📄 gaugethreshold_impl.cpp

📁 270的linux说明
💻 CPP
📖 第 1 页 / 共 5 页
字号:
//==============================================================================// C-Tor() : Explicit constructor//==============================================================================UIntGaugeThresholdImpl::UIntGaugeThresholdImpl( Object*                 pOwner,                                                unsigned int            highThreshold,                                                 unsigned int            lowThreshold,                                                 unsigned int            offset )                      : GaugeThresholdImpl( pOwner, IntelMobileText("UIntGaugeThreshold") ){    SetHighThreshold( highThreshold );    SetLowThreshold ( lowThreshold  );    if ( offset != 0U )    {        SetOffset( offset );    }}//==============================================================================// Accessor methods//==============================================================================// GetHighThreshold() : //==============================================================================unsigned int UIntGaugeThresholdImpl::GetHighThreshold()          {     //return reinterpret_cast<ServerUIntGaugeThreshold*> (GetInterface())->GetHighThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned int 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 UIntGaugeThresholdImpl::SetHighThreshold( unsigned int highThreshold )          {   	//(reinterpret_cast<ServerUIntGaugeThreshold*>(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 int UIntGaugeThresholdImpl::GetLowThreshold()          {     //return reinterpret_cast<ServerUIntGaugeThreshold*> (GetInterface())->GetLowThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned int 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 UIntGaugeThresholdImpl::SetLowThreshold( unsigned int lowThreshold )          { 	//(reinterpret_cast<ServerUIntGaugeThreshold*>(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 int UIntGaugeThresholdImpl::GetOffset()          {     //return reinterpret_cast<ServerUIntGaugeThreshold*> (GetInterface())->GetOffset();	//IPC support	EnterCriticalSection(&m_csIpc);	unsigned int 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 UIntGaugeThresholdImpl::SetOffset( unsigned int offset )          { 	//(reinterpret_cast<ServerUIntGaugeThreshold*>(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* UIntGaugeThresholdImpl::GetInterface(){	EnterCriticalSection(&m_csIpc);    if (m_pSvrThresholdObject == NULL)	{		//m_pSvrThresholdObject = GetNewServerThreshold(IntelMobileText("UIntGaugeThreshold"));		//IPC support		m_sName = "UIntGaugeThreshold";		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: Int64GaugeThreshold////------------------------------------------------------------------------//==============================================================================// C-Tor() : Explicit constructor//==============================================================================Int64GaugeThresholdImpl::Int64GaugeThresholdImpl( Object*                 pOwner,                                                  __int64                 highThreshold,                                                   __int64                 lowThreshold,                                                   __int64                 offset )                      : GaugeThresholdImpl( pOwner, IntelMobileText("Int64GaugeThreshold") ){    SetHighThreshold( highThreshold );    SetLowThreshold ( lowThreshold  );    if ( offset != 0L )    {        SetOffset( offset );    }} //==============================================================================// Accessor methods//==============================================================================// GetHighThreshold() : //==============================================================================__int64 Int64GaugeThresholdImpl::GetHighThreshold()          {    //return reinterpret_cast<ServerInt64GaugeThreshold*> (GetInterface())->GetHighThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	__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 Int64GaugeThresholdImpl::SetHighThreshold( __int64 highThreshold )          { 	//(reinterpret_cast<ServerInt64GaugeThreshold*>(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() : //==============================================================================__int64 Int64GaugeThresholdImpl::GetLowThreshold()          {     //return reinterpret_cast<ServerInt64GaugeThreshold*> (GetInterface())->GetLowThreshold();	//IPC support	EnterCriticalSection(&m_csIpc);	__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 Int64GaugeThresholdImpl::SetLowThreshold( __int64 lowThreshold )          {  	//(reinterpret_cast<ServerInt64GaugeThreshold*>(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() : //==============================================================================

⌨️ 快捷键说明

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