-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAgent.cpp
41 lines (30 loc) · 843 Bytes
/
Agent.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Agent.cpp
*
* Created on: Jun 25, 2018
* Author: Eddie L
*/
#include "Agent.h"
Agent::AgentId Agent::agentId = 1000;
Agent::Agent(const std::string& name, const float commRate)
: m_commissionRate(commRate), m_agentName(name),
m_uniqueAgentId(++Agent::agentId) {
std::cout << "Agent <" << std::left << name
<< "> with commission rate " << commRate
<< " added." << std::endl;
}
Agent::~Agent() = default;
Agent::Agent(Agent&& rhs) = default;
Agent& Agent::operator=(Agent&& rhs) = default;
void Agent::setCommissionRate(const float commRate) {
m_commissionRate = commRate;
}
float Agent::getCommissionRate() const {
return m_commissionRate;
}
Agent::AgentId Agent::getUniqueId() const {
return m_uniqueAgentId;
}
std::string Agent::getName() const {
return m_agentName;
}