#include <assert.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <rpa/platforms.h>
#include <rpa/synchro.h>
#include <rpa/testing.h>
#include <rpa/containers/vector.h>
#include <rpa/containers/set.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 | Dbl2Int |
class | T14_Box< OutStrmBuf, TmpnamBuf > |
struct | filebuf_FsTmpNam |
Declared as a struct to make compile faster than typedef. More... | |
struct | T14_Out< TmpNamOutStrmBuf > |
struct | T14TmpNamFilBuf |
Typedefs | |
typedef double | DataIn |
After the template specializations, comes the library. | |
typedef int | DataOut |
Functions | |
int | main (int aArgC, const char **aArgV) |
Variables | |
static const rpa::thr_nb_t | myNbThr = ( ( 1 << 3 ) + 1 ) |
static rpa::testing_thread | myThrTests [myNbThr] |
static const size_t | myMaxElts = 100000 * TST_RATIO |
static DataOut | mySample [myMaxElts] |
static DataIn | myInputArr [myMaxElts] |
static std::set< DataIn > | myInputSet |
typedef double DataIn |
After the template specializations, comes the library.
Temporary file stream buffers need a temporary file created automatically. This template encapsulates the file buffers.
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.
This will make iostreams faster.
At the end, it is compared against the algorithms output.
Fills the containers. The algorithm 'transform' will convert to an integer. The content will never be changed.
It is possible to use any kind of input container.
DataIn myInputArr[myMaxElts] [static] |
These are the input container types. They are very big, and therefore not put on the stack.
std::set< DataIn > myInputSet [static] |
const size_t myMaxElts = 100000 * TST_RATIO [static] |
Maximum number of input data. The ratio is made for adjusting the testing time.
const rpa::thr_nb_t myNbThr = ( ( 1 << 3 ) + 1 ) [static] |
The maximum number of threads. Expressed as a power of two plus one, 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. This contains a pool of threads we want to use.