LeechCraft  0.6.70-9312-g4cc613a2df
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LeechCraft::Util::oral::detail Namespace Reference

Classes

struct  GetFieldName
 
struct  GetFieldsNames_
 
struct  GetFieldsNames_< S, typename boost::fusion::result_of::size< S >::type >
 
struct  GetFieldsNames
 
struct  GetBoundName
 
struct  Types
 
struct  Inserter
 
struct  Selector
 
struct  CachedFieldsData
 
struct  Lazy
 
struct  FindPKey
 
struct  AdaptInsert
 
class  AdaptUpdate
 
struct  AdaptDelete
 
struct  FieldsUnpacker
 
struct  FieldsUnpacker< HeadT >
 
struct  ValueBinder
 
struct  ValueBinder< FieldsUnpacker, HeadArg >
 
struct  IsLeaf
 
struct  IsLeaf< ExprType::LeafStaticPlaceholder >
 
struct  IsLeaf< ExprType::LeafData >
 
struct  IsCompatible
 
struct  IsCompatible< Type, ExprType::And >
 
struct  IsCompatible< Type, ExprType::Or >
 
struct  IsCompatible< Type, ExprType::LeafStaticPlaceholder >
 
struct  IsCompatible< Type, ExprType::LeafData >
 
struct  ToSqlState
 
struct  RelationalTypesChecker
 
struct  RelationalTypesCheckerBase
 
struct  RelationalTypesChecker< Type, Seq, L, R, std::enable_if_t< IsRelational(Type)> >
 
class  ExprTree
 
class  ExprTree< ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >, void >
 
class  ExprTree< ExprType::LeafData, T, void >
 
struct  IsExprTree
 
struct  IsExprTree< ExprTree< Type, L, R > >
 
class  SelectByFieldsWrapper
 
class  SelectOneByFieldsWrapper
 
class  DeleteByFieldsWrapper
 
struct  FieldInfo
 
struct  FieldAppender
 
struct  FieldAppender< To, OrigSeq, OrigIdx, References< RefSeq, RefIdx > >
 
struct  CollectRefs_
 
struct  CollectRefs_< Seq, typename boost::fusion::result_of::size< Seq >::type >
 
struct  CollectRefs
 
struct  Ref2Select
 
struct  ExtrObj
 
struct  ExtrObj< FieldInfo< OrigSeq, OrigIdx, RefSeq, MemberIdx > >
 
struct  SingleBind
 
struct  MakeBinder
 
struct  WrapAsFunc
 
struct  MakeSingleBinder
 
struct  IsPKey
 
struct  IsPKey< PKey< U, Tags...> >
 

Typedefs

template<typename Seq , int Idx>
using ValueAtC_t = typename boost::fusion::result_of::value_at_c< Seq, Idx >::type
 
template<typename Seq , typename Idx >
using ValueAt_t = typename boost::fusion::result_of::value_at< Seq, Idx >::type
 
template<typename T , typename Ret >
using WrapAsFunc_t = typename WrapAsFunc< T, Ret >::type
 
using transform_view = typename boost::mpl::transform< objects_vector, WrapAsFunc< boost::mpl::_1, T >>::type
 

Enumerations

enum  ExprType {
  ExprType::LeafStaticPlaceholder,
  ExprType::LeafData,
  ExprType::Greater,
  ExprType::Less,
  ExprType::Equal,
  ExprType::Geq,
  ExprType::Leq,
  ExprType::Neq,
  ExprType::And,
  ExprType::Or
}
 

Functions

bool MatchesSchema (const QString &baseName, const QString &schema, QSqlDatabase &db)
 
template<typename T >
QString MorphFieldNameImpl (const QString &str, int, decltype(&T::FieldNameMorpher)*=nullptr)
 
template<typename T >
QString MorphFieldNameImpl (const QString &str, float)
 
template<typename T >
QString MorphFieldName (const QString &str)
 
template<typename T >
std::function< void(T)> MakeInserter (CachedFieldsData data, QSqlQuery_ptr insertQuery, bool bindPrimaryKey)
 
template<typename Seq , int Idx = FindPKey<Seq>::result_type::value>
constexpr bool HasPKeyImpl (int)
 
template<typename Seq >
constexpr bool HasPKeyImpl (float)
 
template<typename Seq >
constexpr bool HasPKey ()
 
template<typename Seq , int Idx = FindPKey<Seq>::result_type::value>
constexpr bool HasAutogenPKeyImpl (int)
 
template<typename >
constexpr bool HasAutogenPKeyImpl (float)
 
template<typename Seq >
constexpr bool HasAutogenPKey ()
 
QString GetInsertPrefix (InsertAction action)
 
