Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xdr_test.cpp
Go to the documentation of this file.
1 #include "xdr_test.h"
2 
3 bool test::operator=(const test &t2){
4  if(!(
5  i==t2.i && ui==t2.ui && f==t2.f && d==t2.d && li==t2.li && uli==t2.uli && s == t2.s
6  )){
7  return false;
8  }else{
9  size_t len=vi.size();
10  if(len!=t2.vi.size()){
11  return false;
12  }else{
13  for(size_t i=0; i<len; ++i)
14  if(vi[i]!=t2.vi[i])
15  return false;
16  }
17  }
18  return true;
19 }
20 
21 struct test get_obj(void){
22  test t;
23  t.i=-512;
24  t.ui=512;
25  t.f=-3.1415;
26  t.d=-3.1415;
27  t.li=-123456789;
28  t.uli=123456789;
29 
30  t.s="This is a string 1";
31 
32  t.vi.push_back(-1);
33  t.vi.push_back(-2);
34  t.vi.push_back(-3);
35  t.vi.push_back(-4);
36  t.vi.push_back(-5);
37 
38  return t;
39 }
40 
int i
Definition: xdr_test.h:8
double d
Definition: xdr_test.h:11
bool operator=(const test &t2)
Definition: xdr_test.cpp:3
long long int li
Definition: xdr_test.h:12
unsigned long long int uli
Definition: xdr_test.h:13
unsigned int ui
Definition: xdr_test.h:9
struct test get_obj(void)
Definition: xdr_test.cpp:21
vector< int > vi
Definition: xdr_test.h:16
Definition: xdr_test.h:7
string s
Definition: xdr_test.h:14
float f
Definition: xdr_test.h:10