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

#include <IIOThreaded.H>

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

Public Member Functions

 IIOThreaded ()
 
virtual ~IIOThreaded ()
 
int setSampleCountChannelCount (uint N, uint ch)
 
void bufferInfo ()
 
Eigen::Array< unsigned short int, Eigen::Dynamic, Eigen::Dynamic > * getFullBuffer ()
 
- 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 Attributes

bool bufFull
 Indicates when the read has completed and a buffer is full. More...
 

Private Member Functions

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

Private Attributes

LinkList< Eigen::Array< unsigned short int, Eigen::Dynamic, Eigen::Dynamic > * > buffers
 The load and unload buffers. More...
 
Eigen::Array< unsigned short int, Eigen::Dynamic, Eigen::Dynamic > * fullBuffer
 

Additional Inherited Members

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

Detailed Description

Definition at line 25 of file IIOThreaded.H.

Constructor & Destructor Documentation

◆ IIOThreaded()

IIOThreaded::IIOThreaded ( )
inline

Definition at line 107 of file IIOThreaded.H.

◆ ~IIOThreaded()

virtual IIOThreaded::~IIOThreaded ( )
inlinevirtual

Definition at line 112 of file IIOThreaded.H.

Here is the call graph for this function:

Member Function Documentation

◆ bufferInfo()

void IIOThreaded::bufferInfo ( )
inline

Definition at line 121 of file IIOThreaded.H.

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

◆ getFullBuffer()

Eigen::Array<unsigned short int, Eigen::Dynamic, Eigen::Dynamic>* IIOThreaded::getFullBuffer ( void  )
inline

Get the full buffer.

Returns
The buffer which was last filled.

Definition at line 130 of file IIOThreaded.H.

Here is the caller graph for this function:

◆ resizeBuffers()

int IIOThreaded::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 80 of file IIOThreaded.H.

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

◆ setSampleCountChannelCount()

int IIOThreaded::setSampleCountChannelCount ( uint  N,
uint  ch 
)
inline

Definition at line 117 of file IIOThreaded.H.

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

◆ threadMain()

void* IIOThreaded::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 36 of file IIOThreaded.H.

Here is the call graph for this function:

Member Data Documentation

◆ buffers

LinkList<Eigen::Array<unsigned short int, Eigen::Dynamic, Eigen::Dynamic> *> IIOThreaded::buffers
private

The load and unload buffers.

Definition at line 30 of file IIOThreaded.H.

◆ bufFull

bool IIOThreaded::bufFull

Indicates when the read has completed and a buffer is full.

Definition at line 105 of file IIOThreaded.H.

◆ fullBuffer

Eigen::Array<unsigned short int, Eigen::Dynamic, Eigen::Dynamic>* IIOThreaded::fullBuffer
private

Definition at line 31 of file IIOThreaded.H.


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