code beautifying

This commit is contained in:
Martin Brodbeck 2018-07-11 11:53:46 +02:00
parent 59e7634712
commit 4d8396fac1
2 changed files with 18 additions and 18 deletions

View file

@ -1,26 +1,23 @@
#include "seller.h" #include "seller.h"
void Seller::setSellerNo(int seller_no) Seller::Seller() : Entity() {}
{
sellerNo_ = seller_no;
}
void Seller::setFirstName(const std::string& firstName) Seller::Seller(const std::string& firstName, const std::string& lastName, int sellerNo,
int numberOfArticles)
: Entity()
{ {
firstName_ = firstName; firstName_ = firstName;
}
void Seller::setLastName(const std::string& lastName)
{
lastName_ = lastName; lastName_ = lastName;
sellerNo_ = sellerNo;
numberOfOfferedArticles_ = numberOfArticles;
} }
void Seller::setNumberOfOfferedArticles(int number) inline void Seller::setSellerNo(int seller_no) { sellerNo_ = seller_no; }
{
numberOfOfferedArticles_ = number;
}
size_t Seller::getNumberOfOfferedArticles() inline void Seller::setFirstName(const std::string& firstName) { firstName_ = firstName; }
{
return articles_.size(); inline void Seller::setLastName(const std::string& lastName) { lastName_ = lastName; }
}
inline void Seller::setNumberOfOfferedArticles(int number) { numberOfOfferedArticles_ = number; }
inline size_t Seller::getNumberOfOfferedArticles() { return articles_.size(); }

View file

@ -1,8 +1,8 @@
#ifndef SELLER_H #ifndef SELLER_H
#define SELLER_H #define SELLER_H
#include "entity.h"
#include "article.h" #include "article.h"
#include "entity.h"
#include <string> #include <string>
#include <vector> #include <vector>
@ -12,6 +12,9 @@ class Article;
class Seller : public Entity class Seller : public Entity
{ {
public: public:
Seller();
Seller(const std::string& firstName, const std::string& lastName, int sellerNo = 0,
int numberOfArticles = 0);
void setSellerNo(int sellerNo); void setSellerNo(int sellerNo);
void setFirstName(const std::string& firstName); void setFirstName(const std::string& firstName);
void setLastName(const std::string& lastName); void setLastName(const std::string& lastName);