marketplace added
This commit is contained in:
parent
f838977283
commit
e04a24f7a1
3 changed files with 31 additions and 0 deletions
|
@ -14,6 +14,7 @@ set(CORE_SOURCES
|
|||
seller.cpp
|
||||
article.cpp
|
||||
sale.cpp
|
||||
marketplace.cpp
|
||||
)
|
||||
|
||||
add_library(core STATIC ${CORE_SOURCES})
|
||||
|
|
9
src/core/marketplace.cpp
Normal file
9
src/core/marketplace.cpp
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include "marketplace.h"
|
||||
#include "database.h"
|
||||
|
||||
void Marketplace::storeToDb() {
|
||||
const std::string DB_PATH{"/tmp/kima2.db"};
|
||||
|
||||
Database db(DB_PATH);
|
||||
db.storeSellers(sellers_);
|
||||
}
|
21
src/core/marketplace.h
Normal file
21
src/core/marketplace.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef MARKETPLACE_H
|
||||
#define MARKETPLACE_H
|
||||
|
||||
#include "article.h"
|
||||
#include "sale.h"
|
||||
#include "seller.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class Marketplace
|
||||
{
|
||||
public:
|
||||
void storeToDb();
|
||||
void loadFromDb();
|
||||
private:
|
||||
std::vector<std::shared_ptr<Seller>> sellers_;
|
||||
//std::vector<std::shared_ptr<Article>> articles_;
|
||||
std::vector<std::shared_ptr<Sale>> sales_;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue