87 lines
2.3 KiB
C++
87 lines
2.3 KiB
C++
|
/*-------------------------------------------------------------------
|
||
|
VCSignalProtocolAddOn.h
|
||
|
-------------------------------------------------------------------
|
||
|
|
||
|
(c) Vector Informatik GmbH. All rights reserved.
|
||
|
|
||
|
------------------------------------------------------------------- */
|
||
|
|
||
|
#include "StdAfx.h"
|
||
|
#include "VCSignalProtocolAddOn.h"
|
||
|
#include "VCSignalProtocol.h"
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
//
|
||
|
// Implementaiton of VCSignalProtocolAddOn
|
||
|
//
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
VCSignalProtocolAddOn *VCSignalProtocolAddOn::sInstance = NULL;
|
||
|
|
||
|
//----------------------------------------------------------------------
|
||
|
//!
|
||
|
/**
|
||
|
*/
|
||
|
VCSignalProtocolAddOn::VCSignalProtocolAddOn()
|
||
|
{
|
||
|
sInstance = this;
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------
|
||
|
//!
|
||
|
/**
|
||
|
*/
|
||
|
VCSignalProtocolAddOn& VCSignalProtocolAddOn::Instance()
|
||
|
{
|
||
|
if (sInstance == 0) throw;
|
||
|
|
||
|
return *sInstance;
|
||
|
}
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
// IProtocolAddOn
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
//----------------------------------------------------------------------
|
||
|
//!
|
||
|
/**
|
||
|
*/
|
||
|
VDEF VCSignalProtocolAddOn::CreateProtocol( const char /*in*/ *protocolSymbol, NIPB::IProtocol /*out*/ **protocol )
|
||
|
{
|
||
|
if (protocol == 0) return NIPB::kInvalidArg;
|
||
|
if (protocolSymbol == 0) return NIPB::kInvalidArg;
|
||
|
|
||
|
*protocol = new VCSignalProtocol();
|
||
|
|
||
|
return NIPB::kOK;
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------
|
||
|
//!
|
||
|
/**
|
||
|
*/
|
||
|
VDEF VCSignalProtocolAddOn::ReleaseProtocol( NIPB::IProtocol /*in*/ *protocol)
|
||
|
{
|
||
|
VCSignalProtocol *prot = dynamic_cast<VCSignalProtocol*>( protocol );
|
||
|
delete prot;
|
||
|
|
||
|
return NIPB::kOK;
|
||
|
}
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
// Public Methods
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
//----------------------------------------------------------------------
|
||
|
//!
|
||
|
/**
|
||
|
*/
|
||
|
void VCSignalProtocolAddOn::Release()
|
||
|
{
|
||
|
delete this;
|
||
|
}
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
////////////////////////////////////////////////////////////////////////
|
||
|
|