Last change
on this file since 2130 was
2130,
checked in by ymipsl, 3 years ago
|
New management of client-server buffers.
- buffers can grow automatically in intialization phase
- buffers is evaluated after the close context definition phase and fixed at optimal value.
YM
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
File size:
1.4 KB
|
Line | |
---|
1 | #include "client_to_server_store_filter.hpp" |
---|
2 | #include "exception.hpp" |
---|
3 | #include "field.hpp" |
---|
4 | #include "utils.hpp" |
---|
5 | #include "context_client.hpp" |
---|
6 | #include "timer.hpp" |
---|
7 | #include "field.hpp" |
---|
8 | #include "grid.hpp" |
---|
9 | |
---|
10 | namespace xios |
---|
11 | { |
---|
12 | CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client) |
---|
13 | : CInputPin(gc, 1) |
---|
14 | , field_(field), client_(client) |
---|
15 | { |
---|
16 | if (!field) |
---|
17 | ERROR("CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client)", |
---|
18 | "The field cannot be null."); |
---|
19 | } |
---|
20 | |
---|
21 | void CClientToServerStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) |
---|
22 | { |
---|
23 | CTimer::get("Field : send data").resume(); |
---|
24 | CEventClient event(field_->getType(), CField::EVENT_ID_UPDATE_DATA); |
---|
25 | CMessage message ; |
---|
26 | message<<field_->getId() << data[0]->timestamp ; |
---|
27 | field_->getSentGrid()->getClientToServerConnector(client_)->transfer(data[0]->data, client_, event, message) ; |
---|
28 | CTimer::get("Field : send data").suspend(); |
---|
29 | } |
---|
30 | |
---|
31 | CContextClient* CClientToServerStoreFilter::getTransferedDataSize(map<int,int>& size) |
---|
32 | { |
---|
33 | size = field_->getSentGrid()->getClientToServerConnector(client_)->getTransferedDataSize() ; |
---|
34 | return client_ ; |
---|
35 | } |
---|
36 | |
---|
37 | bool CClientToServerStoreFilter::mustAutoTrigger() const |
---|
38 | { |
---|
39 | return true; |
---|
40 | } |
---|
41 | |
---|
42 | bool CClientToServerStoreFilter::isDataExpected(const CDate& date) const |
---|
43 | { |
---|
44 | return true; |
---|
45 | } |
---|
46 | } // namespace xios |
---|
Note: See
TracBrowser
for help on using the repository browser.