uTL
micro Template library
|
Abstract base class for input devices. More...
#include <in_dev.h>
Public Types | |
using | type = in_dev_t |
Export type as identity meta-function. More... | |
using | data_type = data_t |
using | pointer_type = data_t * |
Public Member Functions | |
Public Get interface | |
size_t | get (data_t &data) |
Get interface. This function should read a single data_t object from device in blocking mode. More... | |
size_t | get (data_t *data, size_t n) |
Old stile get functionality using free standing data_t*. This function should return a stream of data from device. More... | |
Stream operator >> interface | |
template<typename _Dst_t > | |
in_dev_t & | operator>> (_Dst_t &dst) |
Template operator >> implementation for for all by value/ref parameters. More... | |
template<typename _Dst_t > | |
in_dev_t & | operator>> (_Dst_t *dst)=delete |
Specialization to disallow pointer types as destination. More... | |
in_dev_t & | operator>> (data_t &dst) |
Overload for single data_t object. More... | |
iterator | end () noexcept |
const_iterator | end () const noexcept |
const_iterator | cend () const noexcept |
Protected Member Functions | |
Constructor / Destructor | |
~in_dev ()=default | |
Allow destructor from derived only. More... | |
in_dev ()=default | |
A default constructor from derived only. More... | |
in_dev (const in_dev_t &)=delete | |
No copies. More... | |
in_dev_t & | operator= (const in_dev_t &)=delete |
Private Types | |
using | in_dev_t = in_dev< impl_t, data_t, streamsize > |
class type syntactic sugar More... | |
Private Member Functions | |
_CRTP_IMPL (impl_t) | |
Common input device interface requirements | |
size_t | get_ (data_t &data) |
size_t | get_ (data_t *data, size_t n) |
STL-like Input iterator interface | |
using | iterator = indev_it< in_dev_t, data_t *, streamsize > |
Iterator. More... | |
using | const_iterator = indev_it< in_dev_t, const data_t *, streamsize > |
Const iterator. More... | |
iterator | begin () noexcept |
.begin implementation More... | |
const_iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
Abstract base class for input devices.
Template base class for un-buffered input devices. using CRTP
This class force a common interface for input, non-buffered devices. By using this common interface the class implements
impl_t | The CRTP type (the derived/implementation class typename). |
data_t | The devices base type of data |
streamsize | The number of elements to indicate eos. |
using utl::in_dev< impl_t, data_t, streamsize >::const_iterator = indev_it <in_dev_t, const data_t*, streamsize> |
using utl::in_dev< impl_t, data_t, streamsize >::data_type = data_t |
|
private |
using utl::in_dev< impl_t, data_t, streamsize >::iterator = indev_it <in_dev_t, data_t*, streamsize> |
using utl::in_dev< impl_t, data_t, streamsize >::pointer_type = data_t* |
using utl::in_dev< impl_t, data_t, streamsize >::type = in_dev_t |
|
protecteddefault |
Allow destructor from derived only.
|
protecteddefault |
A default constructor from derived only.
|
protecteddelete |
No copies.
|
private |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
protecteddelete |
No copy assignments
|
inline |
Template operator >> implementation for for all by value/ref parameters.
dst | Reference to destination |
|
delete |
Specialization to disallow pointer types as destination.
|
inline |