utl::idx_dev< virtual_tag, data_t, idx_t, N > Class Template Referenceabstract

A virtual base class specialization. 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

## Private Types

using | idx_dev_t = idx_dev< virtual_tag, data_t, idx_t, N >
| class type syntactic sugar More...

## Private Member Functions

Common index device interface requirements
virtual size_t | get_ (data_t &, idx_t)=0
virtual size_t | get_ (data_t *, size_t n, idx_t)=0
virtual size_t | put_ (const data_t &, idx_t)=0
virtual size_t | put_ (const data_t *, size_t n, idx_t)=0
virtual idx_t | cursor_ () const =0
virtual void | cursor_ (idx_t)=0

## Constructor / Destructor

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

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

## Detailed Description

### template<typename data_t, typename idx_t, size_t N>
class utl::idx_dev< virtual_tag, data_t, idx_t, N >

A virtual base class specialization.

Parameters

  impl_t | = virtual_tag
  data_t | The devices base type of data
  idx_t | The type to use for indexing
  streamsize | The number of elements to indicate eos.

Definition at line 256 of file idx_dev.h.

## Member Typedef Documentation

## const_iterator

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::const_iterator = idxdev_it <idx_dev_t, const data_t*, N>

Const iterator.

Definition at line 430 of file idx_dev.h.

## data_type

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::data_type = data_t

Export types as index device concept demands.

Definition at line 261 of file idx_dev.h.

## idx_dev_t

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::idx_dev_t = idx_dev <virtual_tag, data_t, idx_t, N>

private

class type syntactic sugar

Definition at line 257 of file idx_dev.h.

## idx_type

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::idx_type = idx_t

Definition at line 263 of file idx_dev.h.

## iterator

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::iterator = idxdev_it <idx_dev_t, data_t*, N>

Iterator.

Definition at line 429 of file idx_dev.h.

## pointer_type

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::pointer_type = data_t*

Definition at line 262 of file idx_dev.h.

## type

template<typename data_t , typename idx_t , size_t N>

using utl::idx_dev< virtual_tag, data_t, idx_t, N >::type = idx_dev_t

Export type as identity meta-function.

Definition at line 265 of file idx_dev.h.

## Constructor & Destructor Documentation

## ~idx_dev()

template<typename data_t , typename idx_t , size_t N>

virtual utl::idx_dev< virtual_tag, data_t, idx_t, N >::~idx_dev | ( |  | ) |

virtualdefault

Virtual destructor.

## idx_dev() [1/2]

template<typename data_t , typename idx_t , size_t N>

utl::idx_dev< virtual_tag, data_t, idx_t, N >::idx_dev | ( |  | ) |

protecteddefault

A default constructor from derived only.

## idx_dev() [2/2]

template<typename data_t , typename idx_t , size_t N>

utl::idx_dev< virtual_tag, data_t, idx_t, N >::idx_dev | ( | const idx_dev_t & |  | ) |

protecteddelete

No copies.

## Member Function Documentation

## begin() [1/2]

template<typename data_t , typename idx_t , size_t N>

iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::begin | ( |  | ) |

inlinenoexcept

.begin implementation

Definition at line 433 of file idx_dev.h.

## begin() [2/2]

template<typename data_t , typename idx_t , size_t N>

const_iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::begin | ( |  | ) | const

inlinenoexcept

Definition at line 434 of file idx_dev.h.

## cbegin()

template<typename data_t , typename idx_t , size_t N>

const_iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::cbegin | ( |  | ) | const

inlinenoexcept

Definition at line 435 of file idx_dev.h.

## cend()

template<typename data_t , typename idx_t , size_t N>

const_iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::cend | ( |  | ) | const

inlinenoexcept

Definition at line 440 of file idx_dev.h.

## cursor() [1/2]

template<typename data_t , typename idx_t , size_t N>

idx_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::cursor | ( |  | ) | const

inline

Return the current cursor position.

Definition at line 348 of file idx_dev.h.

## cursor() [2/2]

template<typename data_t , typename idx_t , size_t N>

idx_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::cursor | ( | idx_t | idx | ) |

inline

Set the cursor position.

Parameters

  idx | Cursor address to set

Returns
  The current cursor

Definition at line 355 of file idx_dev.h.

## cursor_() [1/2]

template<typename data_t , typename idx_t , size_t N>

virtual idx_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::cursor_ | ( |  | ) | const

privatepure virtual

## cursor_() [2/2]

template<typename data_t , typename idx_t , size_t N>

