Last change
on this file since 1780 was
1704,
checked in by yushan, 5 years ago
|
Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.
|
File size:
1.3 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 | { |
---|
[1704] | 11 | class CField; |
---|
[637] | 12 | /*! |
---|
| 13 | * A packet corresponds to a timestamped array of data. |
---|
| 14 | */ |
---|
| 15 | struct CDataPacket |
---|
| 16 | { |
---|
| 17 | /*! |
---|
| 18 | * Describes the status associated to a packet |
---|
| 19 | */ |
---|
| 20 | enum StatusCode { |
---|
| 21 | NO_ERROR, //!< No error were encountered when handling the packet |
---|
| 22 | END_OF_STREAM //!< Last packet of the stream, does not have data |
---|
| 23 | }; |
---|
| 24 | |
---|
| 25 | CArray<double, 1> data; //!< Array containing the data |
---|
[643] | 26 | CDate date; //!< Date associated to the data |
---|
[637] | 27 | Time timestamp; //!< Timestamp of the data |
---|
| 28 | StatusCode status; //!< Status of the packet |
---|
[1704] | 29 | int src_filterID; |
---|
| 30 | std::vector<int> filterIDoutputs; |
---|
| 31 | CField *field; |
---|
| 32 | int distance; |
---|
| 33 | |
---|
[637] | 34 | /*! |
---|
| 35 | * Creates a deep copy of the packet. |
---|
| 36 | * |
---|
| 37 | * \return a deep copy of the packet |
---|
| 38 | */ |
---|
| 39 | CDataPacket* copy() const { |
---|
| 40 | CDataPacket* p = new CDataPacket; |
---|
| 41 | p->data.resize(data.shape()); |
---|
| 42 | p->data = data; |
---|
[643] | 43 | p->date = date; |
---|
[637] | 44 | p->timestamp = timestamp; |
---|
| 45 | p->status = status; |
---|
| 46 | return p; |
---|
| 47 | }; |
---|
| 48 | }; // struct CDataPacket |
---|
| 49 | |
---|
[1542] | 50 | typedef std::shared_ptr<CDataPacket> CDataPacketPtr; |
---|
| 51 | typedef std::shared_ptr<const CDataPacket> CConstDataPacketPtr; |
---|
[637] | 52 | } // namespace xios |
---|
| 53 | |
---|
| 54 | #endif //__XIOS_CDataPacket__ |
---|
Note: See
TracBrowser
for help on using the repository browser.