EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
GetValuesCommand.h
1 #ifndef EA4_PVRPC_GET_VALUES_COMMAND_H
2 #define EA4_PVRPC_GET_VALUES_COMMAND_H
3 
4 #include <sstream>
5 
6 #include "storage/ReaderFactory.h"
7 #include "storage/SpreadsheetReader.h"
8 
9 #include "pvrpc/ArchiveCommand.h"
10 
11 namespace ea4 { namespace pvrpc {
12 
15 
16 public:
17 
20 
21  public:
22 
23  // ArchiveCommand API
24 
26  virtual const char* getName()const { return commandName.c_str(); }
27 
29  virtual epics::pvData::PVStructurePtr createRequest();
30 
32  virtual epics::pvData::PVStructurePtr
33  process(epics::pvData::PVStructurePtr const & request);
34 
35 protected:
36 
37  void createRequestType();
38 
39  epics::pvData::StructureConstPtr
40  createResultType(epics::pvData::StructureConstPtr& metaType,
41  epics::pvData::ScalarType pv_type,
42  int pv_count);
43 
44 protected:
45 
46  epics::pvData::PVStructurePtr
47  createDataResponse(int key,
48  const std::vector<std::string>& pvNames,
49  const epicsTime& start,
50  const epicsTime& end,
51  int actual_count,
52  int how);
53 
54  DataReader*
55  createDataReader(Index& index,
56  const epicsTime& start,
57  const epicsTime& end,
58  int count,
59  int how);
60 
61  epics::pvData::StructureConstPtr
62  createDataResponseType(DataReader* reader,
63  const std::vector<std::string>& pvNames,
64  const epicsTime& start);
65 
66  void getDataResult(epics::pvData::PVStructurePtr& result,
67  DataReader* reader,
68  const std::string& name,
69  const epicsTime& start,
70  const epicsTime& end,
71  int actual_count,
72  int how);
73 
74  void getChannelData(epics::pvData::PVStructureArrayPtr& values,
75  DataReader* reader,
76  const epicsTime& end,
77  const RawValue::Data* data,
78  epics::pvData::ScalarType pv_type,
79  int pv_count,
80  int count,
81  ReaderFactory::How how);
82 
83 protected:
84 
85  epics::pvData::PVStructurePtr
86  createSheetResponse(int key,
87  const std::vector<std::string>& pvNames,
88  const epicsTime& start,
89  const epicsTime& end,
90  int actual_count,
91  int how);
92 
94  createSheetReader(Index& index,
95  const epicsTime& start,
96  const epicsTime& end,
97  int count,
98  int how);
99 
100  epics::pvData::StructureConstPtr
101  createSheetResponseType(SpreadsheetReader* sheet,
102  const epicsTime& start);
103 
104  void getSheetData(epics::pvData::PVStructurePtr& response,
105  SpreadsheetReader* sheet,
106  const epicsTime& start,
107  const epicsTime& end,
108  int actual_count);
109 
110 protected:
111 
112  static std::string commandName;
113 
114  // {string command,
115  // int key, string[] name,
116  // int32 start_sec, int32 start_nano,
117  // int32 end_sec, int32 end_nano,
118  // int32 count, int32 how }
119  epics::pvData::StructureConstPtr requestType;
120 
121 };
122 
123 }}
124 
125 #endif
126 
127 
Reads data from storage.
Definition: DataReader.h:23
virtual epics::pvData::PVStructurePtr createRequest()
Returns the request structure.
Command returning the channel values.
Definition: GetValuesCommand.h:14
virtual epics::pvData::PVStructurePtr process(epics::pvData::PVStructurePtr const &request)
Delegates the request to the RPC service.
Reads data from storage, formatted as spreadsheet.
Definition: SpreadsheetReader.h:21
Basic class of the RPC commands.
Definition: ArchiveCommand.h:17
virtual const char * getName() const
Returns &#39;getValues&#39;.
Definition: GetValuesCommand.h:26
How
Determine what DataReader to use:
Definition: ReaderFactory.h:22
GetValuesCommand()
Constructor.
Base interface for the archiver&#39;s indices.
Definition: Index.h:16
dbr_time_double Data
Type for accessing the raw data and its common fields.
Definition: RawValue.h:55