some getters added
This commit is contained in:
parent
4fdbc268a5
commit
b2650fad26
2 changed files with 13 additions and 6 deletions
|
@ -12,7 +12,7 @@ Seller::Seller(const std::string& firstName, const std::string& lastName, int se
|
|||
numberOfOfferedArticles_ = numberOfArticles;
|
||||
}
|
||||
|
||||
inline void Seller::setSellerNo(int seller_no) { sellerNo_ = seller_no; }
|
||||
void Seller::setSellerNo(int seller_no) { sellerNo_ = seller_no; }
|
||||
|
||||
inline void Seller::setFirstName(const std::string& firstName) { firstName_ = firstName; }
|
||||
|
||||
|
@ -20,11 +20,15 @@ inline void Seller::setLastName(const std::string& lastName) { lastName_ = lastN
|
|||
|
||||
inline void Seller::setNumberOfOfferedArticles(int number) { numberOfOfferedArticles_ = number; }
|
||||
|
||||
inline size_t Seller::getNumberOfOfferedArticles() { return articles_.size(); }
|
||||
int Seller::getNumberOfOfferedArticles() const { return static_cast<int>(articles_.size()); }
|
||||
|
||||
void Seller::addArticle(Article article) {
|
||||
articles_.push_back(article);
|
||||
}
|
||||
void Seller::addArticle(Article article) { articles_.push_back(article); }
|
||||
|
||||
std::string Seller::getFirstName() const { return firstName_; }
|
||||
|
||||
std::string Seller::getLastName() const { return lastName_; }
|
||||
|
||||
int Seller::getSellerNo() const { return sellerNo_; }
|
||||
|
||||
std::vector<Article*> Seller::getArticles(bool onlySold)
|
||||
{
|
||||
|
|
|
@ -22,8 +22,11 @@ class Seller : public Entity
|
|||
void setNumberOfOfferedArticles(int number);
|
||||
void addArticle(Article article);
|
||||
|
||||
std::string getFirstName() const;
|
||||
std::string getLastName() const;
|
||||
int getSellerNo() const;
|
||||
int getNumberOfOfferedArticles() const;
|
||||
std::vector<Article*> getArticles(bool onlySold = false);
|
||||
size_t getNumberOfOfferedArticles();
|
||||
|
||||
private:
|
||||
int sellerNo_{-1};
|
||||
|
|
Loading…
Reference in a new issue