[vlc-devel] commit: New C++ binding for libvlc. ( Rémi Duraffort )
beauze.h at gmail.com
Mon Jan 25 15:25:41 CET 2010
On Sat, Jan 23, 2010 at 3:05 PM, git version control <git at videolan.org> wrote:
> vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jan 22 14:56:46 2010 +0100| [10a63bb57f49c6f63151bf960b5322fe38df69e4] | committer: Rémi Duraffort
> New C++ binding for libvlc.
> bindings/libvlcpp/.gitignore | 4 +
> bindings/libvlcpp/Doxyfile.in | 1300 ++++++++++++++++++++++++++++++++
> bindings/libvlcpp/Makefile.am | 8 +
> bindings/libvlcpp/autogen.sh | 37 +
> bindings/libvlcpp/configure.ac | 28 +
> bindings/libvlcpp/src/Makefile.am | 16 +
> bindings/libvlcpp/src/exception.cpp | 38 +
> bindings/libvlcpp/src/exception.hpp | 50 ++
> bindings/libvlcpp/src/libvlc.cpp | 58 ++
> bindings/libvlcpp/src/libvlc.hpp | 86 +++
> bindings/libvlcpp/src/media.cpp | 104 +++
> bindings/libvlcpp/src/media.hpp | 155 ++++
> bindings/libvlcpp/src/media_player.cpp | 173 +++++
> bindings/libvlcpp/src/media_player.hpp | 202 +++++
> 14 files changed, 2259 insertions(+), 0 deletions(-)
> Diff: http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=10a63bb57f49c6f63151bf960b5322fe38df69e4
Why having a private getter for the instance ? If this getter is
called, then the caller also has access to the private instance.
If you are really sure you want to use c++'s exception, I'd recommend
you inherit std::exception.
I like the use of the raii pattern for the exception :) that's pretty sexy :)
To avoid having a type* instance(); method and a type* m_instance
member in every class that binds a libvlc type, i'd recommand you to
use a template parent class such as this one :
The cast operator may be a bit much, though it's quite handy as it
prevents you to have to call instance() in most cases.
The last remark kinda break the thread chronology, but please, no,
don't use overload to differenciate getters and setters. The "let's
use c++ features" argument is void, otherwise let's overload "operator
,". I'm sure it can be used somehow.
More information about the vlc-devel