1 #ifndef GCONFMM_VALUE_LISTHELPERS_H
2 #define GCONFMM_VALUE_LISTHELPERS_H
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 static CType to_c_type (CType ptr) {
return ptr; }
44 static void release_c_type (CType ptr);
47 struct ValueSchemaTraits :
public ValueTraits
49 typedef Schema CppType;
51 static CType to_c_type (
const CppType& ptr);
52 static CppType to_cpp_type (CType ptr);
54 typedef Glib::SListHandle< Schema, ValueSchemaTraits > SListHandle_ValueSchema;
56 struct ValueStringTraits :
public ValueTraits
58 typedef Glib::ustring CppType;
60 static CType to_c_type (
const CppType& ptr);
61 static CppType to_cpp_type (CType ptr);
63 typedef Glib::SListHandle< Glib::ustring, ValueStringTraits > SListHandle_ValueString;
65 struct ValueIntTraits :
public ValueTraits
69 static CType to_c_type (
const CppType& ptr);
70 static CppType to_cpp_type (CType ptr);
72 typedef Glib::SListHandle< int, ValueIntTraits > SListHandle_ValueInt;
74 struct ValueBoolTraits :
public ValueTraits
78 static CType to_c_type (
const CppType& ptr);
79 static CppType to_cpp_type (CType ptr);
81 typedef Glib::SListHandle< bool, ValueBoolTraits > SListHandle_ValueBool;
83 struct ValueFloatTraits :
public ValueTraits
85 typedef double CppType;
87 static CType to_c_type (
const CppType& ptr);
88 static CppType to_cpp_type (CType ptr);
90 typedef Glib::SListHandle< double, ValueFloatTraits > SListHandle_ValueFloat;
98 namespace Container_Helpers
100 template<
class Tr,
class Cont>
101 struct ValueSourceTraits {
102 static GSList* get_data(
const Cont& cont) {
103 return Glib::Container_Helpers::create_slist(cont.begin(), cont.end(), Tr());
109 struct SListSourceTraits<Gnome::Conf::ValueIntTraits,Cont> : ValueSourceTraits<Gnome::Conf::ValueIntTraits,Cont>{
110 static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
113 struct SListSourceTraits<Gnome::Conf::ValueBoolTraits,Cont> : ValueSourceTraits<Gnome::Conf::ValueBoolTraits,Cont>{
114 static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
117 struct SListSourceTraits<Gnome::Conf::ValueFloatTraits,Cont> : ValueSourceTraits<Gnome::Conf::ValueFloatTraits,Cont>{
118 static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
121 struct SListSourceTraits<Gnome::Conf::ValueStringTraits,Cont> : ValueSourceTraits<Gnome::Conf::ValueStringTraits,Cont>{
122 static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
125 struct SListSourceTraits<Gnome::Conf::ValueSchemaTraits,Cont> : ValueSourceTraits<Gnome::Conf::ValueSchemaTraits,Cont>{
126 static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
129 #endif // DOXYGEN_SHOULD_SKIP_THIS