Daniel Holth
2004-Aug-06 14:57 UTC
[icecast-dev] ultra-preliminary C++ wrapper for ogg & vorbis
Hi. I'm working on a very simple C++ wrapper for parts of libogg and libvorbis; I thought I would expose it for initial comments and the generally curious. No conveniences, no frills. No helpful higher-level abstractions. Just a translation from ogg_method_foo(ogg_method* data) to classes that hold the ogg_stream_state etc., so you may type mypage.bos() instead of ogg_page_bos(&this->data); http://dingoskidneys.com/shoutpy/oggcc.h - Daniel Holth --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Ingolf Steinbach
2004-Aug-06 14:57 UTC
[icecast-dev] Re: ultra-preliminary C++ wrapper for ogg & vorbis
Daniel, you might want to consider the RAII (resource acquisition is initialization) idiom, e.g. class stream { //... public: // 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 -- Ingolf Steinbach Jena-Optronik GmbH ingolf.steinbach@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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.