utl::in_dev< virtual_tag, data_t, streamsize > Class Template Referenceabstract

A virtual base class specialization. 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)
size_t | get (data_t *data, size_t n)
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

## Private Types

using | in_dev_t = in_dev< virtual_tag, data_t, streamsize >
| < class type syntactic sugar More...

## Private Member Functions

Common input device interface requirements
virtual size_t | get_ (data_t &data)=0
| Get interface. This function should read a single data_t object from device in blocking mode. More...
virtual size_t | get_ (data_t *data, size_t n)=0
| Old stile get functionality using free standing data_t*. This function should return a stream of data from device. More...

## Constructor / Destructor

virtual | ~in_dev ()=default
| Virtual destructor. 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

## 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

## Detailed Description

### template<typename data_t, size_t streamsize>
class utl::in_dev< virtual_tag, data_t, streamsize >

A virtual base class specialization.

Parameters

  impl_t | = virtual_tag
  data_t | The devices base type of data
  streamsize_t | Type to hold the number of read bytes

Definition at line 174 of file in_dev.h.

## Member Typedef Documentation

## const_iterator

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::const_iterator = indev_it <in_dev_t, const data_t*, streamsize>

Const iterator.

Definition at line 271 of file in_dev.h.

## data_type

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::data_type = data_t

Export types as input device concept demands

Definition at line 181 of file in_dev.h.

## in_dev_t

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::in_dev_t = in_dev <virtual_tag, data_t, streamsize>

private

< class type syntactic sugar

Definition at line 176 of file in_dev.h.

## iterator

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::iterator = indev_it <in_dev_t, data_t*, streamsize>

Iterator.

Definition at line 270 of file in_dev.h.

## pointer_type

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::pointer_type = data_t*

Definition at line 182 of file in_dev.h.

## type

template<typename data_t , size_t streamsize>

using utl::in_dev< virtual_tag, data_t, streamsize >::type = in_dev_t

Export type as identity meta-function.

Definition at line 184 of file in_dev.h.

## Constructor & Destructor Documentation

## ~in_dev()

template<typename data_t , size_t streamsize>

virtual utl::in_dev< virtual_tag, data_t, streamsize >::~in_dev | ( |  | ) |

virtualdefault

Virtual destructor.

## in_dev() [1/2]

template<typename data_t , size_t streamsize>

utl::in_dev< virtual_tag, data_t, streamsize >::in_dev | ( |  | ) |

protecteddefault

A default constructor from derived only.

## in_dev() [2/2]

template<typename data_t , size_t streamsize>

utl::in_dev< virtual_tag, data_t, streamsize >::in_dev | ( | const in_dev_t & |  | ) |

protecteddelete

No copies.

## Member Function Documentation

## begin() [1/2]

template<typename data_t , size_t streamsize>

iterator utl::in_dev< virtual_tag, data_t, streamsize >::begin | ( |  | ) |

inlinenoexcept

.begin implementation

Definition at line 274 of file in_dev.h.

## begin() [2/2]

template<typename data_t , size_t streamsize>

const_iterator utl::in_dev< virtual_tag, data_t, streamsize >::begin | ( |  | ) | const

inlinenoexcept

Definition at line 275 of file in_dev.h.

## cbegin()

template<typename data_t , size_t streamsize>

const_iterator utl::in_dev< virtual_tag, data_t, streamsize >::cbegin | ( |  | ) | const

inlinenoexcept

Definition at line 276 of file in_dev.h.

## cend()

template<typename data_t , size_t streamsize>

const_iterator utl::in_dev< virtual_tag, data_t, streamsize >::cend | ( |  | ) | const

inlinenoexcept

Definition at line 281 of file in_dev.h.

## end() [1/2]

template<typename data_t , size_t streamsize>

iterator utl::in_dev< virtual_tag, data_t, streamsize >::end | ( |  | ) |

inlinenoexcept

.end implementation

Definition at line 279 of file in_dev.h.

## end() [2/2]

template<typename data_t , size_t streamsize>

const_iterator utl::in_dev< virtual_tag, data_t, streamsize >::end | ( |  | ) | const

inlinenoexcept

Definition at line 280 of file in_dev.h.

## get() [1/2]

template<typename data_t , size_t streamsize>

size_t utl::in_dev< virtual_tag, data_t, streamsize >::get | ( | data_t & | data | ) |

inline

Definition at line 230 of file in_dev.h.

## get() [2/2]

template<typename data_t , size_t streamsize>

size_t utl::in_dev< virtual_tag, data_t, streamsize >::get | ( | data_t * | data,
|  | size_t | n
| ) |  |

inline

Definition at line 231 of file in_dev.h.

## get_() [1/2]

template<typename data_t , size_t streamsize>

virtual size_t utl::in_dev< virtual_tag, data_t, streamsize >::get_ | ( | data_t & | data | ) |

privatepure virtual

Get interface. This function should read a single data_t object from device in blocking mode.

Parameters

  data | Reference to data output from device.

Returns
  Number of data read from device

Note
  A successful call should return 1

## get_() [2/2]

template<typename data_t , size_t streamsize>

virtual size_t utl::in_dev< virtual_tag, data_t, streamsize >::get_ | ( | data_t * | data,
|  | size_t | n
| ) |  |

privatepure virtual

Old stile get functionality using free standing data_t*. This function should return a stream of data from device.

Parameters

  data | Pointer to buffer to write the data from device.
  n | The number of data of type data_t to read

Returns
  The read data items.

## operator=()

template<typename data_t , size_t streamsize>

in_dev_t& utl::in_dev< virtual_tag, data_t, streamsize >::operator= | ( | const in_dev_t & |  | ) |

protecteddelete

No copy assignments

## operator>>() [1/3]

template<typename data_t , size_t streamsize>
template<typename _Dst_t >

in_dev_t& utl::in_dev< virtual_tag, data_t, streamsize >::operator>> | ( | _Dst_t & | dst | ) |

inline

Template operator >> implementation for for all by value/ref parameters.

Note
  In the case _Dst_t size is not a integer multiple of device's data size this will fail by static assertion

Parameters

  dst | Reference to destination

Returns
  Reference to this device for chaining

Definition at line 249 of file in_dev.h.

## operator>>() [2/3]

template<typename data_t , size_t streamsize>
template<typename _Dst_t >

in_dev_t& utl::in_dev< virtual_tag, data_t, streamsize >::operator>> | ( | _Dst_t * | dst | ) |

delete

specialization to disallow pointer types as destination

## operator>>() [3/3]

template<typename data_t , size_t streamsize>

in_dev_t& utl::in_dev< virtual_tag, data_t, streamsize >::operator>> | ( | data_t & | dst | ) |

inline

Overload for single data_t object.

Definition at line 260 of file in_dev.h.

The documentation for this class was generated from the following file:

- include/utl/dev/in_dev.h