Go to the documentation of this file.
39 #ifndef CGU_GOBJ_HANDLE_H
40 #define CGU_GOBJ_HANDLE_H
45 #include <glib-object.h>
160 if (obj_p) g_object_unref(obj_p);
164 if (obj_p) g_object_ref(obj_p);
182 if (ptr && g_object_is_floating(ptr)) {
183 g_object_ref_sink(ptr);
208 if (ptr && g_object_is_floating(ptr)) {
209 g_object_ref_sink(ptr);
247 if (obj_p != gobj.obj_p) {
265 T*
get()
const {
return obj_p;}
285 operator T*()
const {
return obj_p;}
396 virtual const char*
what()
const throw() {
return "GobjWeakHandleError\n";}
413 if (ptr) g_object_add_weak_pointer((GObject*)ptr,
427 if (obj_p) g_object_remove_weak_pointer((GObject*)obj_p,
430 if (ptr) g_object_add_weak_pointer((GObject*)ptr,
444 if (obj_p) g_object_add_weak_pointer((GObject*)obj_p,
458 if (obj_p) g_object_add_weak_pointer((GObject*)obj_p,
500 operator bool()
const {
return obj_p;}
502 #ifndef DOXYGEN_PARSING
512 bool expired()
const {
return obj_p;}
586 #if defined(CGU_USE_SMART_PTR_COMPARISON) || defined(DOXYGEN_PARSING)
603 return (h1.
get() == h2.
get());
642 return std::less<T*>()(h1.
get(), h2.
get());
645 #endif // CGU_USE_SMART_PTR_COMPARISON
T & operator*() const
Definition: gobj_handle.h:549
Definition: application.h:45
This is a handle for managing the reference count of GObjects.
Definition: gobj_handle.h:155
bool operator!=(const GobjHandle< T > &h1, const GobjHandle< T > &h2)
Definition: gobj_handle.h:618
T * operator->() const
Definition: gobj_handle.h:278
T * get() const
Definition: gobj_handle.h:536
Definition: gobj_handle.h:395
void reset(T *ptr=0)
Definition: gobj_handle.h:201
bool operator<(const GobjHandle< T > &h1, const GobjHandle< T > &h2)
Definition: gobj_handle.h:641
T & operator*() const
Definition: gobj_handle.h:271
GobjWeakHandle(const GobjHandle< T > &gobj)
Definition: gobj_handle.h:456
void reset(T *ptr=0)
Definition: gobj_handle.h:425
GobjWeakHandle & operator=(const GobjHandle< T > &gobj)
Definition: gobj_handle.h:487
~GobjWeakHandle()
Definition: gobj_handle.h:582
GobjWeakHandle(const GobjWeakHandle &gobj)
Definition: gobj_handle.h:442
GobjHandle(const GobjHandle &gobj)
Definition: gobj_handle.h:218
T * get() const
Definition: gobj_handle.h:265
This is a handle for managing weak references to GObjects.
Definition: gobj_handle.h:399
bool operator==(const GobjHandle< T > &h1, const GobjHandle< T > &h2)
Definition: gobj_handle.h:602
bool valid() const
Definition: gobj_handle.h:523
GobjWeakHandle(T *ptr=0)
Definition: gobj_handle.h:411
T * operator->() const
Definition: gobj_handle.h:562
GobjHandle & operator=(const GobjHandle &gobj)
Definition: gobj_handle.h:242
GobjHandle(T *ptr=0)
Definition: gobj_handle.h:177
GobjWeakHandle & operator=(const GobjWeakHandle &gobj)
Definition: gobj_handle.h:472
virtual const char * what() const
Definition: gobj_handle.h:396
~GobjHandle()
Definition: gobj_handle.h:292