QxOrm  1.5.0
C++ Object Relational Mapping library
QxFunctionMacro.h File Reference

Go to the source code of this file.

Defines

#define QX_FUNCTION_CLASS_FCT(className)
#define QX_FUNCTION_CLASS_MEMBER_FCT(className)
#define QX_FUNCTION_CATCH_AND_RETURN_INVOKE()
#define QX_FUNCTION_INVOKE_START_WITH_OWNER()
#define QX_FUNCTION_INVOKE_START_WITHOUT_OWNER()
#define QX_FUNCTION_FETCH_PARAM(TYPE, VALUE, FCT)
#define QX_FUNCTION_GET_PARAM_TYPE_ANY(PARAMCOUNT)
#define QX_FUNCTION_GET_PARAM_TYPE_STRING(PARAMCOUNT)
#define QX_FUNCTION_GET_PARAM_TYPE_STRING_TO_QSTRING(PARAMCOUNT)

Define Documentation

#define QX_FUNCTION_CATCH_AND_RETURN_INVOKE ( )
Value:
catch (const std::exception & e) { bValid = qx_bool(false, 0, e.what()); } \
catch (...) { bValid = qx_bool(false, 0, QX_FUNCTION_ERR_UNKNOWN_ERROR); } \
if (! bValid) { QString sMsgDebug = bValid.getDesc(); qDebug("[QxOrm] %s", qPrintable(sMsgDebug)); qAssert(false); } \
return bValid;

Definition at line 73 of file QxFunctionMacro.h.

#define QX_FUNCTION_CLASS_FCT (   className)
Value:
public: \
type_fct m_fct; \
className(type_fct fct) : IxFunction(), m_fct(fct) { ; }; \
virtual ~className() { ; }; \
virtual qx_bool invoke(const QString & params = QString(), qx::any * ret = NULL) const \
{ return QxInvokerFct<QString, ! std::is_same<R, void>::value>::invoke(params, ret, this); } \
virtual qx_bool invoke(const type_any_params & params, qx::any * ret = NULL) const \
{ return QxInvokerFct<type_any_params, ! std::is_same<R, void>::value>::invoke(params, ret, this); } \
virtual qx_bool invoke(void * pOwner, const QString & params = QString(), qx::any * ret = NULL) const \
{ Q_UNUSED(pOwner); Q_UNUSED(params); Q_UNUSED(ret); qAssert(false); return qx_bool(false, 0, QX_FUNCTION_ERR_INVALID_INVOKE_CALL); } \
virtual qx_bool invoke(void * pOwner, const type_any_params & params, qx::any * ret = NULL) const \
{ Q_UNUSED(pOwner); Q_UNUSED(params); Q_UNUSED(ret); qAssert(false); return qx_bool(false, 0, QX_FUNCTION_ERR_INVALID_INVOKE_CALL); } \
virtual qx_bool isValidFct() const \
{ return ((! m_fct) ? qx_bool(false, 0, QX_FUNCTION_ERR_EMPTY_FCT) : qx_bool(true)); }

Definition at line 41 of file QxFunctionMacro.h.

#define QX_FUNCTION_CLASS_MEMBER_FCT (   className)
Value:
public: \
type_fct m_fct; \
className(type_fct fct) : IxFunction(), m_fct(fct) { ; }; \
virtual ~className() { ; }; \
virtual qx_bool invoke(void * pOwner, const QString & params = QString(), qx::any * ret = NULL) const \
{ return QxInvokerFct<QString, ! std::is_same<R, void>::value>::invoke(pOwner, params, ret, this); } \
virtual qx_bool invoke(void * pOwner, const type_any_params & params, qx::any * ret = NULL) const \
{ return QxInvokerFct<type_any_params, ! std::is_same<R, void>::value>::invoke(pOwner, params, ret, this); } \
virtual qx_bool invoke(const QString & params = QString(), qx::any * ret = NULL) const \
{ Q_UNUSED(params); Q_UNUSED(ret); qAssert(false); return qx_bool(false, 0, QX_FUNCTION_ERR_INVALID_INVOKE_CALL); } \
virtual qx_bool invoke(const type_any_params & params, qx::any * ret = NULL) const \
{ Q_UNUSED(params); Q_UNUSED(ret); qAssert(false); return qx_bool(false, 0, QX_FUNCTION_ERR_INVALID_INVOKE_CALL); } \
virtual qx_bool isValidFct() const \
{ return ((! m_fct) ? qx_bool(false, 0, QX_FUNCTION_ERR_EMPTY_MEMBER_FCT) : qx_bool(true)); }

Definition at line 57 of file QxFunctionMacro.h.

#define QX_FUNCTION_FETCH_PARAM (   TYPE,
  VALUE,
  FCT 
)
Value:
typename std::remove_const< TYPE >::type VALUE; \
{ qx_bool bTmp = qx::function::detail::FCT(params, VALUE, pThis); \
if (! bTmp) { QString sMsgDebug = bTmp.getDesc(); qDebug("[QxOrm] %s", qPrintable(sMsgDebug)); qAssert(false); return bTmp; } }

Definition at line 89 of file QxFunctionMacro.h.

#define QX_FUNCTION_GET_PARAM_TYPE_ANY (   PARAMCOUNT)
Value:
Q_UNUSED(qx_fct); \
if (params.size() < PARAMCOUNT) { return qx_bool(false, 0, QX_FUNCTION_ERR_NUMBER_PARAMS); } \
qx_bool bValid = true; \
try { p = qx::any_cast<P>(params[PARAMCOUNT - 1]); } \
catch (...) { bValid = qx_bool(false, 0, QString(QX_FUNCTION_ERR_INVALID_PARAM).replace("XXX", QString::number(PARAMCOUNT))); } \
return bValid;

Definition at line 94 of file QxFunctionMacro.h.

#define QX_FUNCTION_GET_PARAM_TYPE_STRING (   PARAMCOUNT)
Value:
if (! qx_fct) { return qx_bool(false, 0, QX_FUNCTION_ERR_UNKNOWN_ERROR); } \
QStringList lst = params.split(qx_fct->getSeparator()); \
if (lst.size() < PARAMCOUNT) { return qx_bool(false, 0, QX_FUNCTION_ERR_NUMBER_PARAMS); } \
qx_bool bValid = true; \
try { bValid = qx::cvt::from_string(lst.at(PARAMCOUNT - 1), p); } \
catch (...) { bValid = qx_bool(false, 0, QString(QX_FUNCTION_ERR_INVALID_PARAM).replace("XXX", QString::number(PARAMCOUNT))); } \
return bValid;

Definition at line 102 of file QxFunctionMacro.h.

#define QX_FUNCTION_GET_PARAM_TYPE_STRING_TO_QSTRING (   PARAMCOUNT)
Value:
if (! qx_fct) { return qx_bool(false, 0, QX_FUNCTION_ERR_UNKNOWN_ERROR); } \
QStringList lst = params.split(qx_fct->getSeparator()); \
if (lst.size() < PARAMCOUNT) { return qx_bool(false, 0, QX_FUNCTION_ERR_NUMBER_PARAMS); } \
p = lst.at(PARAMCOUNT - 1); \
return true;

Definition at line 111 of file QxFunctionMacro.h.

#define QX_FUNCTION_INVOKE_START_WITH_OWNER ( )
Value:
if (ret) { (* ret) = qx::any(); } \
qx_bool bValid = pThis->isValid<T, Owner>(pOwner, params, NULL); \
if (! bValid) { QString sMsgDebug = bValid.getDesc(); qDebug("[QxOrm] %s", qPrintable(sMsgDebug)); qAssert(false); return bValid; }

Definition at line 79 of file QxFunctionMacro.h.

#define QX_FUNCTION_INVOKE_START_WITHOUT_OWNER ( )
Value:
if (ret) { (* ret) = qx::any(); } \
qx_bool bValid = pThis->isValid(params); \
if (! bValid) { QString sMsgDebug = bValid.getDesc(); qDebug("[QxOrm] %s", qPrintable(sMsgDebug)); qAssert(false); return bValid; }

Definition at line 84 of file QxFunctionMacro.h.