template<typename T >
QList< T > PerformSelect (QSqlQuery_ptr q)
 
template<typename T >
std::function< QList< T >)> AdaptSelectAll (const CachedFieldsData &data)
 
QString TypeToSql (ExprType type)
 
template<typename T >
constexpr T Ctfy (T t)
 
template<ExprType T1, ExprType T2>
constexpr bool CheckCompatible ()
 
constexpr bool IsRelational (ExprType type)
 
template<typename Seq , typename L , typename R >
constexpr bool AreComparableTypesImpl (int, decltype(std::declval< typename L::template ValueType_t< Seq >>()==std::declval< typename R::template ValueType_t< Seq >>())*=nullptr)
 
template<typename Seq , typename L , typename R >
constexpr bool AreComparableTypesImpl (float)
 
template<typename Seq , typename L , typename R >
constexpr bool AreComparableTypes ()
 
template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree< ExprType::Less,
ExprTree< LType, LL, LR >
, ExprTree< RType, RL, RR > > 
operator< (const ExprTree< LType, LL, LR > &left, const ExprTree< RType, RL, RR > &right)
 
template<ExprType LType, typename LL , typename LR , typename R >
ExprTree< ExprType::Less,
ExprTree< LType, LL, LR >
, ExprTree< ExprType::LeafData,
R > > 
operator< (const ExprTree< LType, LL, LR > &left, const R &right)
 
template<ExprType RType, typename RL , typename RR , typename L >
ExprTree< ExprType::Less,
ExprTree< ExprType::LeafData,
L >, ExprTree< RType, RL, RR > > 
operator< (const L &left, const ExprTree< RType, RL, RR > &right)
 
template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree< ExprType::Equal,
ExprTree< LType, LL, LR >
, ExprTree< RType, RL, RR > > 
operator== (const ExprTree< LType, LL, LR > &left, const ExprTree< RType, RL, RR > &right)
 
template<ExprType LType, typename LL , typename LR , typename R >
ExprTree< ExprType::Equal,
ExprTree< LType, LL, LR >
, ExprTree< ExprType::LeafData,
R > > 
operator== (const ExprTree< LType, LL, LR > &left, const R &right)
 
template<ExprType RType, typename RL , typename RR , typename L >
ExprTree< ExprType::Equal,
ExprTree< ExprType::LeafData,
L >, ExprTree< RType, RL, RR > > 
operator== (const L &left, const ExprTree< RType, RL, RR > &right)
 
template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree< ExprType::And,
ExprTree< LType, LL, LR >
, ExprTree< RType, RL, RR > > 
operator&& (const ExprTree< LType, LL, LR > &left, const ExprTree< RType, RL, RR > &right)
 
template<ExprType LType, typename LL , typename LR , typename R >
ExprTree< ExprType::And,
ExprTree< LType, LL, LR >
, ExprTree< ExprType::LeafData,
R > > 
operator&& (const ExprTree< LType, LL, LR > &left, const R &right)
 
template<ExprType RType, typename RL , typename RR , typename L >
ExprTree< ExprType::And,
ExprTree< ExprType::LeafData,
L >, ExprTree< RType, RL, RR > > 
operator&& (const L &left, const ExprTree< RType, RL, RR > &right)
 
template<typename Seq , ExprType Type, typename L , typename R >
QPair< QString, std::function
< void(QSqlQuery_ptr)> > 
HandleExprTree (const ExprTree< Type, L, R > &tree)
 
template<typename T >
SelectByFieldsWrapper< T > AdaptSelectFields (const CachedFieldsData &data)
 
template<typename T >
SelectOneByFieldsWrapper< T > AdaptSelectOneFields (const CachedFieldsData &data)
 
template<typename T >
DeleteByFieldsWrapper< T > AdaptDeleteFields (const CachedFieldsData &data)
 
template<typename T , typename ObjInfo >
std::enable_if< CollectRefs< T >
::type_list::size::value==1 >
::type 
AdaptSelectRef (const CachedFieldsData &data, ObjInfo &info)
 
template<typename T >
CachedFieldsData BuildCachedFieldsData (const QSqlDatabase &db, const QString &table=T::ClassName())
 

Variables

std::function< QList< T >
objects_vector)> 
SelectByFKeysActor_
 
boost::fusion::result_of::as_vector
< transform_view >::type 
SingleFKeySelectors_
 

Typedef Documentation

using LeechCraft::Util::oral::detail::transform_view = typedef typename boost::mpl::transform<objects_vector, WrapAsFunc<boost::mpl::_1, T>>::type

Definition at line 1383 of file oral.h.

