first commit
This commit is contained in:
48
test/qxBlogPImpl/include/author.h
Normal file
48
test/qxBlogPImpl/include/author.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef _QX_BLOG_AUTHOR_H_
|
||||
#define _QX_BLOG_AUTHOR_H_
|
||||
|
||||
class QX_BLOG_DLL_EXPORT author
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(author)
|
||||
|
||||
private:
|
||||
|
||||
struct author_impl;
|
||||
std::unique_ptr<author_impl> m_pImpl; //!< Private implementation idiom
|
||||
|
||||
public:
|
||||
|
||||
enum enum_sex { male, female, unknown };
|
||||
|
||||
author();
|
||||
virtual ~author();
|
||||
|
||||
author(const author & other);
|
||||
author & operator=(const author & other);
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
author(author && other) Q_DECL_NOEXCEPT;
|
||||
author & operator=(author && other) Q_DECL_NOEXCEPT;
|
||||
#endif // Q_COMPILER_RVALUE_REFS
|
||||
|
||||
int age() const;
|
||||
QString id() const;
|
||||
QString name() const;
|
||||
QDate birthdate() const;
|
||||
enum_sex sex() const;
|
||||
|
||||
void setId(const QString & s);
|
||||
void setName(const QString & s);
|
||||
void setBirthdate(const QDate & d);
|
||||
void setSex(enum_sex e);
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_PRIMARY_KEY(author, QString)
|
||||
QX_REGISTER_HPP_QX_BLOG(author, qx::trait::no_base_class_defined, 0)
|
||||
|
||||
typedef std::shared_ptr<author> author_ptr;
|
||||
typedef qx::QxCollection<QString, author_ptr> list_author;
|
||||
|
||||
#endif // _QX_BLOG_AUTHOR_H_
|
||||
50
test/qxBlogPImpl/include/blog.h
Normal file
50
test/qxBlogPImpl/include/blog.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef _QX_BLOG_BLOG_H_
|
||||
#define _QX_BLOG_BLOG_H_
|
||||
|
||||
class author;
|
||||
class comment;
|
||||
class category;
|
||||
|
||||
class QX_BLOG_DLL_EXPORT blog
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(blog)
|
||||
|
||||
private:
|
||||
|
||||
struct blog_impl;
|
||||
std::unique_ptr<blog_impl> m_pImpl; //!< Private implementation idiom
|
||||
|
||||
public:
|
||||
|
||||
blog();
|
||||
virtual ~blog();
|
||||
|
||||
blog(const blog & other);
|
||||
blog & operator=(const blog & other);
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
blog(blog && other) Q_DECL_NOEXCEPT;
|
||||
blog & operator=(blog && other) Q_DECL_NOEXCEPT;
|
||||
#endif // Q_COMPILER_RVALUE_REFS
|
||||
|
||||
long id() const;
|
||||
QString text() const;
|
||||
QDateTime dateCreation() const;
|
||||
|
||||
void setId(long l);
|
||||
void setText(const QString & s);
|
||||
void setDateCreation(const QDateTime & d);
|
||||
|
||||
std::shared_ptr<author> & getAuthor();
|
||||
QList< std::shared_ptr<comment> > & listOfComments();
|
||||
qx::QxCollection<long, QSharedPointer<category> > & listOfCategories();
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_BLOG(blog, qx::trait::no_base_class_defined, 0)
|
||||
|
||||
typedef std::shared_ptr<blog> blog_ptr;
|
||||
typedef std::vector<blog_ptr> list_blog;
|
||||
|
||||
#endif // _QX_BLOG_BLOG_H_
|
||||
46
test/qxBlogPImpl/include/category.h
Normal file
46
test/qxBlogPImpl/include/category.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _QX_BLOG_CATEGORY_H_
|
||||
#define _QX_BLOG_CATEGORY_H_
|
||||
|
||||
class blog;
|
||||
|
||||
class QX_BLOG_DLL_EXPORT category
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(category)
|
||||
|
||||
private:
|
||||
|
||||
struct category_impl;
|
||||
std::unique_ptr<category_impl> m_pImpl; //!< Private implementation idiom
|
||||
|
||||
public:
|
||||
|
||||
category();
|
||||
virtual ~category();
|
||||
|
||||
category(const category & other);
|
||||
category & operator=(const category & other);
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
category(category && other) Q_DECL_NOEXCEPT;
|
||||
category & operator=(category && other) Q_DECL_NOEXCEPT;
|
||||
#endif // Q_COMPILER_RVALUE_REFS
|
||||
|
||||
long id() const;
|
||||
QString name() const;
|
||||
QString desc() const;
|
||||
|
||||
void setId(long l);
|
||||
void setName(const QString & s);
|
||||
void setDesc(const QString & s);
|
||||
|
||||
qx::QxCollection<long, std::shared_ptr<blog> > & listOfBlogs();
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_BLOG(category, qx::trait::no_base_class_defined, 0)
|
||||
|
||||
typedef QSharedPointer<category> category_ptr;
|
||||
typedef qx::QxCollection<long, category_ptr> list_category;
|
||||
|
||||
#endif // _QX_BLOG_CATEGORY_H_
|
||||
46
test/qxBlogPImpl/include/comment.h
Normal file
46
test/qxBlogPImpl/include/comment.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _QX_BLOG_COMMENT_H_
|
||||
#define _QX_BLOG_COMMENT_H_
|
||||
|
||||
class blog;
|
||||
|
||||
class QX_BLOG_DLL_EXPORT comment
|
||||
{
|
||||
|
||||
QX_REGISTER_FRIEND_CLASS(comment)
|
||||
|
||||
private:
|
||||
|
||||
struct comment_impl;
|
||||
std::unique_ptr<comment_impl> m_pImpl; //!< Private implementation idiom
|
||||
|
||||
public:
|
||||
|
||||
comment();
|
||||
virtual ~comment();
|
||||
|
||||
comment(const comment & other);
|
||||
comment & operator=(const comment & other);
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
comment(comment && other) Q_DECL_NOEXCEPT;
|
||||
comment & operator=(comment && other) Q_DECL_NOEXCEPT;
|
||||
#endif // Q_COMPILER_RVALUE_REFS
|
||||
|
||||
long id() const;
|
||||
QString text() const;
|
||||
QDateTime dateCreation() const;
|
||||
|
||||
void setId(long l);
|
||||
void setText(const QString & s);
|
||||
void setDateCreation(const QDateTime & d);
|
||||
|
||||
std::shared_ptr<blog> & getBlog();
|
||||
|
||||
};
|
||||
|
||||
QX_REGISTER_HPP_QX_BLOG(comment, qx::trait::no_base_class_defined, 0)
|
||||
|
||||
typedef std::shared_ptr<comment> comment_ptr;
|
||||
typedef QList<comment_ptr> list_comment;
|
||||
|
||||
#endif // _QX_BLOG_COMMENT_H_
|
||||
18
test/qxBlogPImpl/include/export.h
Normal file
18
test/qxBlogPImpl/include/export.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _QX_BLOG_EXPORT_H_
|
||||
#define _QX_BLOG_EXPORT_H_
|
||||
|
||||
#ifdef _BUILDING_QX_BLOG
|
||||
#define QX_BLOG_DLL_EXPORT QX_DLL_EXPORT_HELPER
|
||||
#else // _BUILDING_QX_BLOG
|
||||
#define QX_BLOG_DLL_EXPORT QX_DLL_IMPORT_HELPER
|
||||
#endif // _BUILDING_QX_BLOG
|
||||
|
||||
#ifdef _BUILDING_QX_BLOG
|
||||
#define QX_REGISTER_HPP_QX_BLOG QX_REGISTER_HPP_EXPORT_DLL
|
||||
#define QX_REGISTER_CPP_QX_BLOG QX_REGISTER_CPP_EXPORT_DLL
|
||||
#else // _BUILDING_QX_BLOG
|
||||
#define QX_REGISTER_HPP_QX_BLOG QX_REGISTER_HPP_IMPORT_DLL
|
||||
#define QX_REGISTER_CPP_QX_BLOG QX_REGISTER_CPP_IMPORT_DLL
|
||||
#endif // _BUILDING_QX_BLOG
|
||||
|
||||
#endif // _QX_BLOG_EXPORT_H_
|
||||
8
test/qxBlogPImpl/include/precompiled.h
Normal file
8
test/qxBlogPImpl/include/precompiled.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _QX_BLOG_PRECOMPILED_HEADER_H_
|
||||
#define _QX_BLOG_PRECOMPILED_HEADER_H_
|
||||
|
||||
#include <QxOrm.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#endif // _QX_BLOG_PRECOMPILED_HEADER_H_
|
||||
Reference in New Issue
Block a user