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

#include <IIOThreadedQ.H>

Inheritance diagram for IIOThreadedQ:
[legend]
Collaboration diagram for IIOThreadedQ:
[legend]

Public Member Functions

 IIOThreadedQ ()
 
virtual ~IIOThreadedQ ()
 
int setSampleCountChannelCount (uint N, uint ch)
 
- Public Member Functions inherited from IIO
 IIO ()
 
virtual ~IIO ()
 
int findDevicesByChipName (std::string chipName)
 
uint getDeviceCnt ()
 
uint getChCnt ()
 
void printInfo ()
 
int open (void)
 
int close (void)
 
int getChFrameSize (void)
 
int getDevFrameSize (void)
 
template<typename TYPE >
int getReadArray (uint N, Eigen::Array< TYPE, Eigen::Dynamic, Eigen::Dynamic > &array)
 
template<typename TYPE >
int getReadArraySampleCount (Eigen::Array< TYPE, Eigen::Dynamic, Eigen::Dynamic > &array)
 
template<typename TYPE >
int read (uint N, const Eigen::Array< TYPE, Eigen::Dynamic, Eigen::Dynamic > &array)
 
int enable (bool enable)
 
int getChannelBufferCnt ()
 
int setChannelBufferCnt (int chBufCnt)
 
- Public Member Functions inherited from ThreadedMethod
virtual int run (int priority=0)
 
- Public Member Functions inherited from Thread
 Thread (void)
 
virtual ~Thread (void)
 
void * stop (void)
 
int run (void *(*start_routine)(void *), void *data, int priority=0)
 
int setPriority (pthread_attr_t *attributes, int priority)
 
int getPriority ()
 
void * meetThread (void)
 
void exit (void *retVal)
 
bool running ()
 
- Public Member Functions inherited from Cond
 Cond ()
 Constructor. More...
 
virtual ~Cond ()
 Destructor. More...
 
void wait ()
 
void signal ()
 
void boroadcast ()
 
- Public Member Functions inherited from Mutex
 Mutex ()
 
virtual ~Mutex ()
 
int lock ()
 
int tryLock ()
 
int unLock ()
 
- Public Member Functions inherited from BlockBuffer
 BlockBuffer (int count)
 
 BlockBuffer (void)
 Constructor - creates BLOCK_BUFFER_DEFAULT_COUNT buffers. More...
 
Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > * getEmptyBuffer (void)
 
Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > * getFullBuffer (void)
 
void putFullBuffer (Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > *fb)
 
void putEmptyBuffer (Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > *eb)
 
int getBufferCount ()
 
void resizeBuffers (int rows, int cols)
 
void resize (int count)
 

Public Attributes

float sampleRate
 
bool newbufReady
 

Private Member Functions

void * threadMain (void)
 
int resizeBuffers (int N, int ch)
 

Additional Inherited Members

- Protected Attributes inherited from Mutex
pthread_mutex_t mut
 The POSIX mutex semaphore. More...
 

Detailed Description

Examples:
IIOQueueTest.C.

Definition at line 25 of file IIOThreadedQ.H.

Constructor & Destructor Documentation

◆ IIOThreadedQ()

IIOThreadedQ::IIOThreadedQ ( )
inline

Definition at line 120 of file IIOThreadedQ.H.

Here is the call graph for this function:

◆ ~IIOThreadedQ()

virtual IIOThreadedQ::~IIOThreadedQ ( )
inlinevirtual

Definition at line 125 of file IIOThreadedQ.H.

Member Function Documentation

◆ resizeBuffers()

int IIOThreadedQ::resizeBuffers ( int  N,
int  ch 
)
inlineprivate

Resize the internal buffers for reading. The end result will be buffers which capture N samples per channel, where the total number of channels is the number requested + the remainder non-requested channels on the last device. i.e. the total number of channels will be ceil(ch / number of channels per device) * number of channels per device. For example, if ch=3 but there are 2 channels per device, we will get ceil(3/2)*2 = 4.

Parameters
Nthe number of samples to read.
chthe number of channels to read.
Returns
NO_ERROR or the suitable error. The arrays are returned correctly sized for reading N samples.

Definition at line 96 of file IIOThreadedQ.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSampleCountChannelCount()

int IIOThreadedQ::setSampleCountChannelCount ( uint  N,
uint  ch 
)
inline
Examples:
IIOQueueTest.C.

Definition at line 127 of file IIOThreadedQ.H.

Here is the call graph for this function:

◆ threadMain()

void* IIOThreadedQ::threadMain ( void  )
inlineprivatevirtual

All reading is done in a threaded environment. This ensures that you can process data whilst new data is being read in.

Implements ThreadedMethod.

Definition at line 30 of file IIOThreadedQ.H.

Here is the call graph for this function:

Member Data Documentation

◆ newbufReady

bool IIOThreadedQ::newbufReady
Examples:
IIOQueueTest.C.

Definition at line 118 of file IIOThreadedQ.H.

◆ sampleRate

float IIOThreadedQ::sampleRate
Examples:
IIOQueueTest.C.

Definition at line 117 of file IIOThreadedQ.H.


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