TrinityCore
Loading...
Searching...
No Matches
QueryResultStructured.h File Reference
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/comma_if.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/stringize.hpp>
+ Include dependency graph for QueryResultStructured.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD_INDEX_INIT(r, data, i, field)   BOOST_PP_COMMA_IF(i) field(result.GetFieldMetadata(BOOST_PP_STRINGIZE(field)).Index)
 
#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD(r, data, field)
 
#define DEFINE_FIELD_ACCESSOR_CACHE(namespace_name, struct_name, result_type, fields_list)
 
#define DEFINE_FIELD_ACCESSOR_CACHE_ANONYMOUS(result_type, fields_list)   DEFINE_FIELD_ACCESSOR_CACHE(BOOST_PP_EMPTY(), BOOST_PP_CAT(FieldAccessors, __LINE__), result_type, fields_list)
 

Macro Definition Documentation

◆ DEFINE_FIELD_ACCESSOR_CACHE

#define DEFINE_FIELD_ACCESSOR_CACHE (   namespace_name,
  struct_name,
  result_type,
  fields_list 
)
Value:
struct namespace_name struct_name \
{ \
struct Indexes\
{\
Indexes(result_type const& result) :\
BOOST_PP_SEQ_FOR_EACH_I(DEFINE_FIELD_ACCESSOR_CACHE_FIELD_INDEX_INIT, ~, fields_list) { }\
std::size_t BOOST_PP_SEQ_ENUM(fields_list);\
};\
BOOST_PP_SEQ_FOR_EACH(DEFINE_FIELD_ACCESSOR_CACHE_FIELD, ~, fields_list) \
struct_name(result_type const& result) : Fields(result.Fetch()), indexes(indexes_impl(result)) { }\
Field* Fields; \
static Indexes const& indexes_impl(result_type const& result) noexcept { static Indexes const instance(result); return instance; }\
Indexes const& indexes;\
}
#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD_INDEX_INIT(r, data, i, field)
#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD(r, data, field)
Class used to access individual fields of database query result.
Definition Field.h:94

Definition at line 36 of file QueryResultStructured.h.

◆ DEFINE_FIELD_ACCESSOR_CACHE_ANONYMOUS

#define DEFINE_FIELD_ACCESSOR_CACHE_ANONYMOUS (   result_type,
  fields_list 
)    DEFINE_FIELD_ACCESSOR_CACHE(BOOST_PP_EMPTY(), BOOST_PP_CAT(FieldAccessors, __LINE__), result_type, fields_list)

Definition at line 52 of file QueryResultStructured.h.

◆ DEFINE_FIELD_ACCESSOR_CACHE_FIELD

#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD (   r,
  data,
  field 
)
Value:
Field const& field() const\
{\
return Fields[indexes.field];\
}

Definition at line 31 of file QueryResultStructured.h.

◆ DEFINE_FIELD_ACCESSOR_CACHE_FIELD_INDEX_INIT

#define DEFINE_FIELD_ACCESSOR_CACHE_FIELD_INDEX_INIT (   r,
  data,
  i,
  field 
)    BOOST_PP_COMMA_IF(i) field(result.GetFieldMetadata(BOOST_PP_STRINGIZE(field)).Index)

Definition at line 29 of file QueryResultStructured.h.