- Main Page
- Modules
- Namespaces
- Classes
- Files

# miniobject.h

Go to the documentation of this file.

    00001 /* gstreamermm - a C++ wrapper for gstreamer
    00002  *
    00003  * Copyright 2008 The gstreamermm Development Team
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Lesser General Public
    00007  * License as published by the Free Software Foundation; either
    00008  * version 2.1 of the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Lesser General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Lesser General Public
    00016  * License along with this library; if not, write to the Free
    00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018  */
    00019
    00020 #ifndef _GSTREAMERMM_MINIOBJECT_H
    00021 #define _GSTREAMERMM_MINIOBJECT_H
    00022
    00023 #include <glibmm/objectbase.h>
    00024 #include <gst/gstminiobject.h>
    00025
    00026 namespace Gst
    00027 {
    00028
    00029 class MiniObject_Class;
    00030
    00034 class MiniObject : public Glib::ObjectBase
    00035 {
    00036 public:
    00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00038   typedef MiniObject       CppObjectType;
    00039   typedef MiniObject_Class CppClassType;
    00040   typedef GstMiniObject      BaseObjectType;
    00041   typedef GstMiniObjectClass BaseClassType;
    00042 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00043
    00044 //protected:
    00045 public:
    00046   //friend Glib::wrap;
    00047
    00048   MiniObject();
    00049   MiniObject(GstMiniObject* castitem, bool take_copy = false);
    00050
    00051 public:
    00052   virtual ~MiniObject();
    00053
    00054   //Note that we don't add a constructor for gst_mini_object_new()
    00055   //because it's just an equivalent for g_object_new(),
    00056   //which is just an equivalent for C++'s new().
    00057
    00058 //protected:
    00059   // noncopyable
    00065   MiniObject(const MiniObject&);
    00066
    00072   MiniObject& operator=(const MiniObject&);
    00073
    00074 public:
    00078   guint get_flags() const;
    00079
    00084   bool flag_is_set(guint flag) const;
    00085
    00089   void set_flag(guint flag);
    00090
    00094   void unset_flag(guint flag);
    00095
    00108   Glib::RefPtr<Gst::MiniObject> copy() const;
    00109
    00119   bool is_writable() const;
    00120
    00129   Glib::RefPtr<Gst::MiniObject> create_writable();
    00130
    00131   void reference() const;
    00132   void unreference() const;
    00133
    00135   GstMiniObject*       gobj()       { return reinterpret_cast<GstMiniObject*>(gobject_); }
    00136
    00138   const GstMiniObject* gobj() const { return reinterpret_cast<GstMiniObject*>(gobject_); }
    00139
    00140
    00141   // static void replace(Glib::RefPtr<Gst::MiniObject> & olddata, Glib::RefPtr<Gst::MiniObject> & newdata);
    00142
    00143 protected:
    00144   void swap(MiniObject& other);
    00145
    00146 protected:
    00147   GstMiniObject* gobject_; //TODO: Doesn't this shadow a member variable in Glib::ObjectBase?
    00148 };
    00149
    00150 } // namespace Gst
    00151
    00152 /*
    00153 namespace Glib
    00154 {
    00155   inline Glib::RefPtr<Gst::MiniObject> wrap(GstMiniObject *object, bool take_copy)
    00156   {
    00157     return Glib::RefPtr<Gst::MiniObject>(new MiniObject(object, take_copy));
    00158   }
    00159
    00160 } //namespace Glib
    00161 */
    00162
    00163 #endif //#ifndef _GSTREAMERMM_MINIOBJECT_H