Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
1.3 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: DirectOutputSet.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of DirectOutputSet.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "DirectOutputSet.h"
#include "..\..\LgLib\Version.h"
CDirectOutputSet::CDirectOutputSet()
{
m_ppOutput = NULL;
m_nOutput = 0;
}
CDirectOutputSet::~CDirectOutputSet()
{
if( m_ppOutput )
{
for( int i = 0; i < m_nOutput; i++ )
delete m_ppOutput[i];
free( m_ppOutput );
}
}
BOOL CDirectOutputSet::ConnectToDevice( CDeviceDO *pDeviceDO, int nDeviceBit, int nSensorBit )
{
CDirectOutput *pDirectOutput = new CDirectOutput;
if( !pDirectOutput )
return FALSE;
m_ppOutput = (CDirectOutput**)realloc( m_ppOutput, sizeof(CDirectOutput*) * (m_nOutput + 1) );
if( !m_ppOutput )
{
m_nOutput = 0;
delete pDirectOutput;
return FALSE;
}
m_ppOutput[ m_nOutput ] = pDirectOutput;
return m_ppOutput[ m_nOutput++ ]->ConnectToDevice( pDeviceDO, nDeviceBit, nSensorBit );
}