//---------------------------------------------------------------------------- // 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 ); }