00001 #ifndef __orogen 00002 #include <stdint.h> 00003 #include <vector> 00004 #endif 00005 00006 namespace Test { 00007 enum BASIC_ENUM { 00008 VALUE_0, 00009 VALUE_1, 00010 VALUE_20 = 20, 00011 VALUE_100 = 100 00012 }; 00013 00014 struct BaseTypes { 00015 bool v0; 00016 char v1; 00017 unsigned char v2; 00018 short v3; 00019 unsigned short v4; 00020 int v5; 00021 unsigned int v6; 00022 00023 BASIC_ENUM e; 00024 char a[20]; 00025 00026 #ifndef __orogen 00027 bool operator == (BaseTypes const& other) const 00028 { 00029 if (other.v0 != v0) return false; 00030 if (other.v1 != v1) return false; 00031 if (other.v2 != v2) return false; 00032 if (other.v3 != v3) return false; 00033 if (other.v4 != v4) return false; 00034 if (other.v5 != v5) return false; 00035 if (other.v6 != v6) return false; 00036 00037 if (other.e != e) return false; 00038 00039 for (int it = 0; it < 20; ++it) 00040 { 00041 if (other.a[it] != a[it]) 00042 return false; 00043 } 00044 return true; 00045 } 00046 #endif 00047 }; 00048 00049 struct TestArrayOfDifferentSizes 00050 { 00051 int a[10]; 00052 int b[20]; 00053 }; 00054 00055 struct Test64BitHandling 00056 { 00057 BaseTypes base; 00058 long long ll; 00059 unsigned long long ull; 00060 00061 #ifndef __orogen 00062 bool operator == (Test64BitHandling const& other) const 00063 { 00064 if (!(other.base == base)) return false; 00065 if (other.ll != ll) return false; 00066 if (other.ull != ull) return false; 00067 return true; 00068 } 00069 #endif 00070 00071 }; 00072 00073 struct SimpleVector { 00074 uint32_t field; 00075 std::vector<uint8_t> data; 00076 #ifndef __orogen 00077 bool operator == (SimpleVector const& other) const 00078 { return field == other.field && data == other.data; } 00079 bool operator != (SimpleVector const& other) const 00080 { return !(*this == other); } 00081 #endif 00082 }; 00083 00084 struct ComplexVector 00085 { 00086 uint32_t field; 00087 std::vector<SimpleVector> data; 00088 #ifndef __orogen 00089 bool operator == (ComplexVector const& other) const 00090 { 00091 return field == other.field && data == other.data; 00092 } 00093 #endif 00094 }; 00095 00096 struct ComplexArray 00097 { 00098 uint32_t field; 00099 SimpleVector data[10]; 00100 #ifndef __orogen 00101 bool operator == (ComplexArray const& other) const 00102 { 00103 if (field != other.field) return false; 00104 for (int i = 0; i < 10; ++i) 00105 if (!(data[i] == other.data[i])) return false; 00106 return true; 00107 } 00108 #endif 00109 }; 00110 } 00111