source: XIOS/trunk/src/filter/data_packet.hpp @ 1902

Last change on this file since 1902 was 1876, checked in by yushan, 4 years ago

trunk : Bug fixed in workflow graph. wrong connection happens when a chain of arithmetic operations is applied on a field.

File size: 1.3 KB
RevLine 
[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
9namespace 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
[1876]29    int src_filterID=0;
[1704]30    std::vector<int> filterIDoutputs;
[1876]31    CField *field=nullptr;
32    int distance=-1;
[1704]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.