QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
IxClass.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** https://www.qxorm.com/
4** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
5**
6** This file is part of the QxOrm library
7**
8** This software is provided 'as-is', without any express or implied
9** warranty. In no event will the authors be held liable for any
10** damages arising from the use of this software
11**
12** Commercial Usage
13** Licensees holding valid commercial QxOrm licenses may use this file in
14** accordance with the commercial license agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Lionel Marty
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3.0 as published by the Free Software
21** Foundation and appearing in the file 'license.gpl3.txt' included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU General Public License version 3.0 requirements will be
24** met : http://www.gnu.org/copyleft/gpl.html
25**
26** If you are unsure which license is appropriate for your use, or
27** if you have questions regarding the use of this file, please contact :
28** contact@qxorm.com
29**
30****************************************************************************/
31
32#ifndef _IX_CLASS_H_
33#define _IX_CLASS_H_
34
35#ifdef _MSC_VER
36#pragma once
37#endif
38
46#ifndef _QX_NO_RTTI
47#include <typeinfo>
48#endif // _QX_NO_RTTI
49
51
53
55
56#include <QxDao/QxSoftDelete.h>
57
59
60namespace qx {
61
62class IxSqlRelation;
63
69{
70
71private:
72
73 struct IxClassImpl;
74 std::unique_ptr<IxClassImpl> m_pImpl;
75
76protected:
77
79 virtual ~IxClass() = 0;
80
81public:
82
83 QString getKey() const;
84 QString getName() const;
85 const char * getNamePtr() const;
86 QString getDescription() const;
87 long getVersion() const;
90 bool isFinalClass() const;
91 bool isDaoReadOnly() const;
92 bool isRegistered() const;
96 std::shared_ptr<QxCollection<QString, IxSqlRelation *> > getSqlRelationX();
97 std::shared_ptr<QxCollection<QString, IxDataMember *> > getSqlDataMemberX();
98
99 void setKey(const QString & s);
100 void setName(const QString & s);
101 void setDescription(const QString & s);
104 void setDaoReadOnly(bool b);
105 void setVersion(long l);
106
107 virtual bool isAbstract() const = 0;
108 virtual bool implementIxPersistable() const = 0;
109 virtual IxClass * getBaseClass() const = 0;
111
112 IxDataMember * getId(bool bRecursive = false) const;
113 bool isKindOf(const QString & sClassName) const;
114 QString dumpClass() const;
115
116#ifndef _QX_NO_RTTI
117 virtual const std::type_info & typeInfo() const = 0;
118 bool isKindOf(const std::type_info & typeInfo) const;
119#endif // _QX_NO_RTTI
120
121protected:
122
124 void setRegistered(bool b);
125 void setFinalClass(bool b);
130
131};
132
133typedef std::shared_ptr<IxClass> IxClass_ptr;
134
135} // namespace qx
136
137#endif // _IX_CLASS_H_
Common interface for a list of IxDataMember class properties registered into QxOrm context (for examp...
Common interface for all functions registered into QxOrm context (used by introspection engine)
Common interface for a list of validators.
#define QX_DLL_EXPORT
Definition QxMacro.h:182
Used by introspection engine (IxClass, IxDataMember, IxFunction, etc.) to add meta-data (property bag...
Soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead o...
qx::IxClass : common interface for all classes registered into QxOrm context
Definition IxClass.h:69
virtual IxClass * getBaseClass() const =0
void setFctStaticX(IxFunctionX *p)
IxDataMember * getId(bool bRecursive=false) const
bool isDaoReadOnly() const
QString getDescription() const
qx::dao::strategy::inheritance getDaoStrategy() const
IxFunctionX * getFctStaticX() const
void setDataMemberX(IxDataMemberX *p)
QString dumpClass() const
bool isFinalClass() const
bool isKindOf(const QString &sClassName) const
void setDaoReadOnly(bool b)
bool isRegistered() const
virtual bool implementIxPersistable() const =0
void setDaoStrategy(qx::dao::strategy::inheritance e)
void setDescription(const QString &s)
IxFunctionX * getFctMemberX() const
void updateClassX()
std::unique_ptr< IxClassImpl > m_pImpl
Private implementation idiom.
Definition IxClass.h:74
virtual IxValidatorX * getAllValidator()
qx::QxSoftDelete getSoftDelete() const
IxDataMemberX * getDataMemberX() const
const char * getNamePtr() const
void setFctMemberX(IxFunctionX *p)
void setFinalClass(bool b)
virtual bool isAbstract() const =0
void setSoftDelete(const qx::QxSoftDelete &o)
long getVersion() const
QString getName() const
void setVersion(long l)
std::shared_ptr< QxCollection< QString, IxDataMember * > > getSqlDataMemberX()
bool isKindOf(const std::type_info &typeInfo) const
QString getKey() const
IxValidatorX_ptr & getAllValidatorRef()
std::shared_ptr< QxCollection< QString, IxSqlRelation * > > getSqlRelationX()
virtual const std::type_info & typeInfo() const =0
void setKey(const QString &s)
virtual ~IxClass()=0
void setName(const QString &s)
void setRegistered(bool b)
qx::IxDataMember : common interface for all class properties registered into QxOrm context
qx::IxDataMemberX : common interface for a list of IxDataMember class properties registered into QxOr...
qx::IxValidatorX : common interface for a list of validators
qx::QxCollection<Key, Value> : QxOrm thread-safe container (keep insertion order + quick access by in...
qx::QxPropertyBag : used by introspection engine (IxClass, IxDataMember, IxFunction,...
qx::QxSoftDelete : soft delete (or logical delete) behavior to update a row into database (flag it as...
Root namespace for all QxOrm library features.
std::shared_ptr< IxValidatorX > IxValidatorX_ptr
std::shared_ptr< IxClass > IxClass_ptr
Definition IxClass.h:133