virtual void utl::idx_dev< virtual_tag, data_t, idx_t, N >::cursor_ | ( | idx_t |  | ) |

privatepure virtual

## end() [1/2]

template<typename data_t , typename idx_t , size_t N>

iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::end | ( |  | ) |

inlinenoexcept

.end implementation

Definition at line 438 of file idx_dev.h.

## end() [2/2]

template<typename data_t , typename idx_t , size_t N>

const_iterator utl::idx_dev< virtual_tag, data_t, idx_t, N >::end | ( |  | ) | const

inlinenoexcept

Definition at line 439 of file idx_dev.h.

## get() [1/2]

template<typename data_t , typename idx_t , size_t N>

size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::get | ( | data_t & | data,
|  | idx_t | cursor
| ) |  |

inline

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

Definition at line 303 of file idx_dev.h.

## get() [2/2]

template<typename data_t , typename idx_t , size_t N>

size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::get | ( | data_t * | data,
|  | size_t | n,
|  | idx_t | cursor
| ) |  |

inline

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.

Definition at line 315 of file idx_dev.h.

## get_() [1/2]

template<typename data_t , typename idx_t , size_t N>

virtual size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::get_ | ( | data_t & | ,
|  | idx_t |
| ) |  |

privatepure virtual

## get_() [2/2]

template<typename data_t , typename idx_t , size_t N>

virtual size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::get_ | ( | data_t * | ,
|  | size_t | n,
|  | idx_t |
| ) |  |

privatepure virtual

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

template<typename data_t , typename idx_t , size_t N>
template<typename _Src_t >

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator<< | ( | _Src_t & | src | ) |

inline

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

Parameters

  src | Reference to source data

Returns
  Reference to this device for chaining

Definition at line 397 of file idx_dev.h.

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

template<typename data_t , typename idx_t , size_t N>
template<typename _Src_t >

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator<< | ( | _Src_t * | src | ) |

delete

specialization to disallow pointer types as source

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

template<typename data_t , typename idx_t , size_t N>

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator<< | ( | const data_t & | src | ) |

inline

Overload for single data_t object.

Definition at line 408 of file idx_dev.h.

## operator=()

template<typename data_t , typename idx_t , size_t N>

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator= | ( | const idx_dev_t & |  | ) |

protecteddelete

No copy assignments

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

template<typename data_t , typename idx_t , size_t N>
template<typename _Dst_t >

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator>> | ( | _Dst_t & | dst | ) |

inline

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

Parameters

  dst | Reference to destination

Returns
  Reference to this device for chaining

Definition at line 369 of file idx_dev.h.

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

template<typename data_t , typename idx_t , size_t N>
template<typename _Dst_t >

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator>> | ( | _Dst_t * | dst | ) |

delete

specialization to disallow pointer types as destination

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

template<typename data_t , typename idx_t , size_t N>

idx_dev_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator>> | ( | data_t & | dst | ) |

inline

Overload for single data_t object.

Definition at line 380 of file idx_dev.h.

## operator[]()

template<typename data_t , typename idx_t , size_t N>

data_t& utl::idx_dev< virtual_tag, data_t, idx_t, N >::operator[] | ( | const idx_t | idx | ) |

inline

Definition at line 418 of file idx_dev.h.

## put() [1/2]

template<typename data_t , typename idx_t , size_t N>

size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::put | ( | const data_t & | data,
|  | idx_t | cursor
| ) |  |

inline

Put interface. This function should send a single data_t object to device.

Parameters

  data | The data to send

Returns
  The number of transmitted data items

Note
  A successful call should return 1

Definition at line 328 of file idx_dev.h.

## put() [2/2]

template<typename data_t , typename idx_t , size_t N>

size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::put | ( | const data_t * | data,
|  | size_t | n,
|  | idx_t | cursor
| ) |  |

inline

Put interface. This function should send a stream of data_t objects to device.

Parameters

  data | Pointer to buffer indenting write to device.
  n | The number of data of type data_t to send

Returns
  The number of transmitted items.

Definition at line 340 of file idx_dev.h.

## put_() [1/2]

template<typename data_t , typename idx_t , size_t N>

virtual size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::put_ | ( | const data_t & | ,
|  | idx_t |
| ) |  |

privatepure virtual

## put_() [2/2]

template<typename data_t , typename idx_t , size_t N>

virtual size_t utl::idx_dev< virtual_tag, data_t, idx_t, N >::put_ | ( | const data_t * | ,
|  | size_t | n,
|  | idx_t |
| ) |  |

privatepure virtual

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

- include/utl/dev/idx_dev.h