#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <rpa/platforms.h>
#include <rpa/synchro.h>
#include <rpa/testing.h>
#include <rpa/containers/list.h>
#include <rpa/containers/vector.h>
#include <rpa/containers/row_iterator.h>
#include <rpa/containers/streambuf_tmpnam.h>
#include <rpa/testing_streambuf.h>
#include <rpa/algorithms/transform.h>
Classes | |
class | Str2Int |
class | T15_Buf< OutStrmBuf, InternBuf > |
class | T15_Out< OutStrmBuf > |
Typedefs | |
typedef string | DataIn |
After the template specializations, comes the library. | |
typedef int | DataOut |
Functions | |
int | main (int aArgC, const char **aArgV) |
T15_Out. | |
Variables | |
static const rpa::thr_nb_t | myNbThr = ( 1 << 3 ) |
static rpa::testing_thread | myThrTests [myNbThr] |
static const size_t | myMaxElts = 10000 * TST_RATIO |
static DataOut | mySample [myMaxElts] |
static std::deque< DataIn > | myInputDeq |
static std::vector< DataIn > | myInputVec |
typedef string DataIn |
After the template specializations, comes the library.
For the initialisation of buffers and files. It needs the definition of the template 'temporary<>'
typedef int DataOut |
int main | ( | int | aArgC, | |
const char ** | aArgV | |||
) |
Tries different types of per-thread buffers. Writes into different sorts of outputs, as long as they are streams. NOTE: We do not attempt to test obuf_iterator with a stream as buffer and a non-ostream_iterator_public output. It may make sense, I do not know yet.
Fills the containers. Used as input by all tests.
Now that we have a big set of input data, we copy it into other containers to serve as algorithm inputs.
Now fills a vector with the same input data. Any kind of input container can be used.
All same tests, but now the output goes to a std::stringbuf.
std::deque< DataIn > myInputDeq [static] |
These are the input container types. They are global because used by everyone, and some are too big for the stack. Any kind of container can be used.
std::vector< DataIn > myInputVec [static] |
const size_t myMaxElts = 10000 * TST_RATIO [static] |
Maximum number of input data
const rpa::thr_nb_t myNbThr = ( 1 << 3 ) [static] |
The maximum number of threads. Expressed as a power of two, because of the way thread numbers are incremented in this test : multiplied by two at each loop.
This contains the output results that each algorithm must calculate. This is tested with 'CmpStreams'.
rpa::testing_thread myThrTests[myNbThr] [static] |
The threads must be global because we have no idea about when they are actually created or stopped.