-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathInstrumentActions.h
96 lines (74 loc) · 3.58 KB
/
InstrumentActions.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* Copyright(c) 2017, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
/*
* File: InstrumentActions.h
* Author: rpb
*
* Created on February 25, 2017, 7:57 PM
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
#include <boost/serialization/version.hpp>
#include <boost/serialization/split_member.hpp>
#include <wx/treebase.h>
#include <wx/string.h>
#include <TFTrading/TradingEnumerations.h>
#include <TFBitsNPieces/FirstOrDefaultCombiner.h>
// todo:
// this structure is for messaging
// which suggests this should be sent to worker queues, or futures or packages
// which work in the background, and ultimately generate gui events
class InstrumentActions {
public:
typedef boost::shared_ptr<InstrumentActions> pInstrumentActions_t;
struct values_t {
std::string name_;
ou::tf::Allowed::EInstrument selector;
values_t( void ): selector( ou::tf::Allowed::All ) {}
values_t( const values_t& rhs ): name_( rhs.name_ ), selector( rhs.selector ) {}
values_t( const std::string& name, const ou::tf::Allowed::EInstrument selector_ )
: name_( name ), selector( selector_ ) {}
};
// used in TreeItemInstrument
typedef boost::signals2::signal<values_t (
const wxTreeItemId&, ou::tf::Allowed::EInstrument, const wxString&),
ou::tf::FirstOrDefault<values_t> > signalNewInstrument_t;
typedef signalNewInstrument_t::slot_type slotNewInstrument_t;
signalNewInstrument_t signalNewInstrument;
typedef boost::signals2::signal<void (const wxTreeItemId&, const std::string&, const std::string&)> signalLoadInstrument_t;
typedef signalLoadInstrument_t::slot_type slotLoadInstrument_t;
signalLoadInstrument_t signalLoadInstrument;
typedef boost::signals2::signal<void (const wxTreeItemId&)> signalLiveChart_t;
typedef signalLiveChart_t::slot_type slotLiveChart_t;
signalLiveChart_t signalLiveChart;
typedef boost::signals2::signal<void (const wxTreeItemId&)> signalDailyChart_t;
typedef signalDailyChart_t::slot_type slotDailyChart_t;
signalDailyChart_t signalDailyChart;
typedef boost::signals2::signal<void (const wxTreeItemId&)> signalOptionList_t;
typedef signalOptionList_t::slot_type slotOptionList_t;
signalOptionList_t signalOptionList;
typedef boost::signals2::signal<void (const wxTreeItemId&)> signalEmitValues_t;
typedef signalEmitValues_t::slot_type slotEmitValues_t;
signalEmitValues_t signalEmitValues;
// typedef boost::signals2::signal<void (const wxTreeItemId&)> signalSaveData_t;
// typedef signalSaveData_t::slot_type slotSaveData_t;
// signalSaveData_t signalSaveData;
typedef boost::signals2::signal<void (const wxTreeItemId&)> signalDelete_t;
typedef signalDelete_t::slot_type slotDelete_t;
signalDelete_t signalDelete;
InstrumentActions();
virtual ~InstrumentActions();
protected:
private:
};