Go to the documentation of this file.
39 #ifndef CGU_GVAR_HANDLE_H
40 #define CGU_GVAR_HANDLE_H
47 #if defined(DOXYGEN_PARSING) || GLIB_CHECK_VERSION(2,24,0)
164 void unreference() noexcept {
165 if (obj_p) g_variant_unref(obj_p);
168 void reference() noexcept {
169 if (obj_p) g_variant_ref(obj_p);
188 if (ptr && g_variant_is_floating(ptr)) {
189 g_variant_ref_sink(ptr);
205 void reset(GVariant* ptr = 0) noexcept {
212 if (ptr && g_variant_is_floating(ptr)) {
213 g_variant_ref_sink(ptr);
249 if (obj_p != gvar.obj_p) {
290 GVariant*
get() const noexcept {
return obj_p;}
297 operator GVariant*()
const noexcept {
return obj_p;}
307 #if defined(CGU_USE_SMART_PTR_COMPARISON) || defined(DOXYGEN_PARSING)
320 return (h1.get() == h2.get());
350 return std::less<GVariant*>()(h1.
get(), h2.
get());
353 #endif // CGU_USE_SMART_PTR_COMPARISON
360 #if defined(CGU_USE_SMART_PTR_COMPARISON) && !defined(DOXYGEN_PARSING)
366 typedef std::size_t result_type;
368 result_type operator()(
const argument_type& h)
const {
376 #endif // CGU_USE_SMART_PTR_COMPARISON
379 #warning GvarHandle not available: glib >= 2.24.0 is required
GvarHandle & operator=(GvarHandle &&gvar) noexcept
Definition: gvar_handle.h:270
Definition: application.h:44
GVariant * get() const noexcept
Definition: gvar_handle.h:290
GvarHandle(const GvarHandle &gvar) noexcept
Definition: gvar_handle.h:222
bool operator<(const GobjHandle< T > &h1, const GobjHandle< T > &h2)
Definition: gobj_handle.h:632
bool operator!=(const GobjHandle< T > &h1, const GobjHandle< T > &h2) noexcept
Definition: gobj_handle.h:613
bool operator==(const GobjHandle< T > &h1, const GobjHandle< T > &h2) noexcept
Definition: gobj_handle.h:600
GvarHandle(GVariant *ptr=0) noexcept
Definition: gvar_handle.h:183
A specialization of std::hash for Cgu::Callback::FunctorArg, Cgu::Callback::SafeFunctorArg,...
~GvarHandle()
Definition: gvar_handle.h:304
void reset(GVariant *ptr=0) noexcept
Definition: gvar_handle.h:205
GvarHandle(GvarHandle &&gvar) noexcept
Definition: gvar_handle.h:231
This is a handle for managing the reference count of GVariant objects.
Definition: gvar_handle.h:160
GvarHandle & operator=(const GvarHandle &gvar) noexcept
Definition: gvar_handle.h:244