#include <assert.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#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 | Str2Lng |
class | T13_Buf< OutStreamBuf, AutoInternBuf > |
struct | StrmTmpFilBuf |
Derivation of std::filebuf for test13. More... | |
struct | VecDataOut |
This is one of the buffer types used in test13. More... | |
struct | LstDataOut |
struct | T13_Out< OutStreamBuf > |
struct | T13TmpNamFilBuf |
Typedefs | |
typedef string | DataIn |
After the template specializations, comes the library. | |
typedef long | DataOut |
Functions | |
int | main (int aArgC, const char **aArgV) |
Variables | |
static Str2Lng | str2Long |
The same functor is used everywhere. | |
static const rpa::thr_nb_t | myNbThr = ( ( 1 << 2 ) + 1 ) |
static rpa::testing_thread | myThrTests [myNbThr] |
static const size_t | myMaxElts = 500000 * TST_RATIO |
Maximum number of input data. | |
static DataOut | mySample [myMaxElts] |
static DataIn | myInputArr [myMaxElts] |
static std::list< DataIn > | myInputLst |
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 long 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.
First writes the strings in the array. We can use kind of container.
Puts all the input data into a list.
Here, the input containers are ready for testing. First try with a file as output. We need an temporary file to be created automatically. This is done by 'streambuf_tmpnam'.
All same tests, but now the output goes to a std::stringbuf.
DataIn myInputArr[myMaxElts] [static] |
These are the input container types. They are global because used by everyone, and some are too big for the stack. Any container can be used.
std::list< DataIn > myInputLst [static] |
const size_t myMaxElts = 500000 * TST_RATIO [static] |
Maximum number of input data.
const rpa::thr_nb_t myNbThr = ( ( 1 << 2 ) + 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. We cannot use any container type because threads are not copiable nor assignale, in the general case.