// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

// PURPOSE: An abstract class used as a callback for stream state changes.

#ifndef BD_STREAM_LISTENER_H
#define BD_STREAM_LISTENER_H

#include <bdCore/bdCore.h>

#include <bdNet/bdStream/bdStreamTypes.h>
#include <bdNet/bdStream/bdStreamId.h>

BD_REFERENCE(bdConnection);
BD_REFERENCE(bdInStream);
BD_REFERENCE(bdOutStream);

/// Abstract class used as a callback for stream state changes.
class bdStreamListener
{
	public:

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

		/// Constructor
		bdStreamListener();

		/// Virtual destructor
		virtual ~bdStreamListener();

		virtual void onOutStreamClose(bdOutStreamRef stream);

		virtual bdInStreamRef onNewInStream(const bdStreamType type,
											const bdStreamId& id,
											const bdConnectionRef connection) = 0;

		virtual void onInStreamFinished(bdInStreamRef stream);

		virtual void onInStreamClose(bdInStreamRef stream);
};

#endif // BD_STREAM_LISTENER_H
