diff options
author | Murray Cumming <murrayc@murrayc.com> | 2017-03-17 12:43:13 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2017-03-20 09:50:53 +0100 |
commit | 79b20cd2d2c83ac52d8a2c385b2674fa3c514d99 (patch) | |
tree | 7c8d5f4143d87efbabf0e64c146f3399b0e35aae /gio/src/resolver.ccg | |
parent | bc8d88079391a8f4f336ea16585b8ed1bcd46358 (diff) | |
download | glibmm-79b20cd2d2c83ac52d8a2c385b2674fa3c514d99.tar.gz |
Gio::Resolver: Use std::vector instead of Glib::ListHandle<>.
Using Glib::ListHandler<>::list_to_array() and
Glib::ListHandler<>::list_to_vector() instead, and only in the
implementation instead of in the API.
Diffstat (limited to 'gio/src/resolver.ccg')
-rw-r--r-- | gio/src/resolver.ccg | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg index 093f6981..df3e0df1 100644 --- a/gio/src/resolver.ccg +++ b/gio/src/resolver.ccg @@ -19,6 +19,22 @@ #include <glibmm/error.h> #include "slot_async.h" +namespace { + +struct SrvTargetListTraits +{ + using CppType = Gio::SrvTarget; + using CType = const GSrvTarget*; + using CTypeNonConst = GSrvTarget*; + + static CType to_c_type(const CppType& item) { return item.gobj(); } + static CType to_c_type(CType ptr) { return ptr; } + static CppType to_cpp_type(CType item) { return CppType(const_cast<CTypeNonConst>(item), true /* take_copy */); } + static void release_c_type(CType item) { g_srv_target_free(const_cast<CTypeNonConst>(item)); } +}; + +} // anonymous namespace + namespace Gio { |