📄 linkprotocolfactory.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.
*///==============================================================================// LinkProtocolClassFactory.cpp : // Implementation of class LinkProtocolClass//==============================================================================#define DllExport // __declspec( dllexport )//#include "../stdafx.h"#include "./LinkProtocolInstanceObject.h"#include "./LinkProtocolClassObject.h"#include "./LinkProtocolFactory.h"#include "./Protocol802_3ClassObject.h"#include "./Protocol802_3InstanceObject.h"#include "./Protocol802_11ClassObject.h"#include "./Protocol802_11InstanceObject.h"#include "./ProtocolBluetoothPanClassObject.h"#include "./ProtocolBluetoothPanInstanceObject.h"#include "./ProtocolWwanClassObject.h"#include "./ProtocolWwanInstanceObject.h"#include "./ProtocolGprsClassObject.h"#include "./ProtocolGprsInstanceObject.h"#include "./ProtocolCdmaClassObject.h"#include "./ProtocolCdmaInstanceObject.h"#include "./ProtocolWimaxClassObject.h"#include "./ProtocolWimaxInstanceObject.h"using namespace Intel::Mobile::Network;static LinkProtocolFactory bf;//==============================================================================// C-Tor()//==============================================================================LinkProtocolFactory::LinkProtocolFactory(): ObjectFactory (){ Initial();} // C-Tor()//==============================================================================// D-Tor()//==============================================================================LinkProtocolFactory::~LinkProtocolFactory(){ RemoveType("LinkProtocol_Class" );
RemoveType("LinkProtocol_Instance" );
RemoveType("Protocol802_3_Class" );
RemoveType("Protocol802_3_Instance" );
RemoveType("Protocol802_11_Class" );
RemoveType("Protocol802_11_Instance" );
RemoveType("ProtocolWwan_Class" );
RemoveType("ProtocolWwan_Instance" );
RemoveType("ProtocolGprs_Class" );
RemoveType("ProtocolGprs_Instance" );
RemoveType("ProtocolCdma_Class" );
RemoveType("ProtocolCdma_Instance" );
RemoveType("ProtocolWimax_Class" );
RemoveType("ProtocolWimax_Instance" );
RemoveType("ProtocolBluetoothPan_Instance" );}//==============================================================================// Initial()//==============================================================================void LinkProtocolFactory::Initial(){ AddType("LinkProtocol_Class" );
AddType("LinkProtocol_Instance" );
AddType("Protocol802_3_Class" );
AddType("Protocol802_3_Instance" );
AddType("Protocol802_11_Class" );
AddType("Protocol802_11_Instance" );
AddType("ProtocolWwan_Class" );
AddType("ProtocolWwan_Instance" );
AddType("ProtocolGprs_Class" );
AddType("ProtocolGprs_Instance" );
AddType("ProtocolCdma_Class" );
AddType("ProtocolCdma_Instance" );
AddType("ProtocolWimax_Class" );
AddType("ProtocolWimax_Instance" );
AddType("ProtocolBluetoothPan_Instance" );} // Initial//==============================================================================// CreateObject() : //==============================================================================Intel::Mobile::Base::Object* LinkProtocolFactory::CreateObject( IntelMobileString objType, IntelMobileString type, void* pImpl ){ if ( objType.compare("InstanceObject") == 0 )
{
if ( type.compare("LinkProtocol") == 0 )
return new LinkProtocolInstance(pImpl );
else if ( type.compare("Protocol802_3") == 0 )
return new Protocol802_3Instance(pImpl );
else if ( type.compare("Protocol802_11") == 0 )
return new Protocol802_11Instance(pImpl );
else if ( type.compare("ProtocolWwan") == 0 )
return new ProtocolWwanInstance(pImpl );
else if ( type.compare("ProtocolGprs") == 0 )
return new ProtocolGprsInstance(pImpl );
else if ( type.compare("ProtocolCdma") == 0 )
return new ProtocolCdmaInstance(pImpl);
else if ( type.compare("ProtocolWimax") == 0 )
return new ProtocolWimaxInstance(pImpl);
else if ( type.compare("ProtocolBluetoothPan") == 0 )
return new ProtocolBluetoothPanInstance(pImpl);
}
else if ( objType.compare("ClassObject") == 0 )
{
if ( type.compare("LinkProtocol") == 0 )
return new LinkProtocolClass(pImpl );
else if ( type.compare("Protocol802_3") == 0 )
return new Protocol802_3Class(pImpl );
else if ( type.compare("Protocol802_11") == 0 )
return new Protocol802_11Class(pImpl );
else if ( type.compare("ProtocolWwan") == 0 )
return new ProtocolWwanClass(pImpl);
else if ( type.compare("ProtocolGprs") == 0 )
return new ProtocolGprsClass(pImpl);
else if ( type.compare("ProtocolCdma") == 0 )
return new ProtocolCdmaClass(pImpl);
else if ( type.compare("ProtocolWimax") == 0 )
return new ProtocolWimaxClass(pImpl);
else if ( type.compare("ProtocolBluetoothPan") == 0 )
return new ProtocolBluetoothPanClass(pImpl);
}
else if ( objType.compare( "Property" ) == 0 )
{
if ( type.compare( "ProtocolStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::ProtocolStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "OperatingModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::OperatingModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WlanPowerModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WlanPowerModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WlanBandEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WlanBandEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "BandEnumProperty" ) == 0 )
return new Intel::Mobile::Network::BandEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "AuthenticationModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::AuthenticationModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WlanEncryptionModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WlanEncryptionModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "AssociationStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::AssociationStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "SecurityModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::SecurityModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "QosEnumProperty" ) == 0 )
return new Intel::Mobile::Network::QosEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WwanEncryptionModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WwanEncryptionModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WwanPowerModeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WwanPowerModeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ChannelStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::ChannelStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "RoamingStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::RoamingStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ServiceIndicationEnumProperty" ) == 0 )
return new Intel::Mobile::Network::ServiceIndicationEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "CallStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::CallStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WwanBandEnumProperty" ) == 0 )
return new Intel::Mobile::Network::WwanBandEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "CallCategoryEnumProperty" ) == 0 )
return new Intel::Mobile::Network::CallCategoryEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "LinkQualityEnumProperty" ) == 0 )
return new Intel::Mobile::Network::LinkQualityEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "GprsClassEnumProperty" ) == 0 )
return new Intel::Mobile::Network::GprsClassEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "AnswerStateEnumProperty" ) == 0 )
return new Intel::Mobile::Network::AnswerStateEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ProtocolRevisionEnumProperty" ) == 0 )
return new Intel::Mobile::Network::ProtocolRevisionEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ModulationTypeEnumProperty" ) == 0 )
return new Intel::Mobile::Network::ModulationTypeEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WlanBandEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::WlanBandEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ModulationTypeEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::ModulationTypeEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "SecurityModeEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::SecurityModeEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WwanEncryptionModeEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::WwanEncryptionModeEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "WlanEncryptionModeEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::WlanEncryptionModeEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "HciVersionEnumProperty" ) == 0 )
return new Intel::Mobile::Network::HciVersionEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "LmpVersionEnumProperty" ) == 0 )
return new Intel::Mobile::Network::LmpVersionEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "MajorDeviceClassEnumProperty" ) == 0 )
return new Intel::Mobile::Network::MajorDeviceClassEnumProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
else if ( type.compare( "ServiceClassEnumArrayProperty" ) == 0 )
return new Intel::Mobile::Network::ServiceClassEnumArrayProperty(*((Intel::Mobile::Base::InstanceObject *)pImpl));
} return NULL;}//==============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -