
///////////////////////////////////////////////////////////////////////////////
//
// File   : Asura_Streaming_Jobs_FileAccess.h
// Author : Andy Tate
// Date   : 4-May-2006
//
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

// RJT NOTE: Required for GCC builds as the file list generation doesn't account for VC project exclusion from build
#ifdef ASURA_USE_STREAMING

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE

#ifndef __ASURA_STREAMING_JOBS_FILEACCESS_H__
#define __ASURA_STREAMING_JOBS_FILEACCESS_H__

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Streaming/Jobs/Asura_Streaming_Job.h"


////////////////////////////////////////////////////////////////////////////////
// Forward class declarations...
////////////////////////////////////////////////////////////////////////////////

class Asura_Chunk_File_Stream;


////////////////////////////////////////////////////////////////////////////////
// Class declaration...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_OpenAsuraFile
// Author       : Andy Tate
// Date         : 4-May-2006
//
// Description  : Streaming job which opens the specified file for reading.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_OpenAsuraFile : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_OpenAsuraFile          (const char* szFilename, Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_OpenAsuraFile"), m_szFilename(szFilename), m_pxFileStream(pxFileStream) {}
//	virtual ~Asura_Streaming_Job_OpenAsuraFile ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	const char*					m_szFilename;		// The name of the file to open.
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer created.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...
	Asura_Streaming_Job_OpenAsuraFile  (void);
	Asura_Streaming_Job_OpenAsuraFile  (const Asura_Streaming_Job_OpenAsuraFile& xOther);

	Asura_Streaming_Job_OpenAsuraFile&	operator=	(const Asura_Streaming_Job_OpenAsuraFile& xOther);

};   // End of class 'Asura_Streaming_Job_OpenAsuraFile'.



////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_OpenStreamingCachedAsuraFile
// Author       : Andy Tate
// Date         : 9-May-2006
//
// Description  : Streaming job which opens the specified file for reading.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_OpenStreamingCachedAsuraFile : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_OpenStreamingCachedAsuraFile          (const char* szFilename, Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_OpenStreamingCachedAsuraFile"), m_szFilename(szFilename), m_pxFileStream(pxFileStream) {}
//	virtual ~Asura_Streaming_Job_OpenStreamingCachedAsuraFile ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	const char*					m_szFilename;		// The name of the file to open.
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer created.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...

	Asura_Streaming_Job_OpenStreamingCachedAsuraFile  (void);
	Asura_Streaming_Job_OpenStreamingCachedAsuraFile  (const Asura_Streaming_Job_OpenStreamingCachedAsuraFile& xOther);

	Asura_Streaming_Job_OpenStreamingCachedAsuraFile&	operator=	(const Asura_Streaming_Job_OpenStreamingCachedAsuraFile& xOther);

};   // End of class 'Asura_Streaming_Job_OpenStreamingCachedAsuraFile'.



////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_ReadAsuraFileHeader
// Author       : Andy Tate
// Date         : 4-May-2006
//
// Description  : Streaming job which reads the next set of chunk-data from the
//				  specified file.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_ReadAsuraFileHeader : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_ReadAsuraFileHeader          (Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_ReadAsuraFileHeader"), m_pxFileStream(pxFileStream)	{}
//	virtual ~Asura_Streaming_Job_ReadAsuraFileHeader ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer to read from.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...
	Asura_Streaming_Job_ReadAsuraFileHeader  (void);
	Asura_Streaming_Job_ReadAsuraFileHeader  (const Asura_Streaming_Job_ReadAsuraFileHeader& xOther);

	Asura_Streaming_Job_ReadAsuraFileHeader&	operator=	(const Asura_Streaming_Job_ReadAsuraFileHeader& xOther);

};   // End of class 'Asura_Streaming_Job_ReadAsuraFileHeader'.



////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_ReadAsuraFileChunkData
// Author       : Andy Tate
// Date         : 4-May-2006
//
// Description  : Streaming job which reads the next set of chunk-data from the
//				  specified file.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_ReadAsuraFileChunkData : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_ReadAsuraFileChunkData          (Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_ReadAsuraFileChunkData"), m_pxFileStream(pxFileStream)	{}
	//	virtual ~Asura_Streaming_Job_ReadAsuraFileChunkData ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer to read from.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...
	Asura_Streaming_Job_ReadAsuraFileChunkData  (void);
	Asura_Streaming_Job_ReadAsuraFileChunkData  (const Asura_Streaming_Job_ReadAsuraFileChunkData& xOther);

	Asura_Streaming_Job_ReadAsuraFileChunkData&	operator=	(const Asura_Streaming_Job_ReadAsuraFileChunkData& xOther);

};   // End of class 'Asura_Streaming_Job_ReadAsuraFileChunkData'.



////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_CloseAsuraFile
// Author       : Andy Tate
// Date         : 4-May-2006
//
// Description  : Streaming job which closes the specified file after reading.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_CloseAsuraFile : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_CloseAsuraFile          (Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_CloseAsuraFile"), m_pxFileStream(pxFileStream) {}
//	virtual ~Asura_Streaming_Job_CloseAsuraFile ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer to close.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...
	Asura_Streaming_Job_CloseAsuraFile  (void);
	Asura_Streaming_Job_CloseAsuraFile  (const Asura_Streaming_Job_CloseAsuraFile& xOther);

	Asura_Streaming_Job_CloseAsuraFile&	operator=	(const Asura_Streaming_Job_CloseAsuraFile& xOther);

};   // End of class 'Asura_Streaming_Job_CloseAsuraFile'.



////////////////////////////////////////////////////////////////////////////////
// Class        : Asura_Streaming_Job_CloseStreamingAsuraFile
// Author       : Andy Tate
// Date         : 4-May-2006
//
// Description  : Streaming job which closes the specified file after reading.
////////////////////////////////////////////////////////////////////////////////

class Asura_Streaming_Job_CloseStreamingAsuraFile : public Asura_Streaming_Job
{
public:
	// Public functions...
	Asura_Streaming_Job_CloseStreamingAsuraFile          (Asura_Chunk_File_Stream*& pxFileStream) : Asura_Streaming_Job("Asura_Streaming_Job_CloseStreamingAsuraFile"), m_pxFileStream(pxFileStream) {}
//	virtual ~Asura_Streaming_Job_CloseStreamingAsuraFile ();

	// Manipulation functions...
//	virtual	void	BeginUpdate	(void);
	virtual	bool	Update		(float& fTimeAllowed);
//	virtual	void	EndUpdate	(void);


protected:
	// Protected variables...
	Asura_Chunk_File_Stream*&	m_pxFileStream;		// A reference to the file-stream pointer to close.


	// Protected functions...


private:
	// Private typedefs...
	typedef Asura_Streaming_Job PARENT;

	// Private variables...


	// Private functions...
	Asura_Streaming_Job_CloseStreamingAsuraFile  (void);
	Asura_Streaming_Job_CloseStreamingAsuraFile  (const Asura_Streaming_Job_CloseStreamingAsuraFile& xOther);

	Asura_Streaming_Job_CloseStreamingAsuraFile&	operator=	(const Asura_Streaming_Job_CloseStreamingAsuraFile& xOther);

};   // End of class 'Asura_Streaming_Job_CloseStreamingAsuraFile'.


#endif   // ifndef __ASURA_STREAMING_JOBS_FILEACCESS_H__

#endif	// ASURA_USE_STREAMING

/// End of file. ///
