handles and smart pointers

## Namespaces

| Cgu::SharedHandleAllocFail
| Cgu::SharedPtrAllocFail

## Classes

class | hash
| A specialization of std::hash for Cgu::Callback::FunctorArg, Cgu::Callback::SafeFunctorArg, Cgu::GobjHandle, Cgu::GvarHandle, Cgu::IntrusivePtr, Cgu::SharedHandle, Cgu::SharedLockHandle, Cgu::SharedPtr and Cgu::SharedLockPtr so that such objects may be keys of unordered associative containers. More...
class | Cgu::GerrorFree
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_error_free(). More...
class | Cgu::GobjHandle< T >
| This is a handle for managing the reference count of GObjects. More...
class | Cgu::GobjWeakHandle< T >
| This is a handle for managing weak references to GObjects. More...
class | Cgu::GvarHandle
| This is a handle for managing the reference count of GVariant objects. More...
class | Cgu::IntrusivePtr< T >
| This is a smart pointer for managing objects allocated on freestore which maintain their own reference count. More...
class | Cgu::IntrusiveCounter
| This is a counter class providing the ref() and unref() functions required by IntrusivePtr. More...
class | Cgu::IntrusiveLockCounter
| This is a counter class providing the ref() and unref() functions required by IntrusivePtr, with a thread safe reference count.. More...
class | Cgu::SharedHandle
| This is a generic class for managing the lifetime of objects allocated on freestore. More...
class | Cgu::StandardArrayDelete< T >
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls the C++ delete[] expression. More...
class | Cgu::CFree
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls std::free. More...
class | Cgu::GFree
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_free(). More...
class | Cgu::GSliceFree< T >
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_slice_free1(). More...
class | Cgu::GSliceDestroy< T >
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_slice_free1(), but before doing so also explicitly calls the destructor of a C++ object constructed in the memory. More...
class | Cgu::GSliceFreeSize< block_size >
| A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_slice_free1(). More...
class | Cgu::SharedHandleError< T >
| This is an exception struct thrown as an alternative to deleting a managed object when internal memory allocation for SharedHandle or SharedLockHandle fails in their reset() method or in their constructor which takes a pointer. More...
class | Cgu::ScopedHandle
| This is a generic scoped class for managing the lifetime of objects allocated on freestore. More...
class | Cgu::SharedLockHandle< T, Dealloc >
| This is a generic class for managing the lifetime of objects allocated on freestore, with a thread safe reference count.. More...
class | Cgu::SharedPtrError< T >
| This is an exception struct thrown as an alternative to deleting a managed object when internal memory allocation for SharedPtr or SharedLockPtr fails in their reset() method or in their constructor which takes a pointer. More...
class | Cgu::SharedPtr< T >
| This is a smart pointer for managing the lifetime of objects allocated on freestore. More...
class | Cgu::SharedLockPtr< T >
| This is a smart pointer for managing the lifetime of objects allocated on freestore, with a thread safe reference count. More...

## Typedefs

typedef ScopedHandle< GError *, GerrorFree > | Cgu::GerrorScopedHandle
| A handle comprising a typed instance of the ScopedHandle class for managing GError objects. More...
typedef SharedHandle< GError *, GerrorFree > | Cgu::GerrorSharedHandle
| A handle comprising a typed instance of the SharedHandle class for managing GError objects. More...
typedef SharedHandle< gchar *, GFree > | Cgu::GcharSharedHandle
| A handle comprising a typed instance of the SharedHandle class for gchar* arrays and strings. More...
typedef ScopedHandle< gchar *, GFree > | Cgu::GcharScopedHandle
| A handle comprising a typed instance of the ScopedHandle class for gchar* arrays and strings. More...

## Functions

