|
uTL
micro Template library
|
Abstract base class for indexed devices. More...
#include <idx_dev.h>
Public Types | |
| using | type = idx_dev_t |
| Export type as identity meta-function. More... | |
| using | data_type = data_t |
| Export types as index device concept demands. More... | |
| using | pointer_type = data_t * |
| using | idx_type = idx_t |
Public Member Functions | |
Public index device interface | |
| size_t | get (data_t &data, idx_t cursor) |
| 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, idx_t cursor) |
| Old stile get functionality using free standing data_t*. This function should return a stream of data from device. More... | |
| size_t | put (const data_t &data, idx_t cursor) |
| Put interface. This function should send a single data_t object to device. More... | |
| size_t | put (const data_t *data, size_t n, idx_t cursor) |
| Put interface. This function should send a stream of data_t objects to device. More... | |
| idx_t | cursor () const |
| Return the current cursor position. More... | |
| idx_t | cursor (idx_t idx) |
| Set the cursor position. More... | |
Stream operator >> interface | |
| template<typename _Dst_t > | |
| idx_dev_t & | operator>> (_Dst_t &dst) |
| Template operator>> implementation for for all by value/ref parameters. More... | |
| template<typename _Dst_t > | |
| idx_dev_t & | operator>> (_Dst_t *dst)=delete |
| Specialization to disallow pointer types as destination. More... | |
| idx_dev_t & | operator>> (data_t &dst) |
| Overload for single data_t object. More... | |
Stream operator<< interface | |
| template<typename _Src_t > | |
| idx_dev_t & | operator<< (_Src_t &src) |
| Template operator<< implementation for for all by value/ref parameters. More... | |
| template<typename _Src_t > | |
| idx_dev_t & | operator<< (_Src_t *src)=delete |
| specialization to disallow pointer types as source More... | |
| idx_dev_t & | operator<< (const data_t &src) |
| Overload for single data_t object. More... | |
Helper operators | |
| data_t & | operator[] (const idx_t idx) |
| iterator | end () noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cend () const noexcept |
Protected Member Functions | |
Constructor / Destructor | |
| ~idx_dev ()=default | |
| Allow destructor from derived only. More... | |
| idx_dev ()=default | |
| A default constructor from derived only. More... | |
| idx_dev (const idx_dev_t &)=delete | |
| No copies. More... | |
| idx_dev_t & | operator= (const idx_dev_t &)=delete |
Private Types | |
| using | idx_dev_t = idx_dev< impl_t, data_t, idx_t, N > |
| class type syntactic sugar More... | |
Private Member Functions | |
| _CRTP_IMPL (impl_t) | |
Common index device interface requirements | |
| size_t | get_ (data_t &data, idx_t idx) |
| size_t | get_ (data_t *data, size_t n, idx_t idx) |
| size_t | put_ (const data_t &data, idx_t idx) |
| size_t | put_ (const data_t *data, size_t n, idx_t idx) |
| idx_t | cursor_ () const |
| void | cursor_ (idx_t idx) |
STL-like Input iterator interface | |
| using | iterator = idxdev_it< idx_dev_t, data_t *, N > |
| Iterator. More... | |
| using | const_iterator = idxdev_it< idx_dev_t, const data_t *, N > |
| Const iterator. More... | |
| iterator | begin () noexcept |
| .begin implementation More... | |
| const_iterator | begin () const noexcept |
| const_iterator | cbegin () const noexcept |
Abstract base class for indexed devices.
Template base class for indexed (I/O) devices. using CRTP
This class force a common interface for input, indexed (I/O) 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 |
| idx_t | The type to use for indexing |
| streamsize | The number of elements to indicate eos. |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::const_iterator = idxdev_it <idx_dev_t, const data_t*, N> |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::data_type = data_t |
|
private |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::idx_type = idx_t |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::iterator = idxdev_it <idx_dev_t, data_t*, N> |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::pointer_type = data_t* |
| using utl::idx_dev< impl_t, data_t, idx_t, N >::type = idx_dev_t |
|
protecteddefault |
Allow destructor from derived only.
|
protecteddefault |
A default constructor from derived only.
|
protecteddelete |
No copies.
|
private |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
delete |
specialization to disallow pointer types as source
|
inline |
|
protecteddelete |
No copy assignments
|
inline |
|
delete |
Specialization to disallow pointer types as destination.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |