| QxOrm 1.2.2 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

Defines
QxFunctionMacro.h File Reference
`#include <boost/utility/value_init.hpp>`

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) { qDebug("[QxOrm] %s", qPrintable(bValid.getDesc())); qAssert(false); } \
    return bValid;

Definition at line 67 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(), boost::any * ret = NULL) const \
    { return QxInvokerFct<QString, ! boost::is_same<R, void>::value>::invoke(params, ret, this); } \
    virtual qx_bool invoke(const type_any_params & params, boost::any * ret = NULL) const \
    { return QxInvokerFct<type_any_params, ! boost::is_same<R, void>::value>::invoke(params, ret, this); } \
    virtual qx_bool invoke(void * pOwner, const QString & params = QString(), boost::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, boost::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.empty() ? qx_bool(false, 0, QX_FUNCTION_ERR_EMPTY_FCT) : qx_bool(true)); }

Definition at line 35 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(), boost::any * ret = NULL) const \
    { return QxInvokerFct<QString, ! boost::is_same<R, void>::value>::invoke(pOwner, params, ret, this); } \
    virtual qx_bool invoke(void * pOwner, const type_any_params & params, boost::any * ret = NULL) const \
    { return QxInvokerFct<type_any_params, ! boost::is_same<R, void>::value>::invoke(pOwner, params, ret, this); } \
    virtual qx_bool invoke(const QString & params = QString(), boost::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, boost::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.empty() ? qx_bool(false, 0, QX_FUNCTION_ERR_EMPTY_MEMBER_FCT) : qx_bool(true)); }

Definition at line 51 of file QxFunctionMacro.h.

#define QX_FUNCTION_FETCH_PARAM | ( |  | TYPE,
|  |  | VALUE,
|  |  | FCT
| ) |  |

Value:

    boost::value_initialized< TYPE > VALUE; \
    { qx_bool bTmp = qx::function::detail::FCT(params, VALUE, pThis); \
    if (! bTmp) { qDebug("[QxOrm] %s", qPrintable(bTmp.getDesc())); qAssert(false); return bTmp; } }

Definition at line 83 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 = boost::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 88 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 { p = boost::lexical_cast<P>(lst.at(PARAMCOUNT - 1).toStdString()); } \
    catch (...) { bValid = qx_bool(false, 0, QString(QX_FUNCTION_ERR_INVALID_PARAM).replace("XXX", QString::number(PARAMCOUNT))); } \
    return bValid;

Definition at line 96 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 105 of file QxFunctionMacro.h.

#define QX_FUNCTION_INVOKE_START_WITH_OWNER | ( |  | ) |

Value:

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

Definition at line 73 of file QxFunctionMacro.h.

#define QX_FUNCTION_INVOKE_START_WITHOUT_OWNER | ( |  | ) |

Value:

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

Definition at line 78 of file QxFunctionMacro.h.