PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
main.cpp File Reference
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

template<typename T >
void checkListDataMessage (const std::string &nameOfType)
 Check the list of data with message of a given type. More...
 
int main (int argc, char **argv)
 
void testListDataMessage ()
 Test if data size is Ok. More...
 

Function Documentation

◆ checkListDataMessage()

template<typename T >
void checkListDataMessage ( const std::string &  nameOfType)

Check the list of data with message of a given type.

Parameters
nameOfType: name of the type to be checked assert on fail

Definition at line 17 of file main.cpp.

17  {
18  size_t nbValue(10lu);
19 
20  std::list<T> vecData;
21  for(size_t i(0lu); i < nbValue; ++i){vecData.push_back(i);}
22  DataStreamMsg message(data_size(vecData));
23  //Put data in message
24  DataStreamIter iter = (DataStreamIter)message.data();
25  data_stream_assert(data_message_save(iter, vecData)); //Save the message
26  DataStreamIter loadIter = (DataStreamIter)message.data();
27  std::list<T> outVec(0lu);
28  data_stream_assert(data_message_load(loadIter, outVec)); //Load the message
29  data_stream_assert(checkValue("std::list<"+nameOfType+">", outVec, vecData));
30 }
bool data_message_save(DataStreamIter &iter, T &data)
Save data in a message.
Definition: data_message.h:18
bool data_message_load(DataStreamIter &iter, T &data)
Load data from a message.
Definition: data_message.h:60
size_t data_size(T &data)
Get size of data.
Definition: data_size.h:17
#define data_stream_assert(isOk)
bool checkValue(const std::string &testName, const T &givenSize, const T &referenceSize)
Check given value compare to the reference value.
std::vector< DataStreamType > DataStreamMsg
DataStreamType * DataStreamIter

References checkValue(), data_message_load(), data_message_save(), data_size(), and data_stream_assert.

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 50 of file main.cpp.

50  {
52  return 0;
53 }
void testListDataMessage()
Test if data size is Ok.
Definition: main.cpp:33

References testListDataMessage().

+ Here is the call graph for this function:

◆ testListDataMessage()

void testListDataMessage ( )

Test if data size is Ok.

Definition at line 33 of file main.cpp.

33  {
34  checkListDataMessage<long unsigned int>("long unsigned int");
35  checkListDataMessage<unsigned int>("unsigned int");
36  checkListDataMessage<unsigned short>("unsigned short");
37  checkListDataMessage<unsigned int>("unsigned int");
38  checkListDataMessage<unsigned char>("unsigned char");
39  checkListDataMessage<long int>("long int");
40  checkListDataMessage<int>("int");
41  checkListDataMessage<short>("short");
42  checkListDataMessage<int>("int");
43  checkListDataMessage<char>("char");
44  checkListDataMessage<float>("float");
45  checkListDataMessage<double>("double");
46  checkListDataMessage<int8_t>("int8_t");
47 }

Referenced by main().

+ Here is the caller graph for this function: