LeechCraft  0.6.70-6645-gcd10d7e
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, EnableIf_t< Autogen > *=nullptr)
 
ValueAtC_t< Seq, FindPKey< Seq >
::result_type::value > 
operator() (const Seq &t, InsertAction action=InsertAction::Default) const
 
template<bool Autogen = HasAutogenPKey<Seq> ()>
EnableIf_t<!Autogen > operator() (const Seq &t, InsertAction action=InsertAction::Default) const
 

Public Attributes

const CachedFieldsData Data_
 
const QString InsertSuffix_
 
 PrivateTag
 

Detailed Description

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

Definition at line 458 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 465 of file oral.h.

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

Definition at line 474 of file oral.h.

Member Function Documentation

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

Definition at line 510 of file oral.h.

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

Definition at line 521 of file oral.h.

Member Data Documentation

template<typename Seq>
const QString LeechCraft::Util::oral::detail::AdaptInsert< Seq >::InsertSuffix_
Initial value:
{}
}
{
}
template<bool Autogen = HasAutogenPKey<Seq> ()>
AdaptInsert (const CachedFieldsData& data, EnableIf_t<!Autogen>* = nullptr)
: AdaptInsert { data, PrivateTag {} }
{
}
template<bool Autogen = HasAutogenPKey<Seq> ()>
EnableIf_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<bool Autogen = HasAutogenPKey<Seq> ()>
EnableIf_t<Autogen

Definition at line 486 of file oral.h.


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