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 <IceUtil/PushDisableWarnings.h>
25 #include <Ice/ProxyF.h>
26 #include <Ice/ObjectF.h>
27 #include <Ice/ValueF.h>
28 #include <Ice/Exception.h>
29 #include <Ice/LocalObject.h>
30 #include <Ice/StreamHelpers.h>
31 #include <Ice/Comparable.h>
32 #include <IceUtil/ScopedArray.h>
33 #include <Ice/Optional.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&> ice_tuple() const
59  {
60  return std::tie(generation, iteration);
61  }
62  };
63 
64  using Ice::operator<;
65  using Ice::operator<=;
66  using Ice::operator>;
67  using Ice::operator>=;
68  using Ice::operator==;
69  using Ice::operator!=;
70 
71 }
72 
73 namespace Ice
74 {
75 
76  template<>
77  struct StreamableTraits<::IceStormElection::LogUpdate>
78  {
79  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
80  static const int minWireSize = 16;
81  static const bool fixedLength = true;
82  };
83 
84  template<typename S>
85  struct StreamReader<::IceStormElection::LogUpdate, S>
86  {
87  static void read(S* istr, ::IceStormElection::LogUpdate& v)
88  {
89  istr->readAll(v.generation, v.iteration);
90  }
91  };
92 
93 }
94 
95 #else // C++98 mapping
96 
97 namespace IceStormElection
98 {
99 
100  struct LogUpdate
101  {
104 
105  bool operator==(const LogUpdate& rhs_) const
106  {
107  if (this == &rhs_)
108  {
109  return true;
110  }
111  if (generation != rhs_.generation)
112  {
113  return false;
114  }
115  if (iteration != rhs_.iteration)
116  {
117  return false;
118  }
119  return true;
120  }
121 
122  bool operator<(const LogUpdate& rhs_) const
123  {
124  if (this == &rhs_)
125  {
126  return false;
127  }
128  if (generation < rhs_.generation)
129  {
130  return true;
131  }
132  else if (rhs_.generation < generation)
133  {
134  return false;
135  }
136  if (iteration < rhs_.iteration)
137  {
138  return true;
139  }
140  else if (rhs_.iteration < iteration)
141  {
142  return false;
143  }
144  return false;
145  }
146 
147  bool operator!=(const LogUpdate& rhs_) const
148  {
149  return !operator==(rhs_);
150  }
151  bool operator<=(const LogUpdate& rhs_) const
152  {
153  return operator<(rhs_) || operator==(rhs_);
154  }
155  bool operator>(const LogUpdate& rhs_) const
156  {
157  return !operator<(rhs_) && !operator==(rhs_);
158  }
159  bool operator>=(const LogUpdate& rhs_) const
160  {
161  return !operator<(rhs_);
162  }
163  };
164 
165 }
166 
167 namespace Ice
168 {
169 
170  template<>
171  struct StreamableTraits< ::IceStormElection::LogUpdate>
172  {
173  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
174  static const int minWireSize = 16;
175  static const bool fixedLength = true;
176  };
177 
178  template<typename S>
179  struct StreamWriter< ::IceStormElection::LogUpdate, S>
180  {
181  static void write(S* ostr, const ::IceStormElection::LogUpdate& v)
182  {
183  ostr->write(v.generation);
184  ostr->write(v.iteration);
185  }
186  };
187 
188  template<typename S>
189  struct StreamReader< ::IceStormElection::LogUpdate, S>
190  {
191  static void read(S* istr, ::IceStormElection::LogUpdate& v)
192  {
193  istr->read(v.generation);
194  istr->read(v.iteration);
195  }
196  };
197 
198 }
199 
200 #endif
201 
202 #include <IceUtil/PopDisableWarnings.h>
203 #endif
Ice::StreamWriter< ::IceStormElection::LogUpdate, S >::write
static void write(S *ostr, const ::IceStormElection::LogUpdate &v)
Definition: LLURecord.h:181
IceStormElection::LogUpdate
A struct used for marking the last log update.
Definition: LLURecord.h:100
Ice::StreamReader< ::IceStormElection::LogUpdate, S >::read
static void read(S *istr, ::IceStormElection::LogUpdate &v)
Definition: LLURecord.h:191
IceStormElection::LogUpdate::generation
::Ice::Long generation
Definition: LLURecord.h:102
IceStormElection
Definition: DBTypes.ice:17
IceStormElection::LogUpdate::iteration
::Ice::Long iteration
Definition: LLURecord.h:103
armarx::read
void read(auto &eigen, auto *table)
Definition: FTSensorCalibrationGuiWidgetController.cpp:462
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
IceStormElection::LogUpdate::operator<
bool operator<(const LogUpdate &rhs_) const
Definition: LLURecord.h:122
IceStormElection::LogUpdate::operator<=
bool operator<=(const LogUpdate &rhs_) const
Definition: LLURecord.h:151
Ice
Definition: DBTypes.cpp:64
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:147
IceStormElection::LogUpdate::operator>=
bool operator>=(const LogUpdate &rhs_) const
Definition: LLURecord.h:159
IceStormElection::LogUpdate::operator>
bool operator>(const LogUpdate &rhs_) const
Definition: LLURecord.h:155
IceStormElection::LogUpdate::operator==
bool operator==(const LogUpdate &rhs_) const
Definition: LLURecord.h:105