Попытка раскидать по библиотекам
This commit is contained in:
48
src/database/book_s.h
Normal file
48
src/database/book_s.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// file : hello/person.hxx
|
||||
// copyright : not copyrighted - public domain
|
||||
|
||||
#ifndef BOOK_S_H
|
||||
#define BOOK_S_H
|
||||
|
||||
// #include <QtCore/QObject>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <odb/core.hxx>
|
||||
|
||||
#include "author_s.h"
|
||||
|
||||
#pragma db object
|
||||
class __attribute__((visibility("default"))) Book_S
|
||||
{
|
||||
public:
|
||||
Book_S() = default;
|
||||
|
||||
Book_S(const std::string& name,
|
||||
const std::shared_ptr<Author_S>& author,
|
||||
const int year)
|
||||
{
|
||||
m_author = author;
|
||||
m_name = name;
|
||||
m_year = year;
|
||||
};
|
||||
|
||||
unsigned long long id() const { return m_id; }
|
||||
std::shared_ptr<Author_S> author() const { return m_author; }
|
||||
std::string name() const { return m_name; }
|
||||
int year() const { return m_year; }
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
unsigned long long m_id;
|
||||
|
||||
std::shared_ptr<Author_S> m_author;
|
||||
std::string m_name;
|
||||
int m_year;
|
||||
};
|
||||
|
||||
#endif // BOOK_S_H
|
||||
Reference in New Issue
Block a user