LeechCraft  0.6.70-6645-gcd10d7e
Modular cross-platform feature rich live environment.
oral.h File Reference
#include <stdexcept>
#include <type_traits>
#include <memory>
#include <boost/fusion/include/for_each.hpp>
#include <boost/fusion/include/fold.hpp>
#include <boost/fusion/include/filter_if.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/fusion/include/zip.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/variant/variant.hpp>
#include <boost/optional.hpp>
#include <QStringList>
#include <QDateTime>
#include <QPair>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QVariant>
#include <QtDebug>
#include <util/sll/qtutil.h>
#include <util/sll/prelude.h>
#include <util/sll/typelist.h>
#include <util/sll/oldcppkludges.h>
#include <util/db/dblock.h>
#include <util/db/util.h>
#include "oraltypes.h"
+ Include dependency graph for oral.h:

Go to the source code of this file.

Classes

class  LeechCraft::Util::oral::QueryException
 
struct  LeechCraft::Util::oral::UniqueSubset< Fields >
 
struct  LeechCraft::Util::oral::detail::GetFieldName< Seq, Idx >
 
struct  LeechCraft::Util::oral::detail::GetFieldsNames_< S, N >
 
struct  LeechCraft::Util::oral::detail::GetFieldsNames_< S, typename boost::fusion::result_of::size< S >::type >
 
struct  LeechCraft::Util::oral::detail::GetFieldsNames< S >
 
struct  LeechCraft::Util::oral::detail::GetBoundName< Seq, Idx >
 
struct  LeechCraft::Util::oral::Type2Name< T >
 
struct  LeechCraft::Util::oral::Type2Name< int >
 
struct  LeechCraft::Util::oral::Type2Name< qulonglong >
 
struct  LeechCraft::Util::oral::Type2Name< double >
 
struct  LeechCraft::Util::oral::Type2Name< bool >
 
struct  LeechCraft::Util::oral::Type2Name< QString >
 
struct  LeechCraft::Util::oral::Type2Name< QByteArray >
 
struct  LeechCraft::Util::oral::Type2Name< QDateTime >
 
struct  LeechCraft::Util::oral::Type2Name< Unique< T > >
 
struct  LeechCraft::Util::oral::Type2Name< PKey< T, Tags... > >
 
struct  LeechCraft::Util::oral::Type2Name< PKey< int, Tags... > >
 
struct  LeechCraft::Util::oral::Type2Name< References< Seq, Idx > >
 
struct  LeechCraft::Util::oral::ToVariant< T >
 
struct  LeechCraft::Util::oral::ToVariant< QDateTime >
 
struct  LeechCraft::Util::oral::ToVariant< Unique< T > >
 
struct  LeechCraft::Util::oral::ToVariant< PKey< T, Tags... > >
 
struct  LeechCraft::Util::oral::ToVariant< References< Seq, Idx > >
 
struct  LeechCraft::Util::oral::FromVariant< T >
 
struct  LeechCraft::Util::oral::FromVariant< QDateTime >
 
struct  LeechCraft::Util::oral::FromVariant< Unique< T > >
 
struct  LeechCraft::Util::oral::FromVariant< PKey< T, Tags... > >
 
struct  LeechCraft::Util::oral::FromVariant< References< Seq, Idx > >
 
struct  LeechCraft::Util::oral::detail::Types
 
struct  LeechCraft::Util::oral::detail::Inserter
 
struct  LeechCraft::Util::oral::detail::Selector
 
struct  LeechCraft::Util::oral::detail::CachedFieldsData
 
struct  LeechCraft::Util::oral::detail::Lazy< T >
 
struct  LeechCraft::Util::oral::detail::FindPKey< Seq, MemberIdx >
 
struct  LeechCraft::Util::oral::detail::AdaptInsert< Seq >
 
struct  LeechCraft::Util::oral::detail::AdaptInsert< Seq >::PrivateTag
 
struct  LeechCraft::Util::oral::detail::FieldsUnpacker< HeadT, TailT >
 
struct  LeechCraft::Util::oral::detail::FieldsUnpacker< HeadT >
 
struct  LeechCraft::Util::oral::detail::ValueBinder< FieldsUnpacker, HeadArg, TailArgs >
 
struct  LeechCraft::Util::oral::detail::ValueBinder< FieldsUnpacker, HeadArg >
 
