#ifndef NETWORKLIB_PACKETS_BUFFER_H
#define NETWORKLIB_PACKETS_BUFFER_H

class PacketsBuffer : public NetworkObject {
public:
	PacketsBuffer( int capacity = 10 );
	virtual ~PacketsBuffer();

	void Clear();

	void Resize( int new_capacity );

	bool Push( Packet * packet ); // return false if full
	Packet * Pop(); // 0 if empty

	int GetCapacity() const { return capacity; }
	int GetLoad() const;

private:
	typedef Packet * PacketPointer;

	int capacity;
	PacketPointer * packets;
};

#endif // NETWORKLIB_PACKETS_BUFFER_H