nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nds_gap_handler.hh
Go to the documentation of this file.
1 #ifndef __NDS_GAP_HANDLER_HH__
2 #define __NDS_GAP_HANDLER_HH__
3 
4 #include <stdint.h>
5 
6 #include "nds_buffer.hh"
7 
8 #include "nds_export.hh"
9 
10 #include "nds_memory.hh"
11 
12 namespace NDS
13 {
14  namespace detail
15  {
17  {
18  public:
19  delayed_gap_handler( ) = default;
20  ;
21 
22  virtual ~delayed_gap_handler( ) = default;
23  ;
24 
25  virtual void operator( )( ) = 0;
26  };
27 
29  {
30  public:
31  DLL_EXPORT gap_handler( ) = default;
32 
33  DLL_EXPORT virtual ~gap_handler( ) = default;
34 
35  DLL_EXPORT virtual std::unique_ptr< delayed_gap_handler >
36  fill_gap( buffer& cur_buffer,
37  buffer::size_type start_sample_offset,
38  buffer::size_type end_sample_offset ) const = 0;
39 
40  DLL_EXPORT virtual std::unique_ptr< gap_handler >
41  clone( ) const = 0;
42  };
43 
45  {
46  public:
47  struct static_val
48  {
49  ::int16_t int16val;
50  ::int32_t int32val;
51  ::int64_t int64val;
52  float float32val;
53  double float64val;
54  float complexrval;
55  float complexival;
56  ::uint32_t uint32val;
57 
58  typedef enum {
59  ZERO_VAL = 0,
64  } fixed_values;
65  DLL_EXPORT static_val(::int16_t int16val,
66  ::int32_t int32val,
67  ::int64_t int64val,
68  float float32val,
69  double float64val,
70  float complexrval,
71  float complexival,
72  ::uint32_t uint32val );
73 
74  DLL_EXPORT explicit static_val( fixed_values spec );
75 
76  DLL_EXPORT explicit static_val( double value = 0.0 );
77  };
78 
79  public:
81  : val( spec ){};
83  : val( val ){};
84  DLL_EXPORT ~fixed_point_gap_handler( ) override = default;
85 
86  DLL_EXPORT std::unique_ptr< delayed_gap_handler >
87  fill_gap( buffer& cur_buffer,
88  buffer::size_type start_sample_offset,
89  buffer::size_type end_sample_offset ) const override;
90 
91  DLL_EXPORT std::unique_ptr< gap_handler >
92  clone( ) const override
93  {
94  return NDS::detail::make_unique< fixed_point_gap_handler >(
95  val );
96  }
97 
98  protected:
100  };
101 
103  {
104  public:
106  : fixed_point_gap_handler( default_val ){};
107  DLL_EXPORT ~continuation_gap_handler( ) override = default;
108 
109  DLL_EXPORT std::unique_ptr< delayed_gap_handler >
110  fill_gap( buffer& cur_buffer,
111  buffer::size_type start_sample_offset,
112  buffer::size_type end_sample_offset ) const override;
113 
114  DLL_EXPORT std::unique_ptr< gap_handler >
115  clone( ) const override
116  {
117  return NDS::detail::make_unique< continuation_gap_handler >(
118  val );
119  }
120  };
121 
123  {
124  public:
126  DLL_EXPORT ~abort_gap_handler( ) override = default;
127 
128  DLL_EXPORT std::unique_ptr< delayed_gap_handler >
129  fill_gap( buffer& cur_buffer,
130  buffer::size_type start_sample_offset,
131  buffer::size_type end_sample_offset ) const override;
132  DLL_EXPORT std::unique_ptr< gap_handler >
133  clone( ) const override
134  {
135  return std::unique_ptr< gap_handler >(
136  NDS::detail::make_unique< abort_gap_handler >( ) );
137  }
138  };
139  }
140 }
141 
142 #endif // __NDS_GAP_HANDLER_HH__
virtual DLL_EXPORT std::unique_ptr< delayed_gap_handler > fill_gap(buffer &cur_buffer, buffer::size_type start_sample_offset, buffer::size_type end_sample_offset) const =0
float complexival
Definition: nds_gap_handler.hh:55
::int16_t int16val
Definition: nds_gap_handler.hh:49
DLL_EXPORT static_val(::int16_t int16val,::int32_t int32val,::int64_t int64val, float float32val, double float64val, float complexrval, float complexival,::uint32_t uint32val)
Definition: nds_static_val.cc:34
DLL_EXPORT std::unique_ptr< gap_handler > clone() const override
Definition: nds_gap_handler.hh:115
DLL_EXPORT abort_gap_handler()
Definition: nds_gap_handler.hh:125
DLL_EXPORT std::unique_ptr< gap_handler > clone() const override
Definition: nds_gap_handler.hh:133
float complexrval
Definition: nds_gap_handler.hh:54
float float32val
Definition: nds_gap_handler.hh:52
::int64_t int64val
Definition: nds_gap_handler.hh:51
DLL_EXPORT gap_handler()=default
DLL_EXPORT ~continuation_gap_handler() override=default
::int32_t int32val
Definition: nds_gap_handler.hh:50
DLL_EXPORT fixed_point_gap_handler(static_val::fixed_values spec)
Definition: nds_gap_handler.hh:80
Definition: nds_gap_handler.hh:47
static_val val
Definition: nds_gap_handler.hh:99
Definition: nds_gap_handler.hh:102
#define DLL_EXPORT
Definition: channel.h:12
DLL_EXPORT std::unique_ptr< delayed_gap_handler > fill_gap(buffer &cur_buffer, buffer::size_type start_sample_offset, buffer::size_type end_sample_offset) const override
Definition: nds_gap_handler.cc:194
virtual DLL_EXPORT std::unique_ptr< gap_handler > clone() const =0
double float64val
Definition: nds_gap_handler.hh:53
Definition: nds_gap_handler.hh:16
DLL_EXPORT std::unique_ptr< gap_handler > clone() const override
Definition: nds_gap_handler.hh:92
Definition: nds_gap_handler.hh:44
Definition: nds_gap_handler.hh:28
DLL_EXPORT ~fixed_point_gap_handler() override=default
fixed_values
Definition: nds_gap_handler.hh:58
Definition: nds_gap_handler.hh:122
DLL_EXPORT std::unique_ptr< delayed_gap_handler > fill_gap(buffer &cur_buffer, buffer::size_type start_sample_offset, buffer::size_type end_sample_offset) const override
Definition: nds_gap_handler.cc:173
DLL_EXPORT std::unique_ptr< delayed_gap_handler > fill_gap(buffer &cur_buffer, buffer::size_type start_sample_offset, buffer::size_type end_sample_offset) const override
Definition: nds_gap_handler.cc:163
::uint32_t uint32val
Definition: nds_gap_handler.hh:56
virtual DLL_EXPORT ~gap_handler()=default
DLL_EXPORT continuation_gap_handler(const static_val default_val)
Definition: nds_gap_handler.hh:105
DLL_EXPORT fixed_point_gap_handler(const static_val &val)
Definition: nds_gap_handler.hh:82
DLL_EXPORT ~abort_gap_handler() override=default
virtual ~delayed_gap_handler()=default