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::AdaptInsert< Seq > Struct Template Reference

#include "oral.h"

+ Inheritance diagram for LeechCraft::Util::oral::detail::AdaptInsert< Seq >:
+ Collaboration diagram for LeechCraft::Util::oral::detail::AdaptInsert< Seq >:

Classes

struct  PrivateTag
 

Public Member Functions

 AdaptInsert (const CachedFieldsData &data, const PrivateTag &)
 
template<bool Autogen = HasAutogenPKey<Seq> ()>
 AdaptInsert (CachedFieldsData data, std::enable_if_t< Autogen > *=nullptr)
 
bool ValueAtC_t< SeqPrime,
FindPKey< SeqPrime >
::result_type::value > 
operator() (const Seq &t, InsertAction action=InsertAction::Default) const
 
template<bool Autogen = HasAutogenPKey<Seq> ()>
std::enable_if_t<!Autogenoperator() (const Seq &t, InsertAction action=InsertAction::Default) const
 

Public Attributes

const CachedFieldsData Data_
 
const QString InsertSuffix_
 
 PrivateTag
 
bool Autogen
 

Detailed Description

template<typename Seq>
struct LeechCraft::Util::oral::detail::AdaptInsert< Seq >

Definition at line 490 of file oral.h.

Constructor & Destructor Documentation

template<typename Seq>
LeechCraft::Util::oral::detail::AdaptInsert< Seq >::AdaptInsert ( const CachedFieldsData data,
const PrivateTag  
)
inline

Definition at line 497 of file oral.h.

template<typename Seq>
template<bool Autogen = HasAutogenPKey<Seq> ()>
LeechCraft::Util::oral::detail::AdaptInsert< Seq >::AdaptInsert ( CachedFieldsData  data,
std::enable_if_t< Autogen > *  = nullptr 
)
inline

Definition at line 506 of file oral.h.

Member Function Documentation

template<typename Seq>
bool ValueAtC_t<SeqPrime, FindPKey<SeqPrime>::result_type::value> LeechCraft::Util::oral::detail::AdaptInsert< Seq >::operator() ( const Seq &  t,
InsertAction  action = InsertAction::Default 
) const
inline

Definition at line 542 of file oral.h.

template<typename Seq>
template<bool Autogen = HasAutogenPKey<Seq> ()>
std::enable_if_t<!Autogen> LeechCraft::Util::oral::detail::AdaptInsert< Seq >::operator() ( const Seq &  t,
InsertAction  action = InsertAction::Default 
) const
inline

Definition at line 553 of file oral.h.

Member Data Documentation

template<typename Seq>
bool LeechCraft::Util::oral::detail::AdaptInsert< Seq >::Autogen
Initial value:
= HasAutogenPKey<SeqPrime> ()>
std::enable_if_t<Autogen

Definition at line 540 of file oral.h.

template<typename Seq>
const QString LeechCraft::Util::oral::detail::AdaptInsert< Seq >::InsertSuffix_
Initial value:
{}
}
{
}
template<bool Autogen = HasAutogenPKey<Seq> ()>
AdaptInsert (const CachedFieldsData& data, std::enable_if_t<!Autogen>* = nullptr)
: AdaptInsert { data, PrivateTag {} }
{
}
template<bool Autogen = HasAutogenPKey<Seq> ()>
std::enable_if_t<Autogen> operator() (Seq& t, InsertAction action = InsertAction::Default) const
{
auto query = std::make_shared<QSqlQuery> (Data_.DB_);
query->prepare (GetInsertPrefix (action) + InsertSuffix_);
MakeInserter<Seq> (Data_, query, false) (t);
constexpr auto index = FindPKey<Seq>::result_type::value;
boost::fusion::at_c<index> (t) = FromVariant<ValueAtC_t<Seq, index>> {} (query->lastInsertId ());
}
template<typename SeqPrime = Seq

Definition at line 518 of file oral.h.


The documentation for this struct was generated from the following file: