21 #ifndef __utl_dev_ostream_dev_h__ 22 #define __utl_dev_ostream_dev_h__ 51 template <
typename impl_t,
typename data_t>
77 size_t put_ (
const data_t& data) {
return impl().put_ (data); }
78 size_t put_ (
const data_t* data,
size_t n) {
79 return impl().put_ (data, n);
96 size_t put (
const data_t& data) {
108 size_t put (
const data_t* data,
size_t n) {
109 return put_ (data, n);
127 template <
typename _Src_t>
129 static_assert ((
sizeof (_Src_t)%
sizeof(data_t) == 0),
130 "Source size must be an integer multiple of device's data size");
131 put_ (reinterpret_cast<const data_t*>(&src),
sizeof(_Src_t)/
sizeof(data_t));
135 template <
typename _Src_t>
170 template <
typename data_t>
196 virtual size_t put_ (
const data_t& data) =0;
197 virtual size_t put_ (
const data_t* data,
size_t n) =0;
213 size_t put (
const data_t& data) {
225 size_t put (
const data_t* data,
size_t n) {
226 return put_ (data, n);
244 template <
typename _Src_t>
246 static_assert ((
sizeof (_Src_t)%
sizeof(data_t) == 0),
247 "Source size must be an integer multiple of device's data size");
248 put_ (reinterpret_cast<const data_t*>(&src),
sizeof(_Src_t)/
sizeof(data_t));
252 template <
typename _Src_t>
const_iterator cend() const noexcept
const_iterator cbegin() const noexcept
ostreamdev_it< ostream_dev_t, data_t > iterator
Iterator.
const_iterator end() const noexcept
size_t put_(const data_t &data)
~ostream_dev()=default
Allow destructor from derived only.
iterator begin() noexcept
.begin implementation
size_t put(const data_t *data, size_t n)
Put interface. This function should send a stream of data_t objects to device.
ostream_dev< impl_t, data_t > ostream_dev_t
class type syntactic sugar
size_t put(const data_t *data, size_t n)
Put interface. This function should send a stream of data_t objects to device.
Abstract base classes for output stream devices.
STL's core language concepts.
ostream_dev_t & operator=(const ostream_dev_t &)=delete
ostream_dev()=default
A default constructor from derived only.
ostreamdev_it< const ostream_dev_t, data_t > const_iterator
Const iterator.
const_iterator begin() const noexcept
Iterator collection for devices.
size_t put(const data_t &data)
Put interface. This function should send a single data_t object to device.
iterator begin() noexcept
.begin implementation
const_iterator begin() const noexcept
ostream_dev_t & operator<<(const _Src_t &src)
Template operator<< implementation for for all by value/ref parameters.
const_iterator cbegin() const noexcept
const_iterator end() const noexcept
Implementation detail main forward header.
size_t put(const data_t &data)
Put interface. This function should send a single data_t object to device.
const_iterator cend() const noexcept
size_t put_(const data_t *data, size_t n)