|
MASA-Core
|
Definition at line 55 of file Buffer2.hpp.
#include <Buffer2.hpp>
Public Member Functions | |
| Buffer2 (int bufferMax) | |
| virtual | ~Buffer2 () |
| int | readBuffer (cell_t *data, int nmemb) |
| int | writeBuffer (const cell_t *data, int nmemb) |
| void | waitEmptyBuffer () |
| void | destroy () |
| bool | isDestroyed () |
| int | getCapacity () |
| Returns the maximum capacity in bytes of the buffer. | |
| buffer2_statistics_t | getStatistics () |
| Returns a struct containing statistics of the buffer. | |
| void | setLogFile (string logFile, float interval) |
| Defines a logfile to receive the buffer statistics in each interval period. | |
Private Member Functions | |
| int | circularSkip (int len) |
| int | circularLoad (cell_t *dst, int len) |
| int | circularStore (const cell_t *src, int len) |
| int | sizeUsed () |
| int | sizeAvailable () |
| void | logThread () |
Static Private Member Functions | |
| static void * | staticLogThread (void *arg) |
Private Attributes | |
| buffer2_statistics_t | stats |
| float | tempBlockingWriteTime |
| float | tempBlockingReadTime |
| pthread_mutex_t | mutex |
| pthread_cond_t | notFullCond |
| pthread_cond_t | notEmptyCond |
| pthread_cond_t | emptyCond |
| pthread_cond_t | loggerCond |
| bool | destroyed |
| cell_t * | buffer |
| int | buffer_size |
| int | buffer_start |
| int | buffer_end |
| int | buffer_max |
| pthread_t | loggerThread |
| string | logFile |
| bool | isLogging |
| float | logInterval |
| Buffer2::Buffer2 | ( | int | bufferMax | ) |
Definition at line 38 of file Buffer2.cpp.
| Buffer2::~Buffer2 | ( | ) | [virtual] |
Definition at line 68 of file Buffer2.cpp.
| int Buffer2::circularLoad | ( | cell_t * | dst, |
| int | len | ||
| ) | [private] |
Definition at line 105 of file Buffer2.cpp.
| int Buffer2::circularSkip | ( | int | len | ) | [private] |
Definition at line 123 of file Buffer2.cpp.
| int Buffer2::circularStore | ( | const cell_t * | src, |
| int | len | ||
| ) | [private] |
Definition at line 139 of file Buffer2.cpp.
| void Buffer2::destroy | ( | ) |
Definition at line 73 of file Buffer2.cpp.
| int Buffer2::getCapacity | ( | ) |
Returns the maximum capacity in bytes of the buffer.
Definition at line 239 of file Buffer2.cpp.
Returns a struct containing statistics of the buffer.
Definition at line 243 of file Buffer2.cpp.
| bool Buffer2::isDestroyed | ( | ) |
Definition at line 92 of file Buffer2.cpp.
| void Buffer2::logThread | ( | ) | [private] |
Definition at line 259 of file Buffer2.cpp.
| int Buffer2::readBuffer | ( | cell_t * | data, |
| int | nmemb | ||
| ) |
Definition at line 166 of file Buffer2.cpp.
| void Buffer2::setLogFile | ( | string | logFile, |
| float | interval | ||
| ) |
Defines a logfile to receive the buffer statistics in each interval period.
| logFile | the filename of the log file. |
| interval | The period in seconds to log the statistics. |
Definition at line 286 of file Buffer2.cpp.
| int Buffer2::sizeAvailable | ( | ) | [private] |
Definition at line 154 of file Buffer2.cpp.
| int Buffer2::sizeUsed | ( | ) | [private] |
Definition at line 158 of file Buffer2.cpp.
| void * Buffer2::staticLogThread | ( | void * | arg | ) | [static, private] |
Definition at line 233 of file Buffer2.cpp.
| void Buffer2::waitEmptyBuffer | ( | ) |
Definition at line 96 of file Buffer2.cpp.
| int Buffer2::writeBuffer | ( | const cell_t * | data, |
| int | nmemb | ||
| ) |
Definition at line 204 of file Buffer2.cpp.
cell_t* Buffer2::buffer [private] |
Definition at line 103 of file Buffer2.hpp.
int Buffer2::buffer_end [private] |
Definition at line 106 of file Buffer2.hpp.
int Buffer2::buffer_max [private] |
Definition at line 107 of file Buffer2.hpp.
int Buffer2::buffer_size [private] |
Definition at line 104 of file Buffer2.hpp.
int Buffer2::buffer_start [private] |
Definition at line 105 of file Buffer2.hpp.
bool Buffer2::destroyed [private] |
Definition at line 101 of file Buffer2.hpp.
pthread_cond_t Buffer2::emptyCond [private] |
Definition at line 98 of file Buffer2.hpp.
bool Buffer2::isLogging [private] |
Definition at line 111 of file Buffer2.hpp.
string Buffer2::logFile [private] |
Definition at line 110 of file Buffer2.hpp.
pthread_cond_t Buffer2::loggerCond [private] |
Definition at line 99 of file Buffer2.hpp.
pthread_t Buffer2::loggerThread [private] |
Definition at line 109 of file Buffer2.hpp.
float Buffer2::logInterval [private] |
Definition at line 112 of file Buffer2.hpp.
pthread_mutex_t Buffer2::mutex [private] |
Definition at line 95 of file Buffer2.hpp.
pthread_cond_t Buffer2::notEmptyCond [private] |
Definition at line 97 of file Buffer2.hpp.
pthread_cond_t Buffer2::notFullCond [private] |
Definition at line 96 of file Buffer2.hpp.
buffer2_statistics_t Buffer2::stats [private] |
Definition at line 89 of file Buffer2.hpp.
float Buffer2::tempBlockingReadTime [private] |
Definition at line 92 of file Buffer2.hpp.
float Buffer2::tempBlockingWriteTime [private] |
Definition at line 91 of file Buffer2.hpp.
1.7.6.1