nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
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
12namespace 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:
48 {
49 ::int16_t int16val;
50 ::int32_t int32val;
51 ::int64_t int64val;
53 double float64val;
56 ::uint32_t uint32val;
57
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:
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 ){};
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__
#define DLL_EXPORT
Definition channel.h:12
A buffer holds the data contents of a channel.
Definition nds_buffer.hh:28
size_t size_type
Defines sizes when dealing with channels.
Definition nds_channel.hh:99
Definition nds_gap_handler.hh:123
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 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
DLL_EXPORT ~abort_gap_handler() override=default
Definition nds_gap_handler.hh:103
DLL_EXPORT continuation_gap_handler(const static_val default_val)
Definition nds_gap_handler.hh:105
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
DLL_EXPORT std::unique_ptr< gap_handler > clone() const override
Definition nds_gap_handler.hh:115
DLL_EXPORT ~continuation_gap_handler() override=default
Definition nds_gap_handler.hh:17
virtual ~delayed_gap_handler()=default
Definition nds_gap_handler.hh:45
DLL_EXPORT fixed_point_gap_handler(static_val::fixed_values spec)
Definition nds_gap_handler.hh:80
DLL_EXPORT std::unique_ptr< gap_handler > clone() const override
Definition nds_gap_handler.hh:92
DLL_EXPORT ~fixed_point_gap_handler() override=default
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
static_val val
Definition nds_gap_handler.hh:99
DLL_EXPORT fixed_point_gap_handler(const static_val &val)
Definition nds_gap_handler.hh:82
Definition nds_gap_handler.hh:29
DLL_EXPORT gap_handler()=default
virtual DLL_EXPORT std::unique_ptr< gap_handler > clone() const =0
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
virtual DLL_EXPORT ~gap_handler()=default
The NDS client namespace.
Definition debug_stream.cc:18
Definition nds_gap_handler.hh:48
fixed_values
Definition nds_gap_handler.hh:58
@ ZERO_VAL
Definition nds_gap_handler.hh:59
@ NEG_INF_VAL
Definition nds_gap_handler.hh:63
@ NAN_VAL
Definition nds_gap_handler.hh:61
@ POS_INF_VAL
Definition nds_gap_handler.hh:62
@ ONE_VAL
Definition nds_gap_handler.hh:60
::int16_t int16val
Definition nds_gap_handler.hh:49
float complexival
Definition nds_gap_handler.hh:55
float complexrval
Definition nds_gap_handler.hh:54
::int64_t int64val
Definition nds_gap_handler.hh:51
::int32_t int32val
Definition nds_gap_handler.hh:50
::uint32_t uint32val
Definition nds_gap_handler.hh:56
double float64val
Definition nds_gap_handler.hh:53
float float32val
Definition nds_gap_handler.hh:52