Re: [Nutshell-devel] Basic class information : Byte Buffer.
Status: Planning
Brought to you by:
alexandream
From: Rodrigo C. <rc...@gm...> - 2006-08-24 19:24:48
|
On 8/24/06, Alexandre Moreira <ale...@gm...> wrote: > > Keeping the batch of messages related to the class of the system. > > A ByteBuffer is a buffer used by the network pieces of our system, to > keep track of incoming data until it can safely extract a message out > of it. Here is its basic definition (somethings may vary as I already > have an implemented version of this class at home, with no access to > it right now). > > The ByteBuffer is a circular buffer, that can hold up to size bytes, wrapping around when needed, if possible. > When needed or if possible? I guess I didn`t catch up that one.... Or you wrap around when needed or not.... What you do when it need but you can`t? Exception? Data loss? This is useful to hold > received data and yet-to-send data. Heavily used by our sockets. > ByteBuffer > public: > ByteBuffer(int size); > virtual ~ByteBuffer(); > insert(const ByteArray& source, int size); > fetch(ByteArray& dest, int size); > discard(int size); > consume(ByteArray& dest, int size); // this is simply a fetch(); > discard(); > int getSize(); > int getCapacity(); > private: > char* data; > int size; > int position; > > And there goes another piece of our class strucutre... a lecture > brought to you by Yago Warner! > > Until I find out I missed something again, I'll rest.. .and work a bit > more. > > Regards, > Alexandre Moreira. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Nutshell-devel mailing list > Nut...@li... > https://lists.sourceforge.net/lists/listinfo/nutshell-devel > --=20 Abra=E7os, Rodrigo |