template<class T >
bool | Cgu::operator== (const GobjHandle< T > &h1, const GobjHandle< T > &h2) noexcept
template<class T >
bool | Cgu::operator!= (const GobjHandle< T > &h1, const GobjHandle< T > &h2) noexcept
template<class T >
bool | Cgu::operator< (const GobjHandle< T > &h1, const GobjHandle< T > &h2)
bool | Cgu::operator== (const GvarHandle &h1, const GvarHandle &h2) noexcept
bool | Cgu::operator!= (const GvarHandle &h1, const GvarHandle &h2) noexcept
bool | Cgu::operator< (const GvarHandle &h1, const GvarHandle &h2)
template<class T >
bool | Cgu::operator== (const IntrusivePtr< T > &s1, const IntrusivePtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator!= (const IntrusivePtr< T > &s1, const IntrusivePtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator< (const IntrusivePtr< T > &s1, const IntrusivePtr< T > &s2)
template<class T , class Dealloc >
bool | Cgu::operator== (const SharedHandle< T, Dealloc > &s1, const SharedHandle< T, Dealloc > &s2) noexcept
template<class T , class Dealloc >
bool | Cgu::operator!= (const SharedHandle< T, Dealloc > &s1, const SharedHandle< T, Dealloc > &s2) noexcept
template<class T , class Dealloc >
bool | Cgu::operator< (const SharedHandle< T, Dealloc > &s1, const SharedHandle< T, Dealloc > &s2)
template<class T , class Dealloc >
bool | Cgu::operator== (const SharedLockHandle< T, Dealloc > &s1, const SharedLockHandle< T, Dealloc > &s2) noexcept
template<class T , class Dealloc >
bool | Cgu::operator!= (const SharedLockHandle< T, Dealloc > &s1, const SharedLockHandle< T, Dealloc > &s2) noexcept
template<class T , class Dealloc >
bool | Cgu::operator< (const SharedLockHandle< T, Dealloc > &s1, const SharedLockHandle< T, Dealloc > &s2)
template<class T >
bool | Cgu::operator== (const SharedPtr< T > &s1, const SharedPtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator!= (const SharedPtr< T > &s1, const SharedPtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator< (const SharedPtr< T > &s1, const SharedPtr< T > &s2)
template<class T >
bool | Cgu::operator== (const SharedLockPtr< T > &s1, const SharedLockPtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator!= (const SharedLockPtr< T > &s1, const SharedLockPtr< T > &s2) noexcept
template<class T >
bool | Cgu::operator< (const SharedLockPtr< T > &s1, const SharedLockPtr< T > &s2)

## Detailed Description

## Typedef Documentation

## GcharScopedHandle

Cgu::GcharScopedHandle

A handle comprising a typed instance of the ScopedHandle class for gchar* arrays and strings.

#include <c++-gtk-utils/shared_handle.h>

## GcharSharedHandle

Cgu::GcharSharedHandle

A handle comprising a typed instance of the SharedHandle class for gchar* arrays and strings.

#include <c++-gtk-utils/shared_handle.h>

## GerrorScopedHandle

Cgu::GerrorScopedHandle

A handle comprising a typed instance of the ScopedHandle class for managing GError objects.

#include <c++-gtk-utils/gerror_handle.h>

## GerrorSharedHandle

Cgu::GerrorSharedHandle

A handle comprising a typed instance of the SharedHandle class for managing GError objects.

#include <c++-gtk-utils/gerror_handle.h>

## Function Documentation

## operator!=() [1/7]

template<class T >

bool Cgu::operator!= | ( | const GobjHandle< T > & | h1,
|  | const GobjHandle< T > & | h2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [2/7]

bool Cgu::operator!= | ( | const GvarHandle & | h1,
|  | const GvarHandle & | h2
| ) |  |

inline noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [3/7]

template<class T >

bool Cgu::operator!= | ( | const IntrusivePtr< T > & | s1,
|  | const IntrusivePtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [4/7]

template<class T , class Dealloc >

bool Cgu::operator!= | ( | const SharedHandle< T, Dealloc > & | s1,
|  | const SharedHandle< T, Dealloc > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [5/7]

template<class T , class Dealloc >

bool Cgu::operator!= | ( | const SharedLockHandle< T, Dealloc > & | s1,
|  | const SharedLockHandle< T, Dealloc > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [6/7]

template<class T >

bool Cgu::operator!= | ( | const SharedLockPtr< T > & | s1,
|  | const SharedLockPtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator!=() [7/7]

template<class T >

bool Cgu::operator!= | ( | const SharedPtr< T > & | s1,
|  | const SharedPtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [1/7]

template<class T >

bool Cgu::operator< | ( | const GobjHandle< T > & | h1,
|  | const GobjHandle< T > & | h2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [2/7]

bool Cgu::operator< | ( | const GvarHandle & | h1,
|  | const GvarHandle & | h2
| ) |  |

inline

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [3/7]

template<class T >

bool Cgu::operator< | ( | const IntrusivePtr< T > & | s1,
|  | const IntrusivePtr< T > & | s2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [4/7]

template<class T , class Dealloc >

bool Cgu::operator< | ( | const SharedHandle< T, Dealloc > & | s1,
|  | const SharedHandle< T, Dealloc > & | s2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [5/7]

template<class T , class Dealloc >

bool Cgu::operator< | ( | const SharedLockHandle< T, Dealloc > & | s1,
|  | const SharedLockHandle< T, Dealloc > & | s2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [6/7]

template<class T >

bool Cgu::operator< | ( | const SharedLockPtr< T > & | s1,
|  | const SharedLockPtr< T > & | s2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator<() [7/7]

template<class T >

bool Cgu::operator< | ( | const SharedPtr< T > & | s1,
|  | const SharedPtr< T > & | s2
| ) |  |

This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation). It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [1/7]

template<class T >

bool Cgu::operator== | ( | const GobjHandle< T > & | h1,
|  | const GobjHandle< T > & | h2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [2/7]

bool Cgu::operator== | ( | const GvarHandle & | h1,
|  | const GvarHandle & | h2
| ) |  |

inline noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [3/7]

template<class T >

bool Cgu::operator== | ( | const IntrusivePtr< T > & | s1,
|  | const IntrusivePtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [4/7]

template<class T , class Dealloc >

bool Cgu::operator== | ( | const SharedHandle< T, Dealloc > & | s1,
|  | const SharedHandle< T, Dealloc > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [5/7]

template<class T , class Dealloc >

bool Cgu::operator== | ( | const SharedLockHandle< T, Dealloc > & | s1,
|  | const SharedLockHandle< T, Dealloc > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [6/7]

template<class T >

bool Cgu::operator== | ( | const SharedLockPtr< T > & | s1,
|  | const SharedLockPtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2

## operator==() [7/7]

template<class T >

bool Cgu::operator== | ( | const SharedPtr< T > & | s1,
|  | const SharedPtr< T > & | s2
| ) |  |

noexcept

This comparison operator does not throw. It compares the addresses of the managed objects.

Since 2.0.0-rc2