|
libqi-api
2.4.3.28
|
#include <boost/type_traits.hpp>#include <boost/utility/enable_if.hpp>#include <qi/type/fwd.hpp>#include <qi/type/detail/accessor.hxx>#include <qi/preproc.hpp>Go to the source code of this file.
Classes | |
| struct | qi::detail::StructVersioningDelegateDrop< T > |
| struct | qi::detail::StructVersioningDelegateFill< T > |
| class | qi::StructTypeInterfaceBouncer< T, TO > |
| class | qi::TypeImpl< std::pair< F, S > > |
Namespaces | |
| qi | |
| qi::detail | |
Macros | |
| #define | _QITYPE_DETAILS_TYPETUPLE_HXX_ |
| #define | QI_TYPE_STRUCT_EXTENSION_FILL_FIELDS(name,...) |
| #define | QI_TYPE_STRUCT_EXTENSION_FILL_ALL(name,...) |
| Allow filling any missing field with default value. More... | |
| #define | QI_TYPE_STRUCT_EXTENSION_DROP_ALL(name) |
| Declare struct as extension of previous versions, allowing all fields to be dropped. More... | |
| #define | QI_TYPE_STRUCT_EXTENSION_DROP_FIELDS(name,...) |
| Declare struct as extension of previous versions, allowing given fields to be dropped. More... | |
| #define | QI_TYPE_STRUCT_EXTENSION_DROP_HANDLER(name, f) |
| #define | QI_TYPE_STRUCT_EXTENSION_FILL_HANDLER(name, f) |
| #define | QI_TYPE_STRUCT_EXTENSION_ALL(name) |
| #define | QI_TYPE_STRUCT_EXTENSION_FIELDS(name,...) |
| Declare a versionned struct that accepts dropping/filling-with-default given fields. More... | |
| #define | __QI_TYPE_STRUCT_DECLARE(name, extra) |
| #define | __QI_TUPLE_TYPE(_, what, field) res.push_back(::qi::typeOf(ptr->field)); |
| #define | __QI_TUPLE_GET(_, what, field) if (i == index) return ::qi::typeOf(ptr->field)->initializeStorage(&ptr->field); i++; |
| #define | __QI_TUPLE_SET(_, what, field) if (i == index) ::qi::detail::setFromStorage(ptr->field, valueStorage); i++; |
| #define | __QI_TUPLE_FIELD_NAME(_, what, field) res.push_back(BOOST_PP_STRINGIZE(QI_DELAY(field))); |
| #define | __QI_TYPE_STRUCT_IMPLEMENT(name, inl, onSet,...) |
| #define | QI_STRUCT_HELPER(name, func) (name, func, FUNC) |
| Declare a struct field using an helper function. More... | |
| #define | QI_STRUCT_FIELD(name, field) (name, field, FIELD) |
| Declare a struct feld that is a member (member value or member accessor function) More... | |
| #define | __QI_STRUCT_ACCESS_FUNC(fname, field) &field |
| #define | __QI_STRUCT_ACCESS_FIELD(fname, field) &ClassType::field |
| #define | __QI_STRUCT_ACCESS_BOUNCE2(name, accessor, type) QI_CAT(__QI_STRUCT_ACCESS_, type)(name, accessor) |
| #define | __QI_STRUCT_ACCESS_BOUNCE1(x, y) __QI_STRUCT_ACCESS_BOUNCE2(x, y, FIELD) |
| #define | __QI_STRUCT_ACCESS_BOUNCE(...) QI_CAT(__QI_STRUCT_ACCESS_BOUNCE, QI_LIST_VASIZE((__VA_ARGS__)))(__VA_ARGS__) |
| #define | __QI_STRUCT_ACCESS(tuple) QI_DELAY(__QI_STRUCT_ACCESS_BOUNCE)tuple |
| #define | __QI_ATUPLE_TYPE(_, what, field) res.push_back(::qi::detail::fieldType(__QI_STRUCT_ACCESS(field))); |
| #define | __QI_ATUPLE_GET(_, what, field) if (i == index) return ::qi::detail::fieldStorage(ptr, __QI_STRUCT_ACCESS(field)); i++; |
| #define | __QI_ATUPLE_FIELD_NAME(_, what, field) res.push_back(QI_PAIR_FIRST(field)); |
| #define | __QI_ATUPLE_FROMDATA(idx, what, field) ::qi::detail::fieldValue(ptr, __QI_STRUCT_ACCESS(field), const_cast<void**>(&data[idx])) |
| #define | __QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR_IMPLEMENT(name, inl, onSet,...) |
| #define | QI_TYPE_STRUCT_PRIVATE_ACCESS(name) friend class qi::TypeImpl<name>; |
| Allow the QI_TYPE_STRUCT macro and variants to access private members. More... | |
| #define | QI_TYPE_STRUCT(name,...) |
| #define | QI_TYPE_STRUCT_EX(name, onSet,...) |
| #define | QI_TYPE_STRUCT_IMPLEMENT(name,...) __QI_TYPE_STRUCT_IMPLEMENT(name, , , __VA_ARGS__) |
| #define | QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR(name,...) |
| #define | QI_TYPE_STRUCT_REGISTER(name,...) |
| #define | QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR_REGISTER(name,...) |
| #define | QI_TYPE_STRUCT_BOUNCE(name, bounceTo, conversion) |
| #define | QI_TYPE_STRUCT_BOUNCE_REGISTER(name, bounceTo, conversion) |
Functions | |
| bool | qi::detail::fillMissingFieldsWithDefaultValues (StructTypeInterface *type, std::map< std::string,::qi::AnyValue > &fields, const std::vector< std::string > &missing, const char **which=0, int whichLength=0) |
| std::string | qi::detail::normalizeClassName (const std::string &name) |
| template<typename T > | |
| void | qi::detail::setFromStorage (T &ref, void *storage) |
| template<typename A > | |
| TypeInterface * | qi::detail::fieldType (A) |
| template<typename C , typename A > | |
| void * | qi::detail::fieldStorage (C *inst, A accessor) |
| template<typename C , typename A > | |
| detail::Accessor< A >::value_type & | qi::detail::fieldValue (C *instance, A accessor, void **data) |
| #define __QI_ATUPLE_FIELD_NAME | ( | _, | |
| what, | |||
| field | |||
| ) | res.push_back(QI_PAIR_FIRST(field)); |
Definition at line 239 of file structtypeinterface.hxx.
| #define __QI_ATUPLE_FROMDATA | ( | idx, | |
| what, | |||
| field | |||
| ) | ::qi::detail::fieldValue(ptr, __QI_STRUCT_ACCESS(field), const_cast<void**>(&data[idx])) |
Definition at line 240 of file structtypeinterface.hxx.
| #define __QI_ATUPLE_GET | ( | _, | |
| what, | |||
| field | |||
| ) | if (i == index) return ::qi::detail::fieldStorage(ptr, __QI_STRUCT_ACCESS(field)); i++; |
Definition at line 238 of file structtypeinterface.hxx.
| #define __QI_ATUPLE_TYPE | ( | _, | |
| what, | |||
| field | |||
| ) | res.push_back(::qi::detail::fieldType(__QI_STRUCT_ACCESS(field))); |
Definition at line 237 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS | ( | tuple | ) | QI_DELAY(__QI_STRUCT_ACCESS_BOUNCE)tuple |
Definition at line 234 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS_BOUNCE | ( | ... | ) | QI_CAT(__QI_STRUCT_ACCESS_BOUNCE, QI_LIST_VASIZE((__VA_ARGS__)))(__VA_ARGS__) |
Definition at line 230 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS_BOUNCE1 | ( | x, | |
| y | |||
| ) | __QI_STRUCT_ACCESS_BOUNCE2(x, y, FIELD) |
Definition at line 226 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS_BOUNCE2 | ( | name, | |
| accessor, | |||
| type | |||
| ) | QI_CAT(__QI_STRUCT_ACCESS_, type)(name, accessor) |
Definition at line 222 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS_FIELD | ( | fname, | |
| field | |||
| ) | &ClassType::field |
Definition at line 219 of file structtypeinterface.hxx.
| #define __QI_STRUCT_ACCESS_FUNC | ( | fname, | |
| field | |||
| ) | &field |
Definition at line 217 of file structtypeinterface.hxx.
| #define __QI_TUPLE_FIELD_NAME | ( | _, | |
| what, | |||
| field | |||
| ) | res.push_back(BOOST_PP_STRINGIZE(QI_DELAY(field))); |
Definition at line 168 of file structtypeinterface.hxx.
| #define __QI_TUPLE_GET | ( | _, | |
| what, | |||
| field | |||
| ) | if (i == index) return ::qi::typeOf(ptr->field)->initializeStorage(&ptr->field); i++; |
Definition at line 166 of file structtypeinterface.hxx.
| #define __QI_TUPLE_SET | ( | _, | |
| what, | |||
| field | |||
| ) | if (i == index) ::qi::detail::setFromStorage(ptr->field, valueStorage); i++; |
Definition at line 167 of file structtypeinterface.hxx.
| #define __QI_TUPLE_TYPE | ( | _, | |
| what, | |||
| field | |||
| ) | res.push_back(::qi::typeOf(ptr->field)); |
Definition at line 165 of file structtypeinterface.hxx.
| #define __QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR_IMPLEMENT | ( | name, | |
| inl, | |||
| onSet, | |||
| ... | |||
| ) |
Definition at line 241 of file structtypeinterface.hxx.
| #define __QI_TYPE_STRUCT_DECLARE | ( | name, | |
| extra | |||
| ) |
Definition at line 145 of file structtypeinterface.hxx.
| #define __QI_TYPE_STRUCT_IMPLEMENT | ( | name, | |
| inl, | |||
| onSet, | |||
| ... | |||
| ) |
Definition at line 169 of file structtypeinterface.hxx.
| #define _QITYPE_DETAILS_TYPETUPLE_HXX_ |
Definition at line 8 of file structtypeinterface.hxx.
| #define QI_STRUCT_FIELD | ( | name, | |
| field | |||
| ) | (name, field, FIELD) |
Declare a struct feld that is a member (member value or member accessor function)
Definition at line 214 of file structtypeinterface.hxx.
| #define QI_STRUCT_HELPER | ( | name, | |
| func | |||
| ) | (name, func, FUNC) |
Declare a struct field using an helper function.
Definition at line 212 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT | ( | name, | |
| ... | |||
| ) |
Declare a simple struct to the type system. First argument is the structure name. Remaining arguments are the structure fields. This macro must be called outside any namespace. This macro should be called in the header file defining the structure 'name', or in a header included by all source files using the structure. See QI_TYPE_STRUCT_REGISTER for a similar macro that can be called from a single source file.
Definition at line 301 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR | ( | name, | |
| ... | |||
| ) |
Register a struct with member field/function getters, and constructor setter
Call like that: QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR(Point, ("x", getX), ("y", y))
The first macro argument is the class full name including namespace. Remaining arguments can be:
The class must provide a constructor that accepts all fields as argument, in the order in which they are declared in the macro.
Must be called outside any namespace.
Definition at line 337 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR_REGISTER | ( | name, | |
| ... | |||
| ) |
Similar to QI_TYPE_STRUCT_AGREGATE_CONSTRUCTOR, but using the runtime factory instead of the compile-time template.
Definition at line 359 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_BOUNCE | ( | name, | |
| bounceTo, | |||
| conversion | |||
| ) |
Declares that name is equivalent to type bounceTo, and that instances can be converted using the conversion function with signature 'bounceTo* (name*)'. This macro should be called in a header included by all code using the 'name' class. See QI_TYPE_STRUCT_BOUNCE_REGISTER for a similar macro that can be called from a single source file.
Definition at line 372 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_BOUNCE_REGISTER | ( | name, | |
| bounceTo, | |||
| conversion | |||
| ) |
Similar to QI_TYPE_STRUCT_BOUNCE, but using the runtime factory instead of the compile-time template.
Definition at line 392 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EX | ( | name, | |
| onSet, | |||
| ... | |||
| ) |
Similar to QI_TYPE_STRUCT, but evaluates 'onSet' after writting to an instance. The instance is accessible through the variable 'ptr'.
Definition at line 308 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_ALL | ( | name | ) |
Allow converting this struct to/from anything. Dropping unmatched fields, and filling non-present ones with the default value for the matching type.
Definition at line 102 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_DROP_ALL | ( | name | ) |
Declare struct as extension of previous versions, allowing all fields to be dropped.
Definition at line 56 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_DROP_FIELDS | ( | name, | |
| ... | |||
| ) |
Declare struct as extension of previous versions, allowing given fields to be dropped.
Definition at line 62 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_DROP_HANDLER | ( | name, | |
| f | |||
| ) |
Define callable f as drop handler for struct name will be invoked as f(name* nameInstance, const std::vector<std::string>& fields) and must return true to allow the drop, or false to deny the conversion.
Definition at line 77 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_FIELDS | ( | name, | |
| ... | |||
| ) |
Declare a versionned struct that accepts dropping/filling-with-default given fields.
Definition at line 107 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_FILL_ALL | ( | name, | |
| ... | |||
| ) |
Allow filling any missing field with default value.
Definition at line 48 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_FILL_FIELDS | ( | name, | |
| ... | |||
| ) |
Allow filling given struct field names with the default value, if converting from a previous struct version.
Definition at line 38 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_EXTENSION_FILL_HANDLER | ( | name, | |
| f | |||
| ) |
Define callable f as handler when a default value is needed for some fields of name. Will be invoked as f(std::map<string, AnyValue>& content, const vector<string>& missingFields) It must return false to indicate a failure, or fill content with a value for all the missing fields and return true.
Definition at line 89 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_IMPLEMENT | ( | name, | |
| ... | |||
| ) | __QI_TYPE_STRUCT_IMPLEMENT(name, , , __VA_ARGS__) |
Definition at line 312 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_PRIVATE_ACCESS | ( | name | ) | friend class qi::TypeImpl<name>; |
Allow the QI_TYPE_STRUCT macro and variants to access private members.
Definition at line 289 of file structtypeinterface.hxx.
| #define QI_TYPE_STRUCT_REGISTER | ( | name, | |
| ... | |||
| ) |
Similar to QI_TYPE_STRUCT, but using the runtime factory instead of the compile-time template. This macro will register the struct at static initialization time, and thus should only be called from one compilation unit. To ensure this, the simplest option is to use this macro from a .cpp source file. It should not be used in a header.
Definition at line 348 of file structtypeinterface.hxx.