PhoenixSwarm  6.1.0
Persistent processing programs exchanging data over sockets
Loading...
Searching...
No Matches
main.cpp File Reference
#include "Shadok.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

bool checkShadokCopy ()
 Check copy of class Shadok.
bool checkShadokEquality (Shadok &var, Shadok &reference)
 Check the equality between two Shadok classes.
bool checkShadokEqualityConst (const Shadok &var, const Shadok &reference)
 Check the equality between two Shadok classes.
int main (int argc, char **argv)

Function Documentation

◆ checkShadokCopy()

bool checkShadokCopy ( )

Check copy of class Shadok.

Definition at line 32 of file main.cpp.

32 {
33 Shadok reference;
34 //Let's use the setters
35 reference.setAge(42);
36 Shadok varCopy(reference);
37 Shadok varEqual;
38 varEqual = reference;
39 bool b(true);
40 b &= checkShadokEquality(varCopy, reference);
41 b &= checkShadokEqualityConst(varCopy, reference);
42 b &= checkShadokEquality(varEqual, reference);
43 b &= checkShadokEqualityConst(varEqual, reference);
44 b &= phoenix_getTypeToStr<Shadok>() == "Shadok";
45 return b;
46}
bool checkShadokEqualityConst(const Shadok &var, const Shadok &reference)
Check the equality between two Shadok classes.
Definition main.cpp:25
bool checkShadokEquality(Shadok &var, Shadok &reference)
Check the equality between two Shadok classes.
Definition main.cpp:14
Test Shadok.
Definition Shadok.h:15
void setAge(int age)
Sets the age of the Shadok.
Definition Shadok.cpp:47

References checkShadokCopy(), checkShadokEquality(), checkShadokEqualityConst(), and Shadok::setAge().

Referenced by checkShadokCopy(), and main().

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

◆ checkShadokEquality()

bool checkShadokEquality ( Shadok & var,
Shadok & reference )

Check the equality between two Shadok classes.

Parameters
var: variable to be checked
reference: reference
Returns
true on success, false otherwise

Definition at line 14 of file main.cpp.

14 {
15 bool b(true);
16 b &= var.getAge() == reference.getAge();
17 return b;
18}
int getAge() const
Gets the age of the Shadok.
Definition Shadok.cpp:61

References checkShadokEquality(), and Shadok::getAge().

Referenced by checkShadokCopy(), and checkShadokEquality().

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

◆ checkShadokEqualityConst()

bool checkShadokEqualityConst ( const Shadok & var,
const Shadok & reference )

Check the equality between two Shadok classes.

Parameters
var: variable to be checked
reference: reference
Returns
true on success, false otherwise

Definition at line 25 of file main.cpp.

25 {
26 bool b(true);
27 b &= var.getAge() == reference.getAge();
28 return b;
29}

References checkShadokEqualityConst(), and Shadok::getAge().

Referenced by checkShadokCopy(), and checkShadokEqualityConst().

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

◆ main()

int main ( int argc,
char ** argv )

Definition at line 48 of file main.cpp.

48 {
49 bool b(checkShadokCopy());
50 return b - 1;
51}
bool checkShadokCopy()
Check copy of class Shadok.
Definition main.cpp:32

References checkShadokCopy(), and main().

Here is the call graph for this function: