roo_io
API Documentation for roo_io
Loading...
Searching...
No Matches
roo_io::UnsafeGenericMemoryIterator< PtrTypeT > Class Template Reference

Infinite iterator reading from memory starting at provided address. More...

#include <memory_input_iterator.h>

Public Types

using PtrType = PtrTypeT
 

Public Member Functions

 UnsafeGenericMemoryIterator (PtrType ptr)
 Creates iterator starting at ptr.
 
byte read ()
 Returns byte at current pointer and advances by one.
 
size_t read (byte *result, size_t count)
 Copies count bytes from current pointer, then advances by count.
 
void skip (size_t count)
 Advances pointer by count bytes.
 
Status status () const
 Returns kOk unconditionally.
 
PtrType ptr () const
 Returns current pointer.
 

Protected Attributes

PtrTypeT ptr_
 

Detailed Description

template<typename PtrTypeT>
class roo_io::UnsafeGenericMemoryIterator< PtrTypeT >

Infinite iterator reading from memory starting at provided address.

Reader controls bounds externally.

Memory footprint: one pointer (4 bytes on 32-bit targets).

Implements input iterator contract.

Definition at line 17 of file memory_input_iterator.h.

Member Typedef Documentation

◆ PtrType

Constructor & Destructor Documentation

◆ UnsafeGenericMemoryIterator()

template<typename PtrTypeT >
roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::UnsafeGenericMemoryIterator ( PtrType  ptr)
inline

Creates iterator starting at ptr.

Definition at line 22 of file memory_input_iterator.h.

Member Function Documentation

◆ ptr()

Returns current pointer.

Definition at line 47 of file memory_input_iterator.h.

References roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::ptr_.

◆ read() [1/2]

Returns byte at current pointer and advances by one.

Does not modify status (status() is always kOk).

Definition at line 27 of file memory_input_iterator.h.

References roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::ptr_.

◆ read() [2/2]

template<typename PtrTypeT >
size_t roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::read ( byte result,
size_t  count 
)
inline

Copies count bytes from current pointer, then advances by count.

Does not modify status (status() is always kOk).

Definition at line 32 of file memory_input_iterator.h.

References roo_io::count, and roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::ptr_.

◆ skip()

Advances pointer by count bytes.

Does not modify status (status() is always kOk).

Definition at line 41 of file memory_input_iterator.h.

References roo_io::count, and roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::ptr_.

◆ status()

template<typename PtrTypeT >
Status roo_io::UnsafeGenericMemoryIterator< PtrTypeT >::status ( ) const
inline

Returns kOk unconditionally.

Definition at line 44 of file memory_input_iterator.h.

References roo_io::kOk.

Field Documentation

◆ ptr_


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