template<typename Seq , typename Idx >
using LeechCraft::Util::oral::detail::ValueAt_t = typedef typename boost::fusion::result_of::value_at<Seq, Idx>::type

Definition at line 423 of file oral.h.

template<typename Seq , int Idx>
using LeechCraft::Util::oral::detail::ValueAtC_t = typedef typename boost::fusion::result_of::value_at_c<Seq, Idx>::type

Definition at line 420 of file oral.h.

template<typename T , typename Ret >
using LeechCraft::Util::oral::detail::WrapAsFunc_t = typedef typename WrapAsFunc<T, Ret>::type

Definition at line 1235 of file oral.h.

Enumeration Type Documentation

Enumerator
LeafStaticPlaceholder 
LeafData 
Greater 
Less 
Equal 
Geq 
Leq 
Neq 
And 
Or 

Definition at line 707 of file oral.h.

Function Documentation

template<typename T >
DeleteByFieldsWrapper<T> LeechCraft::Util::oral::detail::AdaptDeleteFields ( const CachedFieldsData &  data)

Definition at line 1116 of file oral.h.

template<typename T >
std::function<QList<T>)> LeechCraft::Util::oral::detail::AdaptSelectAll ( const CachedFieldsData &  data)
template<typename T >
SelectByFieldsWrapper<T> LeechCraft::Util::oral::detail::AdaptSelectFields ( const CachedFieldsData &  data)

Definition at line 1104 of file oral.h.

template<typename T >
SelectOneByFieldsWrapper<T> LeechCraft::Util::oral::detail::AdaptSelectOneFields ( const CachedFieldsData &  data)

Definition at line 1110 of file oral.h.

template<typename T , typename ObjInfo >
std::enable_if<CollectRefs<T>::type_list::size::value == 1>::type LeechCraft::Util::oral::detail::AdaptSelectRef ( const CachedFieldsData &  data,
ObjInfo &  info 
)
template<typename Seq , typename L , typename R >
constexpr bool LeechCraft::Util::oral::detail::AreComparableTypes ( )

Definition at line 819 of file oral.h.

template<typename Seq , typename L , typename R >
constexpr bool LeechCraft::Util::oral::detail::AreComparableTypesImpl ( int  ,
decltype(std::declval< typename L::template ValueType_t< Seq >>()==std::declval< typename R::template ValueType_t< Seq >>())*  = nullptr 
)

Definition at line 806 of file oral.h.

template<typename Seq , typename L , typename R >
constexpr bool LeechCraft::Util::oral::detail::AreComparableTypesImpl ( float  )

Definition at line 813 of file oral.h.

template<typename T >
CachedFieldsData LeechCraft::Util::oral::detail::BuildCachedFieldsData ( const QSqlDatabase &  db,
const QString &  table = T::ClassName () 
)

Definition at line 1388 of file oral.h.

References LeechCraft::Util::Map().

+ Here is the call graph for this function:

template<ExprType T1, ExprType T2>
constexpr bool LeechCraft::Util::oral::detail::CheckCompatible ( )

Definition at line 783 of file oral.h.

template<typename T >
constexpr T LeechCraft::Util::oral::detail::Ctfy ( t)

Definition at line 777 of file oral.h.

QString LeechCraft::Util::oral::detail::GetInsertPrefix ( InsertAction  action)
inline

Definition at line 474 of file oral.h.

References LeechCraft::Util::oral::Default, LeechCraft::Util::oral::Ignore, LeechCraft::Util::oral::Replace, and LeechCraft::Util::Unreachable().

Referenced by LeechCraft::Util::oral::detail::AdaptInsert< T >::operator()().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename Seq , ExprType Type, typename L , typename R >
QPair<QString, std::function<void (QSqlQuery_ptr)> > LeechCraft::Util::oral::detail::HandleExprTree ( const ExprTree< Type, L, R > &  tree)

Definition at line 959 of file oral.h.

References LeechCraft::Util::Stlize(), and LeechCraft::Util::oral::detail::ExprTree< Type, L, R >::ToSql().

+ Here is the call graph for this function:

template<typename Seq >
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKey ( )

Definition at line 469 of file oral.h.

template<typename Seq , int Idx = FindPKey<Seq>::result_type::value>
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKeyImpl ( int  )

Definition at line 457 of file oral.h.

template<typename >
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKeyImpl ( float  )

Definition at line 463 of file oral.h.

template<typename Seq >
constexpr bool LeechCraft::Util::oral::detail::HasPKey ( )

Definition at line 451 of file oral.h.

template<typename Seq , int Idx = FindPKey<Seq>::result_type::value>
constexpr bool LeechCraft::Util::oral::detail::HasPKeyImpl ( int  )

Definition at line 439 of file oral.h.

