-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathCrossThreadMerge.h
52 lines (40 loc) · 1.94 KB
/
CrossThreadMerge.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
/************************************************************************
* Copyright(c) 2009, 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. *
************************************************************************/
#pragma once
#include <OUWtlCommon/ThreadCrossingMessage.h>
#include <TFTimeSeries/MergeDatedDatums.h>
namespace ou { // One Unified
namespace tf { // TradeFrame
class CCrossThreadMerge:
public CMergeDatedDatums,
public CThreadCrossingMessage<CCrossThreadMerge>
{
public:
using inherited_t = CThreadCrossingMessage<CCrossThreadMerge>;
CCrossThreadMerge();
~CCrossThreadMerge();
protected:
enum enumMessageIds {
UWM_CARRIEREVENT = inherited_t::UWM_THREADCROSSINGMESSAGE_NEXT // background thread posts dateddatums to foreground
};
BEGIN_MSG_MAP_EX(CCrossThreadMerge)
MESSAGE_HANDLER(UWM_CARRIEREVENT, ProcessCarrierInForeGround)
END_MSG_MAP()
void ProcessCarrierInBackGround( CMergeCarrierBase *pCarrier );
LRESULT ProcessCarrierInForeGround( UINT, WPARAM, LPARAM, BOOL &bHandled );
private:
HANDLE m_hSignal; // used to sync between threads (prevents too many messages from piling up)
};
} // namespace tf
} // namespace ou