Wrapping the g_resolver_lookup_records*() functions
- From: José Alburquerque <jaalburquerque gmail com>
- To: gtkmm-list gnome org
- Subject: Wrapping the g_resolver_lookup_records*() functions
- Date: Mon, 29 Oct 2012 23:27:05 -0400
In trying to wrap the g_resolver_lookup_records*() functions of
GResolver (particularly the g_resolver_lookup_records() and the
g_resolver_lookup_records_finish() functions) I seem to be running into
some compiler errors I don't quite understand. It looks like there are
problems handling the GLists of GVariant (I'm not sure). The relevant
wrap code in resolver.hg is:
#m4
_CONVERSION(`GList*',`std::vector<Glib::VariantContainerBase>',`Glib::ListHandler<Glib::VariantContainerBase>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
#m4 _CONV_ENUM(G, ResolverRecordType)
_WRAP_METHOD(std::vector<Glib::VariantContainerBase>
lookup_records(const Glib::ustring& rrname, ResolverRecordType
record_type, const Glib::RefPtr<Cancellable>& cancellable{?}),
g_resolver_lookup_records, errthrow)
_WRAP_METHOD(std::vector<Glib::VariantContainerBase>
lookup_records_finish(const Glib::RefPtr<AsyncResult>& result),
g_resolver_lookup_records_finish, errthrow)
The compile error I'm getting is:
In file included from ../../glib/glibmm.h:142:0,
from resolver.cc:4:
../../glib/glibmm/vectorutils.h: In destructor
‘Glib::Container_Helpers::GListKeeper<Tr>::~GListKeeper() [with Tr =
Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase>]’:
../../glib/glibmm/vectorutils.h:944:42: instantiated from ‘static
Glib::ListHandler<T, Tr>::VectorType Glib::ListHandler<T,
Tr>::list_to_vector(GList*, Glib::OwnershipType) [with T =
Glib::VariantContainerBase, Tr =
Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase>,
Glib::ListHandler<T, Tr>::VectorType =
std::vector<Glib::VariantContainerBase>, GList = _GList]’
resolver.cc:400:101: instantiated from here
../../glib/glibmm/vectorutils.h:844:9: error: no matching function for
call to ‘Glib::VariantContainerBase::VariantContainerBase(void*&)’
../../glib/glibmm/vectorutils.h:844:9: note: candidates are:
../../glib/glibmm/variant.h:507:12: note:
Glib::VariantContainerBase::VariantContainerBase(GVariant*, bool) <near
match>
../../glib/glibmm/variant.h:507:12: note: no known conversion for
argument 1 from ‘gpointer {aka void*}’ to ‘GVariant* {aka _GVariant*}’
../../glib/glibmm/variant.h:499:3: note:
Glib::VariantContainerBase::VariantContainerBase()
../../glib/glibmm/variant.h:499:3: note: candidate expects 0
arguments, 1 provided
../../glib/glibmm/variant.h:481:7: note:
Glib::VariantContainerBase::VariantContainerBase(const
Glib::VariantContainerBase&)
../../glib/glibmm/variant.h:481:7: note: no known conversion for
argument 1 from ‘gpointer {aka void*}’ to ‘const
Glib::VariantContainerBase&’
../../glib/glibmm/vectorutils.h: In member function
‘Glib::Container_Helpers::ListIterator<Tr>::value_type
Glib::Container_Helpers::ListIterator<Tr>::operator*() const [with Tr =
Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase>,
Glib::Container_Helpers::ListIterator<Tr>::value_type =
Glib::VariantContainerBase]’:
/usr/include/c++/4.6/bits/stl_uninitialized.h:77:3: instantiated from
‘static _ForwardIterator
std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _ForwardIterator = Glib::VariantContainerBase*, bool _TrivialValueTypes = false]’
/usr/include/c++/4.6/bits/stl_uninitialized.h:119:41: instantiated
from ‘_ForwardIterator std::uninitialized_copy(_InputIterator,
_InputIterator, _ForwardIterator) [with _InputIterator =
Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _ForwardIterator = Glib::VariantContainerBase*]’
/usr/include/c++/4.6/bits/stl_uninitialized.h:259:63: instantiated
from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator,
_InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with
_InputIterator =
Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _ForwardIterator = Glib::VariantContainerBase*, _Tp = Glib::VariantContainerBase]’
/usr/include/c++/4.6/bits/stl_vector.h:1113:4: instantiated from ‘void
std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator,
_ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator =
Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _Tp = Glib::VariantContainerBase, _Alloc = std::allocator<Glib::VariantContainerBase>]’
/usr/include/c++/4.6/bits/stl_vector.h:1091:4: instantiated from ‘void
std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_InputIterator,
_InputIterator, std::__false_type) [with _InputIterator =
Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _Tp = Glib::VariantContainerBase, _Alloc = std::allocator<Glib::VariantContainerBase>]’
/usr/include/c++/4.6/bits/stl_vector.h:340:4: instantiated from
‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const
allocator_type&) [with _InputIterator =
Glib::Container_Helpers::ListIterator<Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase> >, _Tp = Glib::VariantContainerBase, _Alloc = std::allocator<Glib::VariantContainerBase>, std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Glib::VariantContainerBase>]’
../../glib/glibmm/vectorutils.h:946:65: instantiated from ‘static
Glib::ListHandler<T, Tr>::VectorType Glib::ListHandler<T,
Tr>::list_to_vector(GList*, Glib::OwnershipType) [with T =
Glib::VariantContainerBase, Tr =
Glib::Container_Helpers::TypeTraits<Glib::VariantContainerBase>,
Glib::ListHandler<T, Tr>::VectorType =
std::vector<Glib::VariantContainerBase>, GList = _GList]’
resolver.cc:400:101: instantiated from here
../../glib/glibmm/vectorutils.h:698:78: error: no matching function for
call to ‘Glib::VariantContainerBase::VariantContainerBase(void* const&)’
../../glib/glibmm/vectorutils.h:698:78: note: candidates are:
../../glib/glibmm/variant.h:507:12: note:
Glib::VariantContainerBase::VariantContainerBase(GVariant*, bool) <near
match>
../../glib/glibmm/variant.h:507:12: note: no known conversion for
argument 1 from ‘const gpointer {aka void* const}’ to ‘GVariant* {aka
_GVariant*}’
../../glib/glibmm/variant.h:499:3: note:
Glib::VariantContainerBase::VariantContainerBase()
../../glib/glibmm/variant.h:499:3: note: candidate expects 0
arguments, 1 provided
../../glib/glibmm/variant.h:481:7: note:
Glib::VariantContainerBase::VariantContainerBase(const
Glib::VariantContainerBase&)
../../glib/glibmm/variant.h:481:7: note: no known conversion for
argument 1 from ‘const gpointer {aka void* const}’ to ‘const
Glib::VariantContainerBase&’
../../glib/glibmm/vectorutils.h:699:1: error: control reaches end of
non-void function [-Werror=return-type]
cc1plus: all warnings being treated as errors
make[2]: *** [resolver.lo] Error 1
Anyone know what's happening?
--
José
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]