gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
MMappedBlocks Class Reference

#include <IIOMMap.H>

Collaboration diagram for MMappedBlocks:
[legend]

Public Member Functions

 MMappedBlocks ()
 
 ~MMappedBlocks ()
 Destructor. More...
 
int reset (int fdIn)
 
int reset (int fdIn, int count, int size)
 

Public Attributes

vector< struct blockblocks
 The block information and address. More...
 

Private Member Functions

int allocate ()
 
void deAllocate ()
 
int memoryMap ()
 
void memoryUnmap ()
 

Private Attributes

int fd
 The file descriptior of the device. More...
 
struct iio_buffer_block_alloc_req req
 

Detailed Description

Memory map multiple blocks for the IIO read subsystem.

Definition at line 65 of file IIOMMap.H.

Constructor & Destructor Documentation

◆ MMappedBlocks()

MMappedBlocks::MMappedBlocks ( )
inline

Constructor.

Definition at line 135 of file IIOMMap.H.

◆ ~MMappedBlocks()

MMappedBlocks::~MMappedBlocks ( )
inline

Destructor.

Definition at line 142 of file IIOMMap.H.

Member Function Documentation

◆ allocate()

int MMappedBlocks::allocate ( )
inlineprivate

Method to get the kernel to allocate memory blocks.

Returns
Returns <0 on error.

Definition at line 72 of file IIOMMap.H.

Here is the call graph for this function:

◆ deAllocate()

void MMappedBlocks::deAllocate ( )
inlineprivate

Deallocate kernel space memory.

Definition at line 84 of file IIOMMap.H.

◆ memoryMap()

int MMappedBlocks::memoryMap ( )
inlineprivate

Memory map the blocks to the device.

Returns
Returns !=0 on error.

Definition at line 92 of file IIOMMap.H.

Here is the call graph for this function:

◆ memoryUnmap()

void MMappedBlocks::memoryUnmap ( )
inlineprivate

unmap memory blocks.

Definition at line 124 of file IIOMMap.H.

◆ reset() [1/2]

int MMappedBlocks::reset ( int  fdIn)
inline

Setup the mmap blocks. Uses DEFAULT_BLOCK_COUNT and DEFAULT_BLOCK_SIZE for the count and size respectively.

Parameters
fdInThe open file descriptor of the IIO device to be read from.
Returns
NO_ERROR or appropriate error

Definition at line 151 of file IIOMMap.H.

◆ reset() [2/2]

int MMappedBlocks::reset ( int  fdIn,
int  count,
int  size 
)
inline

Setup the mmap blocks

Parameters
fdInThe open file descriptor of the IIO device to be read from.
countThe number of blocks to use.
sizeThe size of each block (in bytes).
Returns
NO_ERROR or appropriate error

Definition at line 161 of file IIOMMap.H.

Member Data Documentation

◆ blocks

vector<struct block> MMappedBlocks::blocks

The block information and address.

Definition at line 131 of file IIOMMap.H.

◆ fd

int MMappedBlocks::fd
private

The file descriptior of the device.

Definition at line 66 of file IIOMMap.H.

◆ req

struct iio_buffer_block_alloc_req MMappedBlocks::req
private

Definition at line 67 of file IIOMMap.H.


The documentation for this class was generated from the following file:
gtkIOStream: MMappedBlocks Class Reference
GTK+ IOStream  Beta