[icecast-dev] Re: ultra-preliminary C++ wrapper for ogg & vorbis

Ingolf Steinbach Ingolf.Steinbach at jena-optronik.de
Tue Jan 20 00:13:43 PST 2004


you might want to consider the RAII (resource acquisition is
initialization) idiom, e.g.

class stream {

        // instead of init():
        stream(int serialno) {ogg_stream_init(&this->data, serialno);}
        // instead of init():
        ~stream() {ogg_stream_destroy(&this->data);}

        // other member functions

Also, you should make the data members private.
(Except maybe e.g. for class packet, which is rather a struct
than a class and therefore probably should be "struct packet"
to clarify this.)

Kind regards



Ingolf Steinbach                       Jena-Optronik GmbH
ingolf.steinbach at jena-optronik.de       ++49 3641 200-147
PGP: 0x7B3B5661  213C 828E 0C92 16B5  05D0 4D5B A324 EC04

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Icecast-dev mailing list