struct  LeechCraft::Util::oral::detail::IsLeaf< Type >
 
struct  LeechCraft::Util::oral::detail::IsLeaf< ExprType::LeafStaticPlaceholder >
 
struct  LeechCraft::Util::oral::detail::IsLeaf< ExprType::LeafData >
 
struct  LeechCraft::Util::oral::detail::IsCompatible< Type1, Type2 >
 
struct  LeechCraft::Util::oral::detail::IsCompatible< Type, ExprType::And >
 
struct  LeechCraft::Util::oral::detail::IsCompatible< Type, ExprType::Or >
 
struct  LeechCraft::Util::oral::detail::IsCompatible< Type, ExprType::LeafStaticPlaceholder >
 
struct  LeechCraft::Util::oral::detail::IsCompatible< Type, ExprType::LeafData >
 
struct  LeechCraft::Util::oral::detail::ToSqlState< T >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesChecker< Type, Seq, L, R, typename >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesCheckerBase< Seq, L, R, typename >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesChecker< Type, Seq, L, R, EnableIf_t< IsRelational(Type)> >
 
class  LeechCraft::Util::oral::detail::ExprTree< Type, L, R >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >, void >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::LeafData, T, void >
 
struct  LeechCraft::Util::oral::detail::IsExprTree< T >
 
struct  LeechCraft::Util::oral::detail::IsExprTree< ExprTree< Type, L, R > >
 
class  LeechCraft::Util::oral::detail::SelectByFieldsWrapper< T >
 
class  LeechCraft::Util::oral::detail::SelectOneByFieldsWrapper< T >
 
class  LeechCraft::Util::oral::detail::DeleteByFieldsWrapper< T >
 
struct  LeechCraft::Util::oral::detail::FieldInfo< OrigSeq, OrigIdx, RefSeq, MemberIdx >
 
struct  LeechCraft::Util::oral::detail::FieldAppender< To, OrigSeq, OrigIdx, T >
 
struct  LeechCraft::Util::oral::detail::FieldAppender< To, OrigSeq, OrigIdx, References< RefSeq, RefIdx > >
 
struct  LeechCraft::Util::oral::detail::CollectRefs_< Seq, MemberIdx >
 
struct  LeechCraft::Util::oral::detail::CollectRefs_< Seq, typename boost::fusion::result_of::size< Seq >::type >
 
struct  LeechCraft::Util::oral::detail::CollectRefs< Seq >
 
struct  LeechCraft::Util::oral::detail::Ref2Select
 
struct  LeechCraft::Util::oral::detail::ExtrObj< T >
 
struct  LeechCraft::Util::oral::detail::ExtrObj< FieldInfo< OrigSeq, OrigIdx, RefSeq, MemberIdx > >
 
struct  LeechCraft::Util::oral::detail::SingleBind
 
struct  LeechCraft::Util::oral::detail::MakeBinder< T, RefSeq >
 
struct  LeechCraft::Util::oral::detail::WrapAsFunc< T, Ret >
 
struct  LeechCraft::Util::oral::detail::MakeSingleBinder< T >
 
struct  LeechCraft::Util::oral::ObjectInfo< T >
 

Namespaces

 LeechCraft
 
 LeechCraft::Util
 
 LeechCraft::Util::oral
 
 LeechCraft::Util::oral::detail
 
 LeechCraft::Util::oral::sph
 

Typedefs

using QSqlQuery_ptr = std::shared_ptr< QSqlQuery >
 
template<typename... Args>
using LeechCraft::Util::oral::Constraints = Typelist< Args... >
 
template<typename Seq , int Idx>
using LeechCraft::Util::oral::detail::ValueAtC_t = typename boost::fusion::result_of::value_at_c< Seq, Idx >::type
 
template<typename Seq , typename Idx >
using LeechCraft::Util::oral::detail::ValueAt_t = typename boost::fusion::result_of::value_at< Seq, Idx >::type
 
template<int Idx>
using LeechCraft::Util::oral::sph::pos = detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >>
 
template<typename T , typename Ret >
using LeechCraft::Util::oral::detail::WrapAsFunc_t = typename WrapAsFunc< T, Ret >::type
 
using LeechCraft::Util::oral::detail::transform_view = typename boost::mpl::transform< objects_vector, WrapAsFunc< boost::mpl::_1, T >>::type
 
