PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
main.cpp File Reference
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Classes

struct  DataStream< Stream, DataStreamMode::READ, ShadokType::ShadokType >
 Generic ShadokType deserialisation, load and size function for a ShadokType::ShadokType. More...
 
struct  DataStream< Stream, DataStreamMode::WRITE, ShadokType::ShadokType >
 Generic ShadokType serialisation, save and size function for a ShadokType::ShadokType. More...
 

Namespaces

 ShadokType
 

Enumerations

enum  ShadokType::ShadokType {
  ShadokType::NONE = 0 , ShadokType::HAUT = 1 , ShadokType::BAS = 2 , ShadokType::NONE = 0 ,
  ShadokType::HAUT = 1 , ShadokType::BAS = 2
}
 Type of the Shadok we want to serialized. More...
 

Functions

int main (int argc, char **argv)
 
void testShadokTypeFile ()
 Test the Shadok message. More...
 
void testShadokTypeMessage ()
 Test the Shadok message. More...
 
void testShadokTypeSize ()
 Test the Shadok size. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 87 of file main.cpp.

87  {
91  return 0;
92 }
void testShadokTypeFile()
Test the Shadok message.
Definition: main.cpp:74
void testShadokTypeMessage()
Test the Shadok message.
Definition: main.cpp:58
void testShadokTypeSize()
Test the Shadok size.
Definition: main.cpp:51

References testShadokTypeFile(), testShadokTypeMessage(), and testShadokTypeSize().

+ Here is the call graph for this function:

◆ testShadokTypeFile()

void testShadokTypeFile ( )

Test the Shadok message.

Load shadok from message

Definition at line 74 of file main.cpp.

74  {
76  std::string fileName("ShadokType.data");
77  data_save(fileName, type);
78 
81  data_load(fileName, out);
82 
83  data_stream_assert(checkValue("testShadokFile", out, type));
84 }
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition: data_file.h:39
bool data_save(FILE *iter, const T &data)
Save data in a message.
Definition: data_file.h:18
#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.
ShadokType
Type of the Shadok we want to serialized.
Definition: main.cpp:12

References ShadokType::BAS, checkValue(), data_load(), data_save(), and data_stream_assert.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testShadokTypeMessage()

void testShadokTypeMessage ( )

Test the Shadok message.

Load shadok from message

Definition at line 58 of file main.cpp.

58  {
60 
61  DataStreamMsg messageIn(data_size(type));
62  DataStreamIter iter = (DataStreamIter)messageIn.data();
64 
67  DataStreamIter iterOut = (DataStreamIter)messageIn.data();
69 
70  data_stream_assert(checkValue("testShadokMessage", out, type));
71 }
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
std::vector< DataStreamType > DataStreamMsg
DataStreamType * DataStreamIter

References ShadokType::BAS, checkValue(), data_message_load(), data_message_save(), data_size(), and data_stream_assert.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testShadokTypeSize()

void testShadokTypeSize ( )

Test the Shadok size.

Definition at line 51 of file main.cpp.

51  {
53  size_t shadokSize(data_size(type));
54  data_stream_assert(checkValue("testShadokTypeSize", shadokSize, 4lu));
55 }
@ HAUT
Definition: main.cpp:14

References checkValue(), data_size(), data_stream_assert, and ShadokType::HAUT.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: