LLURecord.h
Go to the documentation of this file.
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
9 //
10 // Ice version 3.7.0
11 //
12 // <auto-generated>
13 //
14 // Generated from file `LLURecord.ice'
15 //
16 // Warning: do not edit this file.
17 //
18 // </auto-generated>
19 //
20 
21 #ifndef __IceStorm_LLURecord_h__
22 #define __IceStorm_LLURecord_h__
23 
24 #include <Ice/Comparable.h>
25 #include <Ice/Exception.h>
26 #include <Ice/LocalObject.h>
27 #include <Ice/ObjectF.h>
28 #include <Ice/Optional.h>
29 #include <Ice/ProxyF.h>
30 #include <Ice/StreamHelpers.h>
31 #include <Ice/ValueF.h>
32 #include <IceUtil/PushDisableWarnings.h>
33 #include <IceUtil/ScopedArray.h>
34 #include <IceUtil/UndefSysMacros.h>
35 
36 #ifndef ICE_IGNORE_VERSION
37 #if ICE_INT_VERSION / 100 != 307
38 #error Ice version mismatch!
39 #endif
40 #if ICE_INT_VERSION % 100 > 50
41 #error Beta header file detected
42 #endif
43 #if ICE_INT_VERSION % 100 < 0
44 #error Ice patch level mismatch!
45 #endif
46 #endif
47 
48 #ifdef ICE_CPP11_MAPPING // C++11 mapping
49 
50 namespace IceStormElection
51 {
52 
53  struct LogUpdate
54  {
55  long long int generation;
56  long long int iteration;
57 
58  std::tuple<const long long int&, const long long int&>
59  ice_tuple() const
60  {
61  return std::tie(generation, iteration);
62  }
63  };
64 
65  using Ice::operator<;
66  using Ice::operator<=;
67  using Ice::operator>;
68  using Ice::operator>=;
69  using Ice::operator==;
70  using Ice::operator!=;
71 
72 } // namespace IceStormElection
73 
74 namespace Ice
75 {
76 
77  template <>
78  struct StreamableTraits<::IceStormElection::LogUpdate>
79  {
80  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
81  static const int minWireSize = 16;
82  static const bool fixedLength = true;
83  };
84 
85  template <typename S>
86  struct StreamReader<::IceStormElection::LogUpdate, S>
87  {
88  static void
90  {
91  istr->readAll(v.generation, v.iteration);
92  }
93  };
94 
95 } // namespace Ice
96 
97 #else // C++98 mapping
98 
99 namespace IceStormElection
100 {
101 
102  struct LogUpdate
103  {
106 
107  bool
108  operator==(const LogUpdate& rhs_) const
109  {
110  if (this == &rhs_)
111  {
112  return true;
113  }
114  if (generation != rhs_.generation)
115  {
116  return false;
117  }
118  if (iteration != rhs_.iteration)
119  {
120  return false;
121  }
122  return true;
123  }
124 
125  bool
126  operator<(const LogUpdate& rhs_) const
127  {
128  if (this == &rhs_)
129  {
130  return false;
131  }
132  if (generation < rhs_.generation)
133  {
134  return true;
135  }
136  else if (rhs_.generation < generation)
137  {
138  return false;
139  }
140  if (iteration < rhs_.iteration)
141  {
142  return true;
143  }
144  else if (rhs_.iteration < iteration)
145  {
146  return false;
147  }
148  return false;
149  }
150 
151  bool
152  operator!=(const LogUpdate& rhs_) const
153  {
154  return !operator==(rhs_);
155  }
156 
157  bool
158  operator<=(const LogUpdate& rhs_) const
159  {
160  return operator<(rhs_) || operator==(rhs_);
161  }
162 
163  bool
164  operator>(const LogUpdate& rhs_) const
165  {
166  return !operator<(rhs_) && !operator==(rhs_);
167  }
168 
169  bool
170  operator>=(const LogUpdate& rhs_) const
171  {
172  return !operator<(rhs_);
173  }
174  };
175 
176 } // namespace IceStormElection
177 
178 namespace Ice
179 {
180 
181  template <>
182  struct StreamableTraits<::IceStormElection::LogUpdate>
183  {
184  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
185  static const int minWireSize = 16;
186  static const bool fixedLength = true;
187  };
188 
189  template <typename S>
190  struct StreamWriter<::IceStormElection::LogUpdate, S>
191  {
192  static void
193  write(S* ostr, const ::IceStormElection::LogUpdate& v)
194  {
195  ostr->write(v.generation);
196  ostr->write(v.iteration);
197  }
198  };
199 
200  template <typename S>
201  struct StreamReader<::IceStormElection::LogUpdate, S>
202  {
203  static void
205  {
206  istr->read(v.generation);
207  istr->read(v.iteration);
208  }
209  };
210 
211 } // namespace Ice
212 
213 #endif
214 
215 #include <IceUtil/PopDisableWarnings.h>
216 #endif
IceStormElection::LogUpdate
A struct used for marking the last log update.
Definition: LLURecord.h:102
Ice::StreamWriter<::IceStormElection::LogUpdate, S >::write
static void write(S *ostr, const ::IceStormElection::LogUpdate &v)
Definition: LLURecord.h:193
IceStormElection::LogUpdate::generation
::Ice::Long generation
Definition: LLURecord.h:104
IceStormElection
Definition: DBTypes.ice:17
IceStormElection::LogUpdate::iteration
::Ice::Long iteration
Definition: LLURecord.h:105
Ice::StreamReader<::IceStormElection::LogUpdate, S >::read
static void read(S *istr, ::IceStormElection::LogUpdate &v)
Definition: LLURecord.h:204
armarx::read
void read(auto &eigen, auto *table)
Definition: FTSensorCalibrationGuiWidgetController.cpp:503
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:918
IceStormElection::LogUpdate::operator<
bool operator<(const LogUpdate &rhs_) const
Definition: LLURecord.h:126
IceStormElection::LogUpdate::operator<=
bool operator<=(const LogUpdate &rhs_) const
Definition: LLURecord.h:158
Ice
Definition: DBTypes.cpp:63
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
IceStormElection::LogUpdate::operator!=
bool operator!=(const LogUpdate &rhs_) const
Definition: LLURecord.h:152
IceStormElection::LogUpdate::operator>=
bool operator>=(const LogUpdate &rhs_) const
Definition: LLURecord.h:170
IceStormElection::LogUpdate::operator>
bool operator>(const LogUpdate &rhs_) const
Definition: LLURecord.h:164
IceStormElection::LogUpdate::operator==
bool operator==(const LogUpdate &rhs_) const
Definition: LLURecord.h:108