Last change
on this file since 2022 was
1930,
checked in by ymipsl, 4 years ago
|
Big update on on going work related to data distribution and transfer between clients and servers.
Revisite of the source and store filter using "connectors".
YM
|
File size:
1.2 KB
|
Rev | Line | |
---|
[637] | 1 | #ifndef __XIOS_CDataPacket__ |
---|
| 2 | #define __XIOS_CDataPacket__ |
---|
| 3 | |
---|
[1542] | 4 | #include <memory> |
---|
[637] | 5 | |
---|
| 6 | #include "array_new.hpp" |
---|
[643] | 7 | #include "date.hpp" |
---|
[637] | 8 | |
---|
| 9 | namespace xios |
---|
| 10 | { |
---|
| 11 | /*! |
---|
| 12 | * A packet corresponds to a timestamped array of data. |
---|
| 13 | */ |
---|
| 14 | struct CDataPacket |
---|
| 15 | { |
---|
| 16 | /*! |
---|
| 17 | * Describes the status associated to a packet |
---|
| 18 | */ |
---|
| 19 | enum StatusCode { |
---|
| 20 | NO_ERROR, //!< No error were encountered when handling the packet |
---|
| 21 | END_OF_STREAM //!< Last packet of the stream, does not have data |
---|
| 22 | }; |
---|
| 23 | |
---|
| 24 | CArray<double, 1> data; //!< Array containing the data |
---|
[643] | 25 | CDate date; //!< Date associated to the data |
---|
[637] | 26 | Time timestamp; //!< Timestamp of the data |
---|
| 27 | StatusCode status; //!< Status of the packet |
---|
| 28 | |
---|
| 29 | /*! |
---|
| 30 | * Creates a deep copy of the packet. |
---|
| 31 | * |
---|
| 32 | * \return a deep copy of the packet |
---|
| 33 | */ |
---|
[1930] | 34 | CDataPacket* copy() const |
---|
| 35 | { |
---|
[637] | 36 | CDataPacket* p = new CDataPacket; |
---|
| 37 | p->data.resize(data.shape()); |
---|
| 38 | p->data = data; |
---|
[643] | 39 | p->date = date; |
---|
[637] | 40 | p->timestamp = timestamp; |
---|
| 41 | p->status = status; |
---|
| 42 | return p; |
---|
| 43 | }; |
---|
| 44 | }; // struct CDataPacket |
---|
| 45 | |
---|
[1542] | 46 | typedef std::shared_ptr<CDataPacket> CDataPacketPtr; |
---|
| 47 | typedef std::shared_ptr<const CDataPacket> CConstDataPacketPtr; |
---|
[637] | 48 | } // namespace xios |
---|
| 49 | |
---|
| 50 | #endif //__XIOS_CDataPacket__ |
---|
Note: See
TracBrowser
for help on using the repository browser.