template<typename T >
using LeechCraft::Util::oral::ObjectInfo_ptr = std::shared_ptr< ObjectInfo< T >>
 

Enumerations

enum  LeechCraft::Util::oral::InsertAction {
  LeechCraft::Util::oral::InsertAction::Default,
  LeechCraft::Util::oral::InsertAction::Ignore,
  LeechCraft::Util::oral::InsertAction::Replace
}
 
enum  LeechCraft::Util::oral::detail::ExprType {
  LeechCraft::Util::oral::detail::ExprType::LeafStaticPlaceholder,
  LeechCraft::Util::oral::detail::ExprType::LeafData,
  LeechCraft::Util::oral::detail::ExprType::Greater,
  LeechCraft::Util::oral::detail::ExprType::Less,
  LeechCraft::Util::oral::detail::ExprType::Equal,
  LeechCraft::Util::oral::detail::ExprType::Geq,
  LeechCraft::Util::oral::detail::ExprType::Leq,
  LeechCraft::Util::oral::detail::ExprType::Neq,
  LeechCraft::Util::oral::detail::ExprType::And,
  LeechCraft::Util::oral::detail::ExprType::Or
}
 

Functions

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldNameImpl (const QString &str, int, decltype(&T::FieldNameMorpher)*=nullptr)
 
template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldNameImpl (const QString &str, float)
 
template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldName (const QString &str)
 
template<typename T >
std::function< void(T)> LeechCraft::Util::oral::detail::MakeInserter (CachedFieldsData data, QSqlQuery_ptr insertQuery, bool bindPrimaryKey)
 
template<typename Seq , int Idx = FindPKey<Seq>::result_type::value>
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKeyImpl (int)
 
template<typename >
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKeyImpl (float)
 
template<typename Seq >
constexpr bool LeechCraft::Util::oral::detail::HasAutogenPKey ()
 
QString LeechCraft::Util::oral::detail::GetInsertPrefix (InsertAction action)
 
template<typename T >
std::function< void(T)> LeechCraft::Util::oral::detail::AdaptUpdate (const CachedFieldsData &data)
 
template<typename T >
std::function< void(T)> LeechCraft::Util::oral::detail::AdaptDelete (CachedFieldsData data)
 
template<typename T >
QList< T > LeechCraft::Util::oral::detail::PerformSelect (QSqlQuery_ptr q)
 
template<typename T >
std::function< QList< T >)> LeechCraft::Util::oral::detail::AdaptSelectAll (const CachedFieldsData &data)
 
QString LeechCraft::Util::oral::detail::TypeToSql (ExprType type)
 
template<typename T >
constexpr T LeechCraft::Util::oral::detail::Ctfy (T t)
 
template<ExprType T1, ExprType T2>
constexpr bool LeechCraft::Util::oral::detail::CheckCompatible ()
 
constexpr bool LeechCraft::Util::oral::detail::IsRelational (ExprType type)
 
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)
 
template<typename Seq , typename L , typename R >
constexpr bool LeechCraft::Util::oral::detail::AreComparableTypesImpl (float)
 
template<typename Seq , typename L , typename R >
constexpr bool LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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 > > LeechCraft::Util::oral::detail::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)> > LeechCraft::Util::oral::detail::HandleExprTree (const ExprTree< Type, L, R > &tree)
 
template<typename T >
SelectByFieldsWrapper< T > LeechCraft::Util::oral::detail::AdaptSelectFields (const CachedFieldsData &data)
 
template<typename T >
SelectOneByFieldsWrapper< T > LeechCraft::Util::oral::detail::AdaptSelectOneFields (const CachedFieldsData &data)
 
template<typename T >
DeleteByFieldsWrapper< T > LeechCraft::Util::oral::detail::AdaptDeleteFields (const CachedFieldsData &data)
 
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 T >
ObjectInfo< T > LeechCraft::Util::oral::Adapt (const QSqlDatabase &db)
 
template<typename T >
ObjectInfo_ptr< T > LeechCraft::Util::oral::AdaptPtr (const QSqlDatabase &db)
 

Variables

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

Typedef Documentation

using QSqlQuery_ptr = std::shared_ptr<QSqlQuery>

Definition at line 61 of file oral.h.