template<typename Seq >
constexpr bool LeechCraft::Util::oral::detail::HasPKeyImpl ( float  )

Definition at line 445 of file oral.h.

constexpr bool LeechCraft::Util::oral::detail::IsRelational ( ExprType  type)

Definition at line 788 of file oral.h.

References Equal, Geq, Greater, Leq, Less, and Neq.

template<typename T >
std::function<void (T)> LeechCraft::Util::oral::detail::MakeInserter ( CachedFieldsData  data,
QSqlQuery_ptr  insertQuery,
bool  bindPrimaryKey 
)

Definition at line 400 of file oral.h.

References LeechCraft::Util::oral::detail::CachedFieldsData::BoundFields_, and LeechCraft::Util::DBLock::DumpError().

+ Here is the call graph for this function:

bool LeechCraft::Util::oral::detail::MatchesSchema ( const QString &  baseName,
const QString &  schema,
QSqlDatabase &  db 
)

Definition at line 42 of file migrate.h.

References LeechCraft::Util::RunTextQuery().

Referenced by LeechCraft::Util::oral::Migrate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldName ( const QString &  str)

Definition at line 108 of file oral.h.

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldNameImpl ( const QString &  str,
int  ,
decltype &::FieldNameMorpher *  = nullptr 
)

Definition at line 96 of file oral.h.

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldNameImpl ( const QString &  str,
float   
)

Definition at line 102 of file oral.h.

template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree<ExprType::And, ExprTree<LType, LL, LR>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator&& ( const ExprTree< LType, LL, LR > &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 941 of file oral.h.

template<ExprType LType, typename LL , typename LR , typename R >
ExprTree<ExprType::And, ExprTree<LType, LL, LR>, ExprTree<ExprType::LeafData, R> > LeechCraft::Util::oral::detail::operator&& ( const ExprTree< LType, LL, LR > &  left,
const R &  right 
)

Definition at line 947 of file oral.h.

template<ExprType RType, typename RL , typename RR , typename L >
ExprTree<ExprType::And, ExprTree<ExprType::LeafData, L>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator&& ( const L &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 953 of file oral.h.

template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree<ExprType::Less, ExprTree<LType, LL, LR>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator< ( const ExprTree< LType, LL, LR > &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 903 of file oral.h.

template<ExprType LType, typename LL , typename LR , typename R >
ExprTree<ExprType::Less, ExprTree<LType, LL, LR>, ExprTree<ExprType::LeafData, R> > LeechCraft::Util::oral::detail::operator< ( const ExprTree< LType, LL, LR > &  left,
const R &  right 
)

Definition at line 910 of file oral.h.

template<ExprType RType, typename RL , typename RR , typename L >
ExprTree<ExprType::Less, ExprTree<ExprType::LeafData, L>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator< ( const L &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 916 of file oral.h.

template<ExprType LType, typename LL , typename LR , ExprType RType, typename RL , typename RR >
ExprTree<ExprType::Equal, ExprTree<LType, LL, LR>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator== ( const ExprTree< LType, LL, LR > &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 922 of file oral.h.

template<ExprType LType, typename LL , typename LR , typename R >
ExprTree<ExprType::Equal, ExprTree<LType, LL, LR>, ExprTree<ExprType::LeafData, R> > LeechCraft::Util::oral::detail::operator== ( const ExprTree< LType, LL, LR > &  left,
const R &  right 
)

Definition at line 929 of file oral.h.

template<ExprType RType, typename RL , typename RR , typename L >
ExprTree<ExprType::Equal, ExprTree<ExprType::LeafData, L>, ExprTree<RType, RL, RR> > LeechCraft::Util::oral::detail::operator== ( const L &  left,
const ExprTree< RType, RL, RR > &  right 
)

Definition at line 935 of file oral.h.

template<typename T >
QList<T> LeechCraft::Util::oral::detail::PerformSelect ( QSqlQuery_ptr  q)

Definition at line 642 of file oral.h.

QString LeechCraft::Util::oral::detail::TypeToSql ( ExprType  type)
inline

Definition at line 723 of file oral.h.

References And, Equal, Geq, Greater, LeafData, LeafStaticPlaceholder, Leq, Less, Neq, Or, and LeechCraft::Util::Unreachable().

Referenced by LeechCraft::Util::oral::detail::ExprTree< Type, L, R >::ToSql().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

std::function<QList<T>objects_vector)> LeechCraft::Util::oral::detail::SelectByFKeysActor_

Definition at line 1381 of file oral.h.

boost::fusion::result_of::as_vector<transform_view>::type LeechCraft::Util::oral::detail::SingleFKeySelectors_

Definition at line 1384 of file oral.h.