diff options
author | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:12 +0200 |
---|---|---|
committer | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:59 +0200 |
commit | 0d5f63b18f5766760cf39e82ee11482984e0a938 (patch) | |
tree | e3f74b9b37e7618c92840024077dff43e6d08f0d /glib/glibmm/objectbase.h | |
parent | dce7a844e48a582e42eb2b60eef5c1f2527540ac (diff) | |
parent | d94115843f38967b5e883f5f7d8057882ae364cb (diff) | |
download | glibmm-0d5f63b18f5766760cf39e82ee11482984e0a938.tar.gz |
Merge branch 'master' into glibmm-gir-gmmprocglibmm-gir-gmmproc
Diffstat (limited to 'glib/glibmm/objectbase.h')
-rw-r--r-- | glib/glibmm/objectbase.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index a3afd834..44fb7adb 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -29,7 +29,7 @@ #include <sigc++/trackable.h> #include <typeinfo> #include <map> // Needed until the next ABI break. -#include <memory> // auto_ptr, needed until the next ABI break. +#include <memory> // Not used by ObjectBase any more, but user code may rely on it being here. #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GObject GObject; } @@ -57,6 +57,12 @@ class Mutex; */ class GLIBMM_API ObjectBase : virtual public sigc::trackable { +public: + + // noncopyable + ObjectBase(const ObjectBase&) = delete; + ObjectBase& operator=(const ObjectBase&) = delete; + protected: /** This default constructor is called implicitly from the constructor of user-derived * classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. @@ -70,7 +76,7 @@ protected: * The C++ language itself ensures that the constructor * is only invoked once. * - * All classes generated by gtkmmproc use this constructor, with custom_type_name = 0, + * All classes generated by gtkmmproc use this constructor, with custom_type_name = nullptr, * which essentially means it's not a custom type. This is used to optimize * vfunc and signal handler callbacks -- since the C++ virtual methods are * not overridden, invocation can be skipped. @@ -209,10 +215,10 @@ typedef std::map<const ObjectBase*, ExtraObjectBaseData> extra_object_base_data_ static extra_object_base_data_type extra_object_base_data; // ObjectBase instances may be used in different threads. // Accesses to extra_object_base_data must be thread-safe. -// auto_ptr, because we don't want to include glibmm/threads.h in objectbase.h. +// Threads::Mutex*, because we don't want to include glibmm/threads.h in objectbase.h. // threads.h must be the first included file that includes glib.h. That could cause // problems in files that directly or indirectly include objectbase.h. -static std::auto_ptr<Threads::Mutex> extra_object_base_data_mutex; +static Threads::Mutex* extra_object_base_data_mutex; public: // is_derived_() must be public, so that overridden vfuncs and signal handlers can call it via ObjectBase. @@ -224,7 +230,7 @@ public: // is_derived_() must be public, so that overridden vfuncs and signal h /// This is for use by gtkmm wrappers only, and not by applications. //inline bool is_derived_inline_() const //{ - // return (custom_type_name_ != 0); + // return (custom_type_name_ != nullptr); //} protected: @@ -235,9 +241,6 @@ protected: #endif //DOXYGEN_SHOULD_SKIP_THIS private: - // noncopyable - ObjectBase(const ObjectBase&); - ObjectBase& operator=(const ObjectBase&); #ifndef DOXYGEN_SHOULD_SKIP_THIS virtual void set_manage(); // calls g_error() |