-
Notifications
You must be signed in to change notification settings - Fork 9
/
Order.h
64 lines (56 loc) · 1.41 KB
/
Order.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __ORDER__H__
#define __ORDER__H__
#include <vector>
#include "Types.h"
/*! \brief Generic Order class
*
* The class implements different market mechanisms : storing, execution, cancellation of orders and so on...
*
*/
class Order
{
friend class Agent;
friend class OrderBook;
friend class Market;
public:
Order();
/*! \brief Generic Agent constructor
*
* \param a_asset asset identifier
* \param a_owner agent identifier
* \param a_time time stamp
* \param a_price price (for limit orders)
* \param a_volume quantity
* \param a_type order type
* \param a_globalOrderIdentifier given by the market : a unique order identifier
*
*/
Order(int a_asset , int a_owner , double a_time , int a_price,
int a_volume , OrderType a_type ,
int a_globalOrderIdentifier);
virtual ~Order();
int getUnderlying() ;
int getIdentifier() ;
int getOwner() ;
int getVolume() ;
int getInitialVolume() ;
int getPrice() ;
double getTime() ;
OrderType getType() ;
void printOrder() ;
void setPrice (int a_price) ;
void setVolume(int a_volume);
void setType(OrderType a_type) ;
private:
int m_asset;
int m_owner;
double m_time;
int m_price;
int m_initialVolume;
int m_volume;
OrderType m_type;
OrderState m_state;
int m_globalOrderIdentifier;
std::vector < ExecutionHistory> m_executionHistory;
};
#endif // __ORDER__H__