first commit
This commit is contained in:
48
test/qxDllSample/dll2/include/Bar.h
Normal file
48
test/qxDllSample/dll2/include/Bar.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef _QX_BAR_H_
|
||||
#define _QX_BAR_H_
|
||||
|
||||
#include "../include/BaseClassTrigger.h"
|
||||
|
||||
class Foo;
|
||||
|
||||
class QX_DLL2_EXPORT Bar : public BaseClassTrigger
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(Bar)
|
||||
QX_PERSISTABLE_HPP(Bar)
|
||||
|
||||
public:
|
||||
|
||||
typedef std::shared_ptr<Foo> Foo_ptr;
|
||||
|
||||
protected:
|
||||
|
||||
QString m_sCode;
|
||||
QString m_sValue;
|
||||
Foo_ptr m_pFoo;
|
||||
|
||||
public:
|
||||
|
||||
Bar() : BaseClassTrigger() { ; }
|
||||
virtual ~Bar() { ; }
|
||||
|
||||
virtual void makeAbstractClass() { ; }
|
||||
|
||||
QString getCode() const { return m_sCode; }
|
||||
QString getValue() const { return m_sValue; }
|
||||
Foo_ptr getFoo() const { return m_pFoo; }
|
||||
|
||||
void setCode(const QString & s) { m_sCode = s; }
|
||||
void setValue(const QString & s) { m_sValue = s; }
|
||||
void setFoo(Foo_ptr p) { m_pFoo = p; }
|
||||
void setFoo(long l);
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_DLL2(Bar, BaseClassTrigger, 0)
|
||||
|
||||
typedef std::shared_ptr<Bar> Bar_ptr;
|
||||
typedef std::vector<Bar_ptr> BarX;
|
||||
typedef std::shared_ptr<BarX> BarX_ptr;
|
||||
|
||||
#endif // _QX_BAR_H_
|
||||
67
test/qxDllSample/dll2/include/BaseClassTrigger.h
Normal file
67
test/qxDllSample/dll2/include/BaseClassTrigger.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef _QX_BASE_CLASS_TRIGGER_H_
|
||||
#define _QX_BASE_CLASS_TRIGGER_H_
|
||||
|
||||
class QX_DLL2_EXPORT BaseClassTrigger : public qx::IxPersistable
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(BaseClassTrigger)
|
||||
|
||||
protected:
|
||||
|
||||
long m_id;
|
||||
QDateTime m_dateCreation;
|
||||
QDateTime m_dateModification;
|
||||
QString m_userCreation;
|
||||
QString m_userModification;
|
||||
|
||||
public:
|
||||
|
||||
BaseClassTrigger() : m_id(0) { ; }
|
||||
virtual ~BaseClassTrigger() { ; }
|
||||
|
||||
virtual void makeAbstractClass() = 0;
|
||||
|
||||
long getId() const { return m_id; }
|
||||
QDateTime getDateCreation() const { return m_dateCreation; }
|
||||
QDateTime getDateModification() const { return m_dateModification; }
|
||||
QString getUserCreation() const { return m_userCreation; }
|
||||
QString getUserModification() const { return m_userModification; }
|
||||
|
||||
void setId(long l) { m_id = l; }
|
||||
void setDateCreation(const QDateTime & dt) { m_dateCreation = dt; }
|
||||
void setDateModification(const QDateTime & dt) { m_dateModification = dt; }
|
||||
void setUserCreation(const QString & s) { m_userCreation = s; }
|
||||
void setUserModification(const QString & s) { m_userModification = s; }
|
||||
|
||||
void onBeforeInsert(qx::dao::detail::IxDao_Helper * dao);
|
||||
void onBeforeUpdate(qx::dao::detail::IxDao_Helper * dao);
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_ABSTRACT_CLASS(BaseClassTrigger)
|
||||
QX_REGISTER_HPP_QX_DLL2(BaseClassTrigger, qx::trait::no_base_class_defined, 0)
|
||||
|
||||
namespace qx {
|
||||
namespace dao {
|
||||
namespace detail {
|
||||
|
||||
template <>
|
||||
struct QxDao_Trigger<BaseClassTrigger>
|
||||
{
|
||||
|
||||
static inline void onBeforeInsert(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->onBeforeInsert(dao); } }
|
||||
static inline void onBeforeUpdate(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->onBeforeUpdate(dao); } }
|
||||
static inline void onBeforeDelete(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
static inline void onBeforeFetch(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
static inline void onAfterInsert(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
static inline void onAfterUpdate(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
static inline void onAfterDelete(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
static inline void onAfterFetch(BaseClassTrigger * t, qx::dao::detail::IxDao_Helper * dao) { Q_UNUSED(t); Q_UNUSED(dao); }
|
||||
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace dao
|
||||
} // namespace qx
|
||||
|
||||
#endif // _QX_BASE_CLASS_TRIGGER_H_
|
||||
105
test/qxDllSample/dll2/include/CTestAll.h
Normal file
105
test/qxDllSample/dll2/include/CTestAll.h
Normal file
@@ -0,0 +1,105 @@
|
||||
#ifndef _QX_CLASS_TEST_ALL_H_
|
||||
#define _QX_CLASS_TEST_ALL_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <QtGui/qcolor.h>
|
||||
#include <QtGui/qfont.h>
|
||||
#include <QtGui/qimage.h>
|
||||
#include <QtGui/qbrush.h>
|
||||
#include <QtGui/qpicture.h>
|
||||
#include <QtGui/qpixmap.h>
|
||||
#include <QtGui/qregion.h>
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
#include <QtGui/qmatrix.h>
|
||||
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
|
||||
#include "../../dll1/include/CPerson.h"
|
||||
#include "../../dll2/include/CUser.h"
|
||||
|
||||
class QX_DLL2_EXPORT CTestAll
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(CTestAll)
|
||||
|
||||
protected:
|
||||
|
||||
long m_lId;
|
||||
qx_bool m_oQxBool;
|
||||
|
||||
std::string m_oStdString;
|
||||
std::pair<QPoint, QRect> m_oStdPair;
|
||||
std::vector< QSharedPointer<qx::test::CPerson> > m_oStdVector;
|
||||
std::list<QDateTime> m_oStdList;
|
||||
std::map<std::string, QSharedPointer<CUser> > m_oStdMap;
|
||||
std::shared_ptr<QObject> m_oBoostSharedPtr;
|
||||
|
||||
#ifdef _QX_ENABLE_BOOST
|
||||
boost::tuple<QTime, QPoint, QUrl> m_oBoostTuple;
|
||||
boost::scoped_ptr<QSize> m_oBoostScopedPtr;
|
||||
boost::weak_ptr<CTestAll> m_oBoostWeakPtr;
|
||||
boost::unordered_map<long, std::string> m_oBoostUnorderedMap;
|
||||
#endif // _QX_ENABLE_BOOST
|
||||
|
||||
QString m_oQString;
|
||||
QObject m_oQObject;
|
||||
QBrush m_oQBrush;
|
||||
QByteArray m_oQByteArray;
|
||||
QColor m_oQColor;
|
||||
QDate m_oQDate;
|
||||
QDateTime m_oQDateTime;
|
||||
QTime m_oQTime;
|
||||
QFont m_oQFont;
|
||||
QImage m_oQImage;
|
||||
QPicture m_oQPicture;
|
||||
QPoint m_oQPoint;
|
||||
QRect m_oQRect;
|
||||
QSize m_oQSize;
|
||||
QRegion m_oQRegion;
|
||||
QUrl m_oQUrl;
|
||||
QVariant m_oQVariant;
|
||||
QStringList m_oQStringList;
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QMatrix m_oQMatrix;
|
||||
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QRegExp m_oQRegExp;
|
||||
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
|
||||
QHash<long, QString> m_oQHash;
|
||||
QMultiHash<QString, std::shared_ptr<qx::test::CPerson> > m_oQMultiHash;
|
||||
QMap<double, std::string> m_oQMap;
|
||||
QMultiMap<std::string, QSharedPointer<CUser> > m_oQMultiMap;
|
||||
qx::QxCollection<QString, std::tuple<long, qx::test::CPerson *> > m_oQxCollection;
|
||||
|
||||
QList<float> m_oQList;
|
||||
QVector<CUser *> m_oQVector;
|
||||
QSharedPointer<std::tuple<int, std::string, std::shared_ptr<qx::test::CPerson> > > m_oQSharedPointer;
|
||||
QPair<QString, QPoint> m_oQPair;
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
QLinkedList<QString> m_oQLinkedList;
|
||||
#endif // (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
|
||||
public:
|
||||
|
||||
CTestAll() { init(); }
|
||||
virtual ~CTestAll() { terminate(); }
|
||||
|
||||
static void test();
|
||||
|
||||
private:
|
||||
|
||||
void init();
|
||||
void terminate();
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_DLL2(CTestAll, qx::trait::no_base_class_defined, 1)
|
||||
|
||||
#endif // _QX_CLASS_TEST_ALL_H_
|
||||
54
test/qxDllSample/dll2/include/CUser.h
Normal file
54
test/qxDllSample/dll2/include/CUser.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef _QX_CLASS_USER_H_
|
||||
#define _QX_CLASS_USER_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef _QX_NO_PRECOMPILED_HEADER
|
||||
#ifndef Q_MOC_RUN
|
||||
#include "../include/precompiled.h" // Need to include precompiled header for the generated moc file
|
||||
#endif // Q_MOC_RUN
|
||||
#endif // _QX_NO_PRECOMPILED_HEADER
|
||||
|
||||
#include "../../dll1/include/CPerson.h"
|
||||
|
||||
class QX_DLL2_EXPORT CUser : public qx::test::CPerson
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
QX_REGISTER_FRIEND_CLASS(CUser)
|
||||
|
||||
protected:
|
||||
|
||||
long m_lUserId;
|
||||
QString m_sProfil;
|
||||
qx_bool m_bIsAdmin;
|
||||
QDateTime m_dtModif;
|
||||
qx::test::CPerson * m_pBrother;
|
||||
|
||||
public:
|
||||
|
||||
CUser() : qx::test::CPerson(), m_lUserId(0), m_pBrother(NULL) { ; }
|
||||
CUser(long lId) : qx::test::CPerson(), m_lUserId(lId), m_pBrother(NULL) { ; }
|
||||
virtual ~CUser() { if (m_pBrother) { delete m_pBrother; m_pBrother = NULL; } }
|
||||
|
||||
void test();
|
||||
|
||||
long getUserId() const { return m_lUserId; }
|
||||
QString getProfil() const { return m_sProfil; }
|
||||
qx_bool getIsAdmin() const { return m_bIsAdmin; }
|
||||
QDateTime getDateModif() const { return m_dtModif; }
|
||||
qx::test::CPerson * getBrother() const { return m_pBrother; }
|
||||
|
||||
void setUserId(long l) { m_lUserId = l; }
|
||||
void setProfil(const QString & s) { m_sProfil = s; }
|
||||
void setIsAdmin(qx_bool b) { m_bIsAdmin = b; }
|
||||
void setDateModif(const QDateTime & dt) { m_dtModif = dt; }
|
||||
void setBrother(qx::test::CPerson * p) { if (m_pBrother) { delete m_pBrother; } m_pBrother = p; }
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_DLL2(CUser, qx::test::CPerson, 2)
|
||||
|
||||
#endif // _QX_CLASS_USER_H_
|
||||
67
test/qxDllSample/dll2/include/Foo.h
Normal file
67
test/qxDllSample/dll2/include/Foo.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef _QX_FOO_H_
|
||||
#define _QX_FOO_H_
|
||||
|
||||
#include "../include/BaseClassTrigger.h"
|
||||
#include "../include/Bar.h"
|
||||
|
||||
class QX_DLL2_EXPORT Foo : public BaseClassTrigger
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(Foo)
|
||||
QX_PERSISTABLE_HPP(Foo)
|
||||
|
||||
protected:
|
||||
|
||||
QString m_sName;
|
||||
QVariant m_sDesc;
|
||||
BarX_ptr m_pBarX;
|
||||
|
||||
qx::QxDateNeutral m_oDateNeutral;
|
||||
qx::QxTimeNeutral m_oTimeNeutral;
|
||||
qx::QxDateTimeNeutral m_oDateTimeNeutral;
|
||||
|
||||
#ifdef _QX_ENABLE_BOOST
|
||||
boost::optional<int> m_optInt;
|
||||
boost::optional<QString> m_optString;
|
||||
#endif // _QX_ENABLE_BOOST
|
||||
|
||||
public:
|
||||
|
||||
Foo() : BaseClassTrigger() { ; }
|
||||
virtual ~Foo() { ; }
|
||||
|
||||
virtual void makeAbstractClass() { ; }
|
||||
|
||||
QString getName() const { return m_sName; }
|
||||
QVariant getDesc() const { return m_sDesc; }
|
||||
BarX * getBarX() const { return m_pBarX.get(); }
|
||||
QDate getDate() const { return m_oDateNeutral.toDate(); }
|
||||
QTime getTime() const { return m_oTimeNeutral.toTime(); }
|
||||
QDateTime getDateTime() const { return m_oDateTimeNeutral.toDateTime(); }
|
||||
|
||||
#ifdef _QX_ENABLE_BOOST
|
||||
boost::optional<int> getOptInt() const { return m_optInt; }
|
||||
boost::optional<QString> getOptString() const { return m_optString; }
|
||||
#endif // _QX_ENABLE_BOOST
|
||||
|
||||
void setName(const QString & s) { m_sName = s; }
|
||||
void setDesc(const QVariant & s) { m_sDesc = s; }
|
||||
void setBarX(BarX_ptr p) { m_pBarX = p; }
|
||||
void setDate(const QDate & d) { m_oDateNeutral.setDate(d); }
|
||||
void setTime(const QTime & t) { m_oTimeNeutral.setTime(t); }
|
||||
void setDateTime(const QDateTime & dt) { m_oDateTimeNeutral.setDateTime(dt); }
|
||||
|
||||
#ifdef _QX_ENABLE_BOOST
|
||||
void setOptInt(const boost::optional<int> & opt) { m_optInt = opt; }
|
||||
void setOptString(const boost::optional<QString> & opt) { m_optString = opt; }
|
||||
#endif // _QX_ENABLE_BOOST
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_DLL2(Foo, BaseClassTrigger, 0)
|
||||
|
||||
typedef std::shared_ptr<Foo> Foo_ptr;
|
||||
typedef qx::QxCollection<long, Foo_ptr> FooX;
|
||||
typedef std::shared_ptr<FooX> FooX_ptr;
|
||||
|
||||
#endif // _QX_FOO_H_
|
||||
28
test/qxDllSample/dll2/include/export.h
Normal file
28
test/qxDllSample/dll2/include/export.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef _QX_DLL2_EXPORT_H_
|
||||
#define _QX_DLL2_EXPORT_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "../../dll1/include/export.h"
|
||||
|
||||
#ifdef _QX_BUILDING_DLL2
|
||||
#define QX_DLL2_EXPORT QX_DLL_EXPORT_HELPER
|
||||
#else // _QX_BUILDING_DLL2
|
||||
#define QX_DLL2_EXPORT QX_DLL_IMPORT_HELPER
|
||||
#endif // _QX_BUILDING_DLL2
|
||||
|
||||
#ifdef _QX_BUILDING_DLL2
|
||||
#define QX_REGISTER_HPP_QX_DLL2 QX_REGISTER_HPP_EXPORT_DLL
|
||||
#define QX_REGISTER_CPP_QX_DLL2 QX_REGISTER_CPP_EXPORT_DLL
|
||||
#define QX_REGISTER_COMPLEX_CLASS_NAME_HPP_QX_DLL2 QX_REGISTER_COMPLEX_CLASS_NAME_HPP_EXPORT_DLL
|
||||
#define QX_REGISTER_COMPLEX_CLASS_NAME_CPP_QX_DLL2 QX_REGISTER_COMPLEX_CLASS_NAME_CPP_EXPORT_DLL
|
||||
#else // _QX_BUILDING_DLL2
|
||||
#define QX_REGISTER_HPP_QX_DLL2 QX_REGISTER_HPP_IMPORT_DLL
|
||||
#define QX_REGISTER_CPP_QX_DLL2 QX_REGISTER_CPP_IMPORT_DLL
|
||||
#define QX_REGISTER_COMPLEX_CLASS_NAME_HPP_QX_DLL2 QX_REGISTER_COMPLEX_CLASS_NAME_HPP_IMPORT_DLL
|
||||
#define QX_REGISTER_COMPLEX_CLASS_NAME_CPP_QX_DLL2 QX_REGISTER_COMPLEX_CLASS_NAME_CPP_IMPORT_DLL
|
||||
#endif // _QX_BUILDING_DLL2
|
||||
|
||||
#endif // _QX_DLL2_EXPORT_H_
|
||||
12
test/qxDllSample/dll2/include/precompiled.h
Normal file
12
test/qxDllSample/dll2/include/precompiled.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _QX_DLL2_PRECOMPILED_HEADER_H_
|
||||
#define _QX_DLL2_PRECOMPILED_HEADER_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <QxOrm.h>
|
||||
|
||||
#include "../include/export.h"
|
||||
|
||||
#endif // _QX_DLL2_PRECOMPILED_HEADER_H_
|
||||
Reference in New Issue
Block a user