41 lines
No EOL
1,019 B
C++
41 lines
No EOL
1,019 B
C++
#ifndef SELLER_H
|
|
#define SELLER_H
|
|
|
|
#include "article.h"
|
|
#include "entity.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class Article;
|
|
|
|
class Seller : public Entity
|
|
{
|
|
public:
|
|
Seller();
|
|
Seller(const std::string& firstName, const std::string& lastName, int sellerNo = 0,
|
|
int numberOfArticles = 0);
|
|
|
|
void setSellerNo(int sellerNo);
|
|
void setFirstName(const std::string& firstName);
|
|
void setLastName(const std::string& lastName);
|
|
void setNumberOfOfferedArticles(int number);
|
|
void addArticle(std::shared_ptr<Article> article);
|
|
|
|
std::string getFirstName() const;
|
|
std::string getLastName() const;
|
|
int getSellerNo() const;
|
|
int getNumberOfOfferedArticles() const;
|
|
size_t soldArticles() const;
|
|
std::vector<Article*> getArticles(bool onlySold = false) const;
|
|
|
|
private:
|
|
int sellerNo_{-1};
|
|
int numberOfOfferedArticles_{};
|
|
std::string firstName_{};
|
|
std::string lastName_{};
|
|
std::vector<std::shared_ptr<Article>> articles_{};
|
|
};
|
|
|
|
#endif |