/** \file
 *
 *  Contains the LogReader class definition.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 *
 */

#ifndef LOGREADER_H_
#define LOGREADER_H_

#include "utils/FlexArray.h"

class InStream;

/// Base class for a generalized set of "log data destinations," including
/// to files (text or binary), over communications links, etc.
///
/// \ingroup logging
class LogReader
{
public:

    /// Destructor
    virtual ~LogReader();

    /// Sets the InStream
    virtual void setInStream( InStream& inStream );

    /// Return true if logStream_ is available.
    virtual bool isValid();

    /// Return the value of the logStream_ error flag.
    virtual bool hasError();

    /// Set the logStream_ error flag.
    virtual void setError( bool hasError );

    /// Read between the specified times
    virtual unsigned int read() = 0;

protected:

    /// Protected constructor for pure virtual class
    LogReader();

    /// Protected constructor for pure virtual class
    LogReader( InStream& inStream );

    /// Stores an InStream.
    InStream* logStream_;

    bool error_;

private:
    // Note that the copy constructor below is private and not given a body.
    // Any attempt to call it will return a compiler error.
    LogReader( const LogReader& old ); // disallow copy constructor

};

#endif /*LOGREADER_H_*/
