nds2-client - ClientUser  0.16.8
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
nds_channel_cache.hh
1 #ifndef NDS_INTERNAL_CHANNEL_CACHE_HH
2 #define NDS_INTERNAL_CHANNEL_CACHE_HH
3 
4 #include <cstdint>
5 #include <vector>
6 #include <array>
7 
8 #include "nds_connection.hh"
9 
10 namespace NDS
11 {
12 
13  namespace detail
14  {
15  class daq_accessor;
16 
17  struct nds1_cached_channel
18  {
19  double rate;
20  uint32_t tpnum;
21  float gain;
22  float slope;
23  float offset;
24  channel::channel_type channel_type;
25  channel::data_type data_type;
26  std::array< char, 64 + 60 + 1 > name;
27  std::array< char, 40 + 1 > units;
28  };
29 
30  class channel_cache_nds1
31  {
32  public:
33  typedef detail::nds1_cached_channel cache_entry_type;
34  typedef std::vector< cache_entry_type > cache_type;
35 
36  channel_cache_nds1( detail::daq_accessor& server );
37 
38  size_t count_channels( std::string channel_glob,
39  channel::channel_type channel_type_mask,
40  channel::data_type data_type_mask,
41  channel::sample_rate_type min_sample_rate,
42  channel::sample_rate_type max_sample_rate );
43 
44  channels_type
45  find_channels( std::string channel_glob,
46  channel::channel_type channel_type_mask,
47  channel::data_type data_type_mask,
48  channel::sample_rate_type min_sample_rate,
49  channel::sample_rate_type max_sample_rate );
50 
51  private:
52  void update_cache( );
53 
54  detail::daq_accessor& server_;
55  cache_type cache_;
56  };
57  }
58 }
59 
60 #endif // NDS_INTERNAL_CHANNEL_CACHE_HH