#if !defined( _IOAHC595_H )
#define _IOAHC595_H

#include "Device.h"

class IoAHC595 : public IoADevice
{
public:
    IoAHC595( int Index = 0 ) : IoADevice( "HC595", Index ), m_Register( 0x00 ) { }

//    ~IoAHC595( ) { Close( ); }  // not required if IoAHC595::Close( ) is not defined

    void Detach( ) { Close( ); IoADevice::Detach( ); }  // have to override IoADevice::Detach( )

    // Open + close
    int Open( int = 0 );  // have to override IoADevice::Open( )

//    void Close( int = 0 ) { IoADevice::Close( ) }  // no need to override IoADevice::Close( )

    int Synchronize( int Value );

    int Value( ) const { return m_Register; }

private:
    int Write( int Value ) const;

    int m_Register;
};

#endif
