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

📄 protocolgprsclassobject.cpp

📁 270的linux说明
💻 CPP
字号:
/*

Copyright (c) 2008, Intel Corporation. 

All rights reserved.

 

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:


    * Redistributions of source code must retain the above copyright notice, 
this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution.

    * Neither the name of Intel Corporation nor the names of its contributors 
may be used to endorse or promote products derived from this software without 
specific prior written permission.

 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.

*///==============================================================================// Protocol802_3ClassObject.cpp : //     Implementation of class Protocol802_3Class//==============================================================================#define DllExport // __declspec( dllexport )//#include "../stdafx.h"#include "IntelMobileCPP/Base/base_Exception.h"#include "IntelMobile/Base/base_Exception.h"#include "IntelMobile/Base/base_ClassObject.h"#include "./ProtocolGprsClassObject.h"using namespace Intel::Mobile::Base;//==============================================================================// C-Tor()//==============================================================================Intel::Mobile::Network::ProtocolGprsClass::ProtocolGprsClass()		: ClassObject ( new Intel::Mobile::BaseAPI::ClassObject("ProtocolGprs", "1.1") ){ } // C-Tor()Intel::Mobile::Network::ProtocolGprsClass::ProtocolGprsClass(void *pImpl)		: ClassObject( pImpl ){}//==============================================================================// D-Tor()//==============================================================================Intel::Mobile::Network::ProtocolGprsClass::~ProtocolGprsClass(){ 	if ( m_flag )	{		if ( m_pImpl )		{			Intel::Mobile::BaseAPI::ClassObject* pAPI_Class = reinterpret_cast<Intel::Mobile::BaseAPI::ClassObject*>(m_pImpl);			if (pAPI_Class)				delete pAPI_Class;			m_pImpl = NULL;		}	}}//==============================================================================// GetInstances() : Get the collection interface and return it in a wrapper.//==============================================================================Intel::Mobile::Base::InstanceCollection* Intel::Mobile::Network::ProtocolGprsClass::GetInstances(){	return GetInstances( "" );}Intel::Mobile::Base::InstanceCollection* Intel::Mobile::Network::ProtocolGprsClass::GetInstances( StringObject sType ){	ProtocolGprsCollection *pCollection = NULL;	if ( m_pImpl )	{		Intel::Mobile::BaseAPI::ClassObject* pAPI_Class = reinterpret_cast<Intel::Mobile::BaseAPI::ClassObject*>(m_pImpl);		if (pAPI_Class)		{			TRYBLOCK {			Intel::Mobile::BaseAPI::InstanceCollection *pAPI_Collection = pAPI_Class->GetInstances( sType.GetValue() );			if (pAPI_Collection)			{				try {					pCollection = new ProtocolGprsCollection(pAPI_Collection);				}				catch(...)				{					if (pCollection)					{						delete pCollection;						pCollection = NULL;					}				}			}			else				THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstances");			} CATCHBLOCK		}		else			THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstances");	}	else 		THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstances");	return pCollection;} // GetInstances()//==============================================================================// GetInstance() : Get a specific instance interface //==============================================================================Intel::Mobile::Base::InstanceObject* Intel::Mobile::Network::ProtocolGprsClass::GetInstance( StringObject sKey ) { 	ProtocolGprsInstance *pInstance = NULL;	if ( m_pImpl )	{		Intel::Mobile::BaseAPI::ClassObject* pAPI_Class = reinterpret_cast<Intel::Mobile::BaseAPI::ClassObject*>(m_pImpl);		if (pAPI_Class)		{			TRYBLOCK {			Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = pAPI_Class->GetInstance( sKey.GetValue() );			if (pAPI_Instance)			{				try {				pInstance = new ProtocolGprsInstance(pAPI_Instance);				}				catch(...)				{					if (pInstance)					{						delete pInstance;						pInstance = NULL;					}				}			}			else				THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstance");			} CATCHBLOCK		}		else			THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstance");	}	else		THROWNE("Intel::Mobile::Network::ProtocolGprsClass", "GetInstance");	return pInstance;} // GetInstance() //==============================================================================

⌨️ 快捷键说明

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