Election.cpp
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 `Election.ice'
15 //
16 // Warning: do not edit this file.
17 //
18 // </auto-generated>
19 //
20 
21 #include <IceStorm/Election.h>
22 #include <IceUtil/PushDisableWarnings.h>
23 #include <Ice/LocalException.h>
24 #include <Ice/ValueFactory.h>
25 #include <Ice/OutgoingAsync.h>
26 #include <Ice/InputStream.h>
27 #include <Ice/OutputStream.h>
28 #include <Ice/LocalException.h>
29 #include <IceUtil/PopDisableWarnings.h>
30 
31 #if defined(_MSC_VER)
32 # pragma warning(disable:4458) // declaration of ... hides class member
33 #elif defined(__clang__)
34 # pragma clang diagnostic ignored "-Wshadow"
35 #elif defined(__GNUC__)
36 # pragma GCC diagnostic ignored "-Wshadow"
37 #endif
38 
39 #ifndef ICE_IGNORE_VERSION
40 # if ICE_INT_VERSION / 100 != 307
41 # error Ice version mismatch!
42 # endif
43 # if ICE_INT_VERSION % 100 > 50
44 # error Beta header file detected
45 # endif
46 # if ICE_INT_VERSION % 100 < 0
47 # error Ice patch level mismatch!
48 # endif
49 #endif
50 
51 #ifdef ICE_CPP11_MAPPING // C++11 mapping
52 
53 namespace
54 {
55 
56  const ::IceInternal::DefaultUserExceptionFactoryInit<::IceStormElection::ObserverInconsistencyException> iceC_IceStormElection_ObserverInconsistencyException_init("::IceStormElection::ObserverInconsistencyException");
57 
58  const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] =
59  {
60  "::Ice::Object",
61  "::IceStormElection::ReplicaObserver"
62  };
63  const ::std::string iceC_IceStormElection_ReplicaObserver_ops[] =
64  {
65  "addSubscriber",
66  "createTopic",
67  "destroyTopic",
68  "ice_id",
69  "ice_ids",
70  "ice_isA",
71  "ice_ping",
72  "init",
73  "removeSubscriber"
74  };
75  const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";
76  const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";
77  const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";
78  const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";
79  const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name = "removeSubscriber";
80 
81  const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] =
82  {
83  "::Ice::Object",
84  "::IceStormElection::TopicManagerSync"
85  };
86  const ::std::string iceC_IceStormElection_TopicManagerSync_ops[] =
87  {
88  "getContent",
89  "ice_id",
90  "ice_ids",
91  "ice_isA",
92  "ice_ping"
93  };
94  const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";
95 
96  const ::std::string iceC_IceStormElection_Node_ids[2] =
97  {
98  "::Ice::Object",
99  "::IceStormElection::Node"
100  };
101  const ::std::string iceC_IceStormElection_Node_ops[] =
102  {
103  "accept",
104  "areYouCoordinator",
105  "areYouThere",
106  "ice_id",
107  "ice_ids",
108  "ice_isA",
109  "ice_ping",
110  "invitation",
111  "nodes",
112  "query",
113  "ready",
114  "sync"
115  };
116  const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";
117  const ::std::string iceC_IceStormElection_Node_ready_name = "ready";
118  const ::std::string iceC_IceStormElection_Node_accept_name = "accept";
119  const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";
120  const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";
121  const ::std::string iceC_IceStormElection_Node_sync_name = "sync";
122  const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";
123  const ::std::string iceC_IceStormElection_Node_query_name = "query";
124 
125 }
126 
128 {
129 }
130 
131 const ::std::string&
132 IceStormElection::ObserverInconsistencyException::ice_staticId()
133 {
134  static const ::std::string typeId = "::IceStormElection::ObserverInconsistencyException";
135  return typeId;
136 }
137 
138 bool
139 IceStormElection::ReplicaObserver::ice_isA(::std::string s, const ::Ice::Current&) const
140 {
141  return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids, iceC_IceStormElection_ReplicaObserver_ids + 2, s);
142 }
143 
144 ::std::vector<::std::string>
145 IceStormElection::ReplicaObserver::ice_ids(const ::Ice::Current&) const
146 {
147  return ::std::vector<::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0], &iceC_IceStormElection_ReplicaObserver_ids[2]);
148 }
149 
150 ::std::string
151 IceStormElection::ReplicaObserver::ice_id(const ::Ice::Current&) const
152 {
153  return ice_staticId();
154 }
155 
156 const ::std::string&
158 {
159  static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
160  return typeId;
161 }
162 
163 bool
164 IceStormElection::ReplicaObserver::_iceD_init(::IceInternal::Incoming& inS, const ::Ice::Current& current)
165 {
166  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
167  auto istr = inS.startReadParams();
170  istr->readAll(iceP_llu, iceP_content);
171  inS.endReadParams();
172  this->init(::std::move(iceP_llu), ::std::move(iceP_content), current);
173  inS.writeEmptyParams();
174  return true;
175 }
176 
177 bool
178 IceStormElection::ReplicaObserver::_iceD_createTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
179 {
180  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
181  auto istr = inS.startReadParams();
183  ::std::string iceP_name;
184  istr->readAll(iceP_llu, iceP_name);
185  inS.endReadParams();
186  this->createTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
187  inS.writeEmptyParams();
188  return true;
189 }
190 
191 bool
192 IceStormElection::ReplicaObserver::_iceD_destroyTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
193 {
194  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
195  auto istr = inS.startReadParams();
197  ::std::string iceP_name;
198  istr->readAll(iceP_llu, iceP_name);
199  inS.endReadParams();
200  this->destroyTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
201  inS.writeEmptyParams();
202  return true;
203 }
204 
205 bool
206 IceStormElection::ReplicaObserver::_iceD_addSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
207 {
208  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
209  auto istr = inS.startReadParams();
211  ::std::string iceP_topic;
212  ::IceStorm::SubscriberRecord iceP_record;
213  istr->readAll(iceP_llu, iceP_topic, iceP_record);
214  inS.endReadParams();
215  this->addSubscriber(::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_record), current);
216  inS.writeEmptyParams();
217  return true;
218 }
219 
220 bool
221 IceStormElection::ReplicaObserver::_iceD_removeSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
222 {
223  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
224  auto istr = inS.startReadParams();
226  ::std::string iceP_topic;
227  ::Ice::IdentitySeq iceP_subscribers;
228  istr->readAll(iceP_llu, iceP_topic, iceP_subscribers);
229  inS.endReadParams();
230  this->removeSubscriber(::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_subscribers), current);
231  inS.writeEmptyParams();
232  return true;
233 }
234 
235 bool
236 IceStormElection::ReplicaObserver::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
237 {
238  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_ReplicaObserver_ops, iceC_IceStormElection_ReplicaObserver_ops + 9, current.operation);
239  if (r.first == r.second)
240  {
241  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
242  }
243 
244  switch (r.first - iceC_IceStormElection_ReplicaObserver_ops)
245  {
246  case 0:
247  {
248  return _iceD_addSubscriber(in, current);
249  }
250  case 1:
251  {
252  return _iceD_createTopic(in, current);
253  }
254  case 2:
255  {
256  return _iceD_destroyTopic(in, current);
257  }
258  case 3:
259  {
260  return _iceD_ice_id(in, current);
261  }
262  case 4:
263  {
264  return _iceD_ice_ids(in, current);
265  }
266  case 5:
267  {
268  return _iceD_ice_isA(in, current);
269  }
270  case 6:
271  {
272  return _iceD_ice_ping(in, current);
273  }
274  case 7:
275  {
276  return _iceD_init(in, current);
277  }
278  case 8:
279  {
280  return _iceD_removeSubscriber(in, current);
281  }
282  default:
283  {
284  assert(false);
285  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
286  }
287  }
288 }
289 
290 bool
291 IceStormElection::TopicManagerSync::ice_isA(::std::string s, const ::Ice::Current&) const
292 {
293  return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids, iceC_IceStormElection_TopicManagerSync_ids + 2, s);
294 }
295 
296 ::std::vector<::std::string>
297 IceStormElection::TopicManagerSync::ice_ids(const ::Ice::Current&) const
298 {
299  return ::std::vector<::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0], &iceC_IceStormElection_TopicManagerSync_ids[2]);
300 }
301 
302 ::std::string
303 IceStormElection::TopicManagerSync::ice_id(const ::Ice::Current&) const
304 {
305  return ice_staticId();
306 }
307 
308 const ::std::string&
310 {
311  static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
312  return typeId;
313 }
314 
315 bool
316 IceStormElection::TopicManagerSync::_iceD_getContent(::IceInternal::Incoming& inS, const ::Ice::Current& current)
317 {
318  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
319  inS.readEmptyParams();
322  this->getContent(iceP_llu, iceP_content, current);
323  auto ostr = inS.startWriteParams();
324  ostr->writeAll(iceP_llu, iceP_content);
325  inS.endWriteParams();
326  return true;
327 }
328 
329 bool
330 IceStormElection::TopicManagerSync::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
331 {
332  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_TopicManagerSync_ops, iceC_IceStormElection_TopicManagerSync_ops + 5, current.operation);
333  if (r.first == r.second)
334  {
335  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
336  }
337 
338  switch (r.first - iceC_IceStormElection_TopicManagerSync_ops)
339  {
340  case 0:
341  {
342  return _iceD_getContent(in, current);
343  }
344  case 1:
345  {
346  return _iceD_ice_id(in, current);
347  }
348  case 2:
349  {
350  return _iceD_ice_ids(in, current);
351  }
352  case 3:
353  {
354  return _iceD_ice_isA(in, current);
355  }
356  case 4:
357  {
358  return _iceD_ice_ping(in, current);
359  }
360  default:
361  {
362  assert(false);
363  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
364  }
365  }
366 }
367 
368 bool
369 IceStormElection::Node::ice_isA(::std::string s, const ::Ice::Current&) const
370 {
371  return ::std::binary_search(iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
372 }
373 
374 ::std::vector<::std::string>
375 IceStormElection::Node::ice_ids(const ::Ice::Current&) const
376 {
377  return ::std::vector<::std::string>(&iceC_IceStormElection_Node_ids[0], &iceC_IceStormElection_Node_ids[2]);
378 }
379 
380 ::std::string
381 IceStormElection::Node::ice_id(const ::Ice::Current&) const
382 {
383  return ice_staticId();
384 }
385 
386 const ::std::string&
388 {
389  static const ::std::string typeId = "::IceStormElection::Node";
390  return typeId;
391 }
392 
393 bool
394 IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS, const ::Ice::Current& current)
395 {
396  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
397  auto istr = inS.startReadParams();
398  int iceP_j;
399  ::std::string iceP_gn;
400  istr->readAll(iceP_j, iceP_gn);
401  inS.endReadParams();
402  this->invitation(iceP_j, ::std::move(iceP_gn), current);
403  inS.writeEmptyParams();
404  return true;
405 }
406 
407 bool
408 IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
409 {
410  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
411  auto istr = inS.startReadParams();
412  int iceP_j;
413  ::std::string iceP_gn;
414  ::std::shared_ptr<::Ice::ObjectPrx> iceP_coordinator;
415  int iceP_max;
416  long long int iceP_generation;
417  istr->readAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation);
418  inS.endReadParams();
419  this->ready(iceP_j, ::std::move(iceP_gn), ::std::move(iceP_coordinator), iceP_max, iceP_generation, current);
420  inS.writeEmptyParams();
421  return true;
422 }
423 
424 bool
425 IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
426 {
427  _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
428  auto istr = inS.startReadParams();
429  int iceP_j;
430  ::std::string iceP_gn;
431  ::Ice::IntSeq iceP_forwardedInvites;
432  ::std::shared_ptr<::Ice::ObjectPrx> iceP_observer;
434  int iceP_max;
435  istr->readAll(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
436  inS.endReadParams();
437  this->accept(iceP_j, ::std::move(iceP_gn), ::std::move(iceP_forwardedInvites), ::std::move(iceP_observer), ::std::move(iceP_llu), iceP_max, current);
438  inS.writeEmptyParams();
439  return true;
440 }
441 
442 bool
443 IceStormElection::Node::_iceD_areYouCoordinator(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
444 {
445  _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
446  inS.readEmptyParams();
447  bool ret = this->areYouCoordinator(current);
448  auto ostr = inS.startWriteParams();
449  ostr->writeAll(ret);
450  inS.endWriteParams();
451  return true;
452 }
453 
454 bool
455 IceStormElection::Node::_iceD_areYouThere(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
456 {
457  _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
458  auto istr = inS.startReadParams();
459  ::std::string iceP_gn;
460  int iceP_j;
461  istr->readAll(iceP_gn, iceP_j);
462  inS.endReadParams();
463  bool ret = this->areYouThere(::std::move(iceP_gn), iceP_j, current);
464  auto ostr = inS.startWriteParams();
465  ostr->writeAll(ret);
466  inS.endWriteParams();
467  return true;
468 }
469 
470 bool
471 IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
472 {
473  _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
474  inS.readEmptyParams();
475  ::std::shared_ptr<::Ice::ObjectPrx> ret = this->sync(current);
476  auto ostr = inS.startWriteParams();
477  ostr->writeAll(ret);
478  inS.endWriteParams();
479  return true;
480 }
481 
482 bool
483 IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
484 {
485  _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
486  inS.readEmptyParams();
487  ::IceStormElection::NodeInfoSeq ret = this->nodes(current);
488  auto ostr = inS.startWriteParams();
489  ostr->writeAll(ret);
490  inS.endWriteParams();
491  return true;
492 }
493 
494 bool
495 IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
496 {
497  _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
498  inS.readEmptyParams();
499  ::IceStormElection::QueryInfo ret = this->query(current);
500  auto ostr = inS.startWriteParams();
501  ostr->writeAll(ret);
502  inS.endWriteParams();
503  return true;
504 }
505 
506 bool
507 IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
508 {
509  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_Node_ops, iceC_IceStormElection_Node_ops + 12, current.operation);
510  if (r.first == r.second)
511  {
512  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
513  }
514 
515  switch (r.first - iceC_IceStormElection_Node_ops)
516  {
517  case 0:
518  {
519  return _iceD_accept(in, current);
520  }
521  case 1:
522  {
523  return _iceD_areYouCoordinator(in, current);
524  }
525  case 2:
526  {
527  return _iceD_areYouThere(in, current);
528  }
529  case 3:
530  {
531  return _iceD_ice_id(in, current);
532  }
533  case 4:
534  {
535  return _iceD_ice_ids(in, current);
536  }
537  case 5:
538  {
539  return _iceD_ice_isA(in, current);
540  }
541  case 6:
542  {
543  return _iceD_ice_ping(in, current);
544  }
545  case 7:
546  {
547  return _iceD_invitation(in, current);
548  }
549  case 8:
550  {
551  return _iceD_nodes(in, current);
552  }
553  case 9:
554  {
555  return _iceD_query(in, current);
556  }
557  case 10:
558  {
559  return _iceD_ready(in, current);
560  }
561  case 11:
562  {
563  return _iceD_sync(in, current);
564  }
565  default:
566  {
567  assert(false);
568  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
569  }
570  }
571 }
572 
573 void
574 IceStormElection::ReplicaObserverPrx::_iceI_init(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::IceStormElection::LogUpdate& iceP_llu, const ::IceStormElection::TopicContentSeq& iceP_content, const ::Ice::Context& context)
575 {
576  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name);
577  outAsync->invoke(iceC_IceStormElection_ReplicaObserver_init_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
578  [&](::Ice::OutputStream * ostr)
579  {
580  ostr->writeAll(iceP_llu, iceP_content);
581  },
582  [](const ::Ice::UserException & ex)
583  {
584  try
585  {
586  ex.ice_throw();
587  }
588  catch (const ::IceStormElection::ObserverInconsistencyException&)
589  {
590  throw;
591  }
592  catch (const ::Ice::UserException&)
593  {
594  }
595  });
596 }
597 
598 void
599 IceStormElection::ReplicaObserverPrx::_iceI_createTopic(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context)
600 {
601  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name);
602  outAsync->invoke(iceC_IceStormElection_ReplicaObserver_createTopic_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
603  [&](::Ice::OutputStream * ostr)
604  {
605  ostr->writeAll(iceP_llu, iceP_name);
606  },
607  [](const ::Ice::UserException & ex)
608  {
609  try
610  {
611  ex.ice_throw();
612  }
613  catch (const ::IceStormElection::ObserverInconsistencyException&)
614  {
615  throw;
616  }
617  catch (const ::Ice::UserException&)
618  {
619  }
620  });
621 }
622 
623 void
624 IceStormElection::ReplicaObserverPrx::_iceI_destroyTopic(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context)
625 {
626  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
627  outAsync->invoke(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
628  [&](::Ice::OutputStream * ostr)
629  {
630  ostr->writeAll(iceP_llu, iceP_name);
631  },
632  [](const ::Ice::UserException & ex)
633  {
634  try
635  {
636  ex.ice_throw();
637  }
638  catch (const ::IceStormElection::ObserverInconsistencyException&)
639  {
640  throw;
641  }
642  catch (const ::Ice::UserException&)
643  {
644  }
645  });
646 }
647 
648 void
649 IceStormElection::ReplicaObserverPrx::_iceI_addSubscriber(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::IceStorm::SubscriberRecord& iceP_record, const ::Ice::Context& context)
650 {
651  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
652  outAsync->invoke(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
653  [&](::Ice::OutputStream * ostr)
654  {
655  ostr->writeAll(iceP_llu, iceP_topic, iceP_record);
656  },
657  [](const ::Ice::UserException & ex)
658  {
659  try
660  {
661  ex.ice_throw();
662  }
663  catch (const ::IceStormElection::ObserverInconsistencyException&)
664  {
665  throw;
666  }
667  catch (const ::Ice::UserException&)
668  {
669  }
670  });
671 }
672 
673 void
674 IceStormElection::ReplicaObserverPrx::_iceI_removeSubscriber(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::Ice::IdentitySeq& iceP_subscribers, const ::Ice::Context& context)
675 {
676  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
677  outAsync->invoke(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
678  [&](::Ice::OutputStream * ostr)
679  {
680  ostr->writeAll(iceP_llu, iceP_topic, iceP_subscribers);
681  },
682  [](const ::Ice::UserException & ex)
683  {
684  try
685  {
686  ex.ice_throw();
687  }
688  catch (const ::IceStormElection::ObserverInconsistencyException&)
689  {
690  throw;
691  }
692  catch (const ::Ice::UserException&)
693  {
694  }
695  });
696 }
697 
698 ::std::shared_ptr<::Ice::ObjectPrx>
699 IceStormElection::ReplicaObserverPrx::_newInstance() const
700 {
701  return ::IceInternal::createProxy<ReplicaObserverPrx>();
702 }
703 
704 const ::std::string&
705 IceStormElection::ReplicaObserverPrx::ice_staticId()
706 {
708 }
709 
710 void
711 IceStormElection::TopicManagerSyncPrx::_iceI_getContent(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::TopicManagerSync::GetContentResult>>& outAsync, const ::Ice::Context& context)
712 {
713  _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name);
714  outAsync->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
715  nullptr,
716  nullptr,
717  [](::Ice::InputStream * istr)
718  {
719  ::IceStormElection::TopicManagerSync::GetContentResult v;
720  istr->readAll(v.llu, v.content);
721  return v;
722  });
723 }
724 
725 ::std::shared_ptr<::Ice::ObjectPrx>
726 IceStormElection::TopicManagerSyncPrx::_newInstance() const
727 {
728  return ::IceInternal::createProxy<TopicManagerSyncPrx>();
729 }
730 
731 const ::std::string&
732 IceStormElection::TopicManagerSyncPrx::ice_staticId()
733 {
735 }
736 
737 void
738 IceStormElection::NodePrx::_iceI_invitation(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::Ice::Context& context)
739 {
740  outAsync->invoke(iceC_IceStormElection_Node_invitation_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
741  [&](::Ice::OutputStream * ostr)
742  {
743  ostr->writeAll(iceP_j, iceP_gn);
744  },
745  nullptr);
746 }
747 
748 void
749 IceStormElection::NodePrx::_iceI_ready(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_coordinator, int iceP_max, long long int iceP_generation, const ::Ice::Context& context)
750 {
751  outAsync->invoke(iceC_IceStormElection_Node_ready_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
752  [&](::Ice::OutputStream * ostr)
753  {
754  ostr->writeAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation);
755  },
756  nullptr);
757 }
758 
759 void
760 IceStormElection::NodePrx::_iceI_accept(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::Ice::IntSeq& iceP_forwardedInvites, const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_observer, const ::IceStormElection::LogUpdate& iceP_llu, int iceP_max, const ::Ice::Context& context)
761 {
762  outAsync->invoke(iceC_IceStormElection_Node_accept_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
763  [&](::Ice::OutputStream * ostr)
764  {
765  ostr->writeAll(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
766  },
767  nullptr);
768 }
769 
770 void
771 IceStormElection::NodePrx::_iceI_areYouCoordinator(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync, const ::Ice::Context& context)
772 {
773  _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name);
774  outAsync->invoke(iceC_IceStormElection_Node_areYouCoordinator_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
775  nullptr,
776  nullptr);
777 }
778 
779 void
780 IceStormElection::NodePrx::_iceI_areYouThere(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync, const ::std::string& iceP_gn, int iceP_j, const ::Ice::Context& context)
781 {
782  _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name);
783  outAsync->invoke(iceC_IceStormElection_Node_areYouThere_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
784  [&](::Ice::OutputStream * ostr)
785  {
786  ostr->writeAll(iceP_gn, iceP_j);
787  },
788  nullptr);
789 }
790 
791 void
792 IceStormElection::NodePrx::_iceI_sync(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::std::shared_ptr<::Ice::ObjectPrx>>>& outAsync, const ::Ice::Context& context)
793 {
794  _checkTwowayOnly(iceC_IceStormElection_Node_sync_name);
795  outAsync->invoke(iceC_IceStormElection_Node_sync_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
796  nullptr,
797  nullptr);
798 }
799 
800 void
801 IceStormElection::NodePrx::_iceI_nodes(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::NodeInfoSeq>>& outAsync, const ::Ice::Context& context)
802 {
803  _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name);
804  outAsync->invoke(iceC_IceStormElection_Node_nodes_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
805  nullptr,
806  nullptr);
807 }
808 
809 void
810 IceStormElection::NodePrx::_iceI_query(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::QueryInfo>>& outAsync, const ::Ice::Context& context)
811 {
812  _checkTwowayOnly(iceC_IceStormElection_Node_query_name);
813  outAsync->invoke(iceC_IceStormElection_Node_query_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
814  nullptr,
815  nullptr);
816 }
817 
818 ::std::shared_ptr<::Ice::ObjectPrx>
819 IceStormElection::NodePrx::_newInstance() const
820 {
821  return ::IceInternal::createProxy<NodePrx>();
822 }
823 
824 const ::std::string&
825 IceStormElection::NodePrx::ice_staticId()
826 {
828 }
829 
830 namespace Ice
831 {
832 }
833 
834 #else // C++98 mapping
835 
836 namespace
837 {
838 
839  const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";
840 
841  const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";
842 
843  const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";
844 
845  const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";
846 
847  const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name = "removeSubscriber";
848 
849  const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";
850 
851  const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";
852 
853  const ::std::string iceC_IceStormElection_Node_ready_name = "ready";
854 
855  const ::std::string iceC_IceStormElection_Node_accept_name = "accept";
856 
857  const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";
858 
859  const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";
860 
861  const ::std::string iceC_IceStormElection_Node_sync_name = "sync";
862 
863  const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";
864 
865  const ::std::string iceC_IceStormElection_Node_query_name = "query";
866 
867 }
868 
869 namespace
870 {
871 
872  const ::IceInternal::DefaultUserExceptionFactoryInit< ::IceStormElection::ObserverInconsistencyException> iceC_IceStormElection_ObserverInconsistencyException_init("::IceStormElection::ObserverInconsistencyException");
873 
874 }
875 
877  ::Ice::UserException(),
878  reason(iceP_reason)
879 {
880 }
881 
883 {
884 }
885 
886 ::std::string
888 {
889  return "::IceStormElection::ObserverInconsistencyException";
890 }
891 
894 {
895  return new ObserverInconsistencyException(*this);
896 }
897 
898 void
900 {
901  throw* this;
902 }
903 
904 void
906 {
907  ostr->startSlice("::IceStormElection::ObserverInconsistencyException", -1, true);
909  ostr->endSlice();
910 }
911 
912 void
914 {
915  istr->startSlice();
917  istr->endSlice();
918 }
920 {
921  return p;
922 }
923 
924 void
926 {
927  ::Ice::ObjectPrx proxy;
928  istr->read(proxy);
929  if (!proxy)
930  {
931  v = 0;
932  }
933  else
934  {
935  v = new ::IceProxy::IceStormElection::ReplicaObserver;
936  v->_copyFrom(proxy);
937  }
938 }
939 
940 ::Ice::AsyncResultPtr
941 IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_init(const ::IceStormElection::LogUpdate& iceP_llu, const ::IceStormElection::TopicContentSeq& iceP_content, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
942 {
943  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name, sync);
944  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_init_name, del, cookie, sync);
945  try
946  {
947  result->prepare(iceC_IceStormElection_ReplicaObserver_init_name, ::Ice::Normal, context);
948  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
949  ostr->write(iceP_llu);
950  ostr->write(iceP_content);
951  result->endWriteParams();
952  result->invoke(iceC_IceStormElection_ReplicaObserver_init_name);
953  }
954  catch (const ::Ice::Exception& ex)
955  {
956  result->abort(ex);
957  }
958  return result;
959 }
960 
961 void
962 IceProxy::IceStormElection::ReplicaObserver::end_init(const ::Ice::AsyncResultPtr& result)
963 {
964  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_init_name);
965  if (!result->_waitForResponse())
966  {
967  try
968  {
969  result->_throwUserException();
970  }
971  catch (const ::IceStormElection::ObserverInconsistencyException&)
972  {
973  throw;
974  }
975  catch (const ::Ice::UserException& ex)
976  {
977  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
978  }
979  }
980  result->_readEmptyParams();
981 }
982 
983 ::Ice::AsyncResultPtr
984 IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_createTopic(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
985 {
986  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name, sync);
987  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_createTopic_name, del, cookie, sync);
988  try
989  {
990  result->prepare(iceC_IceStormElection_ReplicaObserver_createTopic_name, ::Ice::Normal, context);
991  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
992  ostr->write(iceP_llu);
993  ostr->write(iceP_name);
994  result->endWriteParams();
995  result->invoke(iceC_IceStormElection_ReplicaObserver_createTopic_name);
996  }
997  catch (const ::Ice::Exception& ex)
998  {
999  result->abort(ex);
1000  }
1001  return result;
1002 }
1003 
1004 void
1006 {
1007  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_createTopic_name);
1008  if (!result->_waitForResponse())
1009  {
1010  try
1011  {
1012  result->_throwUserException();
1013  }
1014  catch (const ::IceStormElection::ObserverInconsistencyException&)
1015  {
1016  throw;
1017  }
1018  catch (const ::Ice::UserException& ex)
1019  {
1020  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1021  }
1022  }
1023  result->_readEmptyParams();
1024 }
1025 
1026 ::Ice::AsyncResultPtr
1027 IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_destroyTopic(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1028 {
1029  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, sync);
1030  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name, del, cookie, sync);
1031  try
1032  {
1033  result->prepare(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, ::Ice::Normal, context);
1034  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1035  ostr->write(iceP_llu);
1036  ostr->write(iceP_name);
1037  result->endWriteParams();
1038  result->invoke(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
1039  }
1040  catch (const ::Ice::Exception& ex)
1041  {
1042  result->abort(ex);
1043  }
1044  return result;
1045 }
1046 
1047 void
1049 {
1050  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
1051  if (!result->_waitForResponse())
1052  {
1053  try
1054  {
1055  result->_throwUserException();
1056  }
1057  catch (const ::IceStormElection::ObserverInconsistencyException&)
1058  {
1059  throw;
1060  }
1061  catch (const ::Ice::UserException& ex)
1062  {
1063  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1064  }
1065  }
1066  result->_readEmptyParams();
1067 }
1068 
1069 ::Ice::AsyncResultPtr
1070 IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_addSubscriber(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::IceStorm::SubscriberRecord& iceP_record, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1071 {
1072  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, sync);
1073  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name, del, cookie, sync);
1074  try
1075  {
1076  result->prepare(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, ::Ice::Normal, context);
1077  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1078  ostr->write(iceP_llu);
1079  ostr->write(iceP_topic);
1080  ostr->write(iceP_record);
1081  result->endWriteParams();
1082  result->invoke(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
1083  }
1084  catch (const ::Ice::Exception& ex)
1085  {
1086  result->abort(ex);
1087  }
1088  return result;
1089 }
1090 
1091 void
1093 {
1094  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
1095  if (!result->_waitForResponse())
1096  {
1097  try
1098  {
1099  result->_throwUserException();
1100  }
1101  catch (const ::IceStormElection::ObserverInconsistencyException&)
1102  {
1103  throw;
1104  }
1105  catch (const ::Ice::UserException& ex)
1106  {
1107  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1108  }
1109  }
1110  result->_readEmptyParams();
1111 }
1112 
1113 ::Ice::AsyncResultPtr
1114 IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_removeSubscriber(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::Ice::IdentitySeq& iceP_subscribers, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1115 {
1116  _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, sync);
1117  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, del, cookie, sync);
1118  try
1119  {
1120  result->prepare(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, ::Ice::Normal, context);
1121  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1122  ostr->write(iceP_llu);
1123  ostr->write(iceP_topic);
1124  ostr->write(iceP_subscribers);
1125  result->endWriteParams();
1126  result->invoke(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
1127  }
1128  catch (const ::Ice::Exception& ex)
1129  {
1130  result->abort(ex);
1131  }
1132  return result;
1133 }
1134 
1135 void
1137 {
1138  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
1139  if (!result->_waitForResponse())
1140  {
1141  try
1142  {
1143  result->_throwUserException();
1144  }
1145  catch (const ::IceStormElection::ObserverInconsistencyException&)
1146  {
1147  throw;
1148  }
1149  catch (const ::Ice::UserException& ex)
1150  {
1151  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1152  }
1153  }
1154  result->_readEmptyParams();
1155 }
1156 
1157 ::IceProxy::Ice::Object*
1159 {
1160  return new ReplicaObserver;
1161 }
1162 
1163 const ::std::string&
1165 {
1166  return ::IceStormElection::ReplicaObserver::ice_staticId();
1167 }
1169 {
1170  return p;
1171 }
1172 
1173 void
1175 {
1176  ::Ice::ObjectPrx proxy;
1177  istr->read(proxy);
1178  if (!proxy)
1179  {
1180  v = 0;
1181  }
1182  else
1183  {
1184  v = new ::IceProxy::IceStormElection::TopicManagerSync;
1185  v->_copyFrom(proxy);
1186  }
1187 }
1188 
1189 ::Ice::AsyncResultPtr
1190 IceProxy::IceStormElection::TopicManagerSync::_iceI_begin_getContent(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1191 {
1192  _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name, sync);
1193  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_TopicManagerSync_getContent_name, del, cookie, sync);
1194  try
1195  {
1196  result->prepare(iceC_IceStormElection_TopicManagerSync_getContent_name, ::Ice::Normal, context);
1197  result->writeEmptyParams();
1198  result->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name);
1199  }
1200  catch (const ::Ice::Exception& ex)
1201  {
1202  result->abort(ex);
1203  }
1204  return result;
1205 }
1206 
1207 void
1209 {
1210  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_TopicManagerSync_getContent_name);
1211  if (!result->_waitForResponse())
1212  {
1213  try
1214  {
1215  result->_throwUserException();
1216  }
1217  catch (const ::Ice::UserException& ex)
1218  {
1219  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1220  }
1221  }
1222  ::Ice::InputStream* istr = result->_startReadParams();
1223  istr->read(iceP_llu);
1224  istr->read(iceP_content);
1225  result->_endReadParams();
1226 }
1227 
1228 ::IceProxy::Ice::Object*
1230 {
1231  return new TopicManagerSync;
1232 }
1233 
1234 const ::std::string&
1236 {
1237  return ::IceStormElection::TopicManagerSync::ice_staticId();
1238 }
1240 {
1241  return p;
1242 }
1243 
1244 void
1246 {
1247  ::Ice::ObjectPrx proxy;
1248  istr->read(proxy);
1249  if (!proxy)
1250  {
1251  v = 0;
1252  }
1253  else
1254  {
1255  v = new ::IceProxy::IceStormElection::Node;
1256  v->_copyFrom(proxy);
1257  }
1258 }
1259 
1260 ::Ice::AsyncResultPtr
1261 IceProxy::IceStormElection::Node::_iceI_begin_invitation(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1262 {
1263  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_invitation_name, del, cookie, sync);
1264  try
1265  {
1266  result->prepare(iceC_IceStormElection_Node_invitation_name, ::Ice::Normal, context);
1267  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1268  ostr->write(iceP_j);
1269  ostr->write(iceP_gn);
1270  result->endWriteParams();
1271  result->invoke(iceC_IceStormElection_Node_invitation_name);
1272  }
1273  catch (const ::Ice::Exception& ex)
1274  {
1275  result->abort(ex);
1276  }
1277  return result;
1278 }
1279 
1280 void
1281 IceProxy::IceStormElection::Node::end_invitation(const ::Ice::AsyncResultPtr& result)
1282 {
1283  _end(result, iceC_IceStormElection_Node_invitation_name);
1284 }
1285 
1286 ::Ice::AsyncResultPtr
1287 IceProxy::IceStormElection::Node::_iceI_begin_ready(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::ObjectPrx& iceP_coordinator, ::Ice::Int iceP_max, ::Ice::Long iceP_generation, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1288 {
1289  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_ready_name, del, cookie, sync);
1290  try
1291  {
1292  result->prepare(iceC_IceStormElection_Node_ready_name, ::Ice::Normal, context);
1293  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1294  ostr->write(iceP_j);
1295  ostr->write(iceP_gn);
1296  ostr->write(iceP_coordinator);
1297  ostr->write(iceP_max);
1298  ostr->write(iceP_generation);
1299  result->endWriteParams();
1300  result->invoke(iceC_IceStormElection_Node_ready_name);
1301  }
1302  catch (const ::Ice::Exception& ex)
1303  {
1304  result->abort(ex);
1305  }
1306  return result;
1307 }
1308 
1309 void
1310 IceProxy::IceStormElection::Node::end_ready(const ::Ice::AsyncResultPtr& result)
1311 {
1312  _end(result, iceC_IceStormElection_Node_ready_name);
1313 }
1314 
1315 ::Ice::AsyncResultPtr
1316 IceProxy::IceStormElection::Node::_iceI_begin_accept(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::IntSeq& iceP_forwardedInvites, const ::Ice::ObjectPrx& iceP_observer, const ::IceStormElection::LogUpdate& iceP_llu, ::Ice::Int iceP_max, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1317 {
1318  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_accept_name, del, cookie, sync);
1319  try
1320  {
1321  result->prepare(iceC_IceStormElection_Node_accept_name, ::Ice::Normal, context);
1322  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1323  ostr->write(iceP_j);
1324  ostr->write(iceP_gn);
1325  ostr->write(iceP_forwardedInvites);
1326  ostr->write(iceP_observer);
1327  ostr->write(iceP_llu);
1328  ostr->write(iceP_max);
1329  result->endWriteParams();
1330  result->invoke(iceC_IceStormElection_Node_accept_name);
1331  }
1332  catch (const ::Ice::Exception& ex)
1333  {
1334  result->abort(ex);
1335  }
1336  return result;
1337 }
1338 
1339 void
1340 IceProxy::IceStormElection::Node::end_accept(const ::Ice::AsyncResultPtr& result)
1341 {
1342  _end(result, iceC_IceStormElection_Node_accept_name);
1343 }
1344 
1345 ::Ice::AsyncResultPtr
1346 IceProxy::IceStormElection::Node::_iceI_begin_areYouCoordinator(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1347 {
1348  _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name, sync);
1349  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_areYouCoordinator_name, del, cookie, sync);
1350  try
1351  {
1352  result->prepare(iceC_IceStormElection_Node_areYouCoordinator_name, ::Ice::Idempotent, context);
1353  result->writeEmptyParams();
1354  result->invoke(iceC_IceStormElection_Node_areYouCoordinator_name);
1355  }
1356  catch (const ::Ice::Exception& ex)
1357  {
1358  result->abort(ex);
1359  }
1360  return result;
1361 }
1362 
1363 bool
1365 {
1366  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouCoordinator_name);
1367  bool ret;
1368  if (!result->_waitForResponse())
1369  {
1370  try
1371  {
1372  result->_throwUserException();
1373  }
1374  catch (const ::Ice::UserException& ex)
1375  {
1376  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1377  }
1378  }
1379  ::Ice::InputStream* istr = result->_startReadParams();
1380  istr->read(ret);
1381  result->_endReadParams();
1382  return ret;
1383 }
1384 
1385 ::Ice::AsyncResultPtr
1386 IceProxy::IceStormElection::Node::_iceI_begin_areYouThere(const ::std::string& iceP_gn, ::Ice::Int iceP_j, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1387 {
1388  _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name, sync);
1389  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_areYouThere_name, del, cookie, sync);
1390  try
1391  {
1392  result->prepare(iceC_IceStormElection_Node_areYouThere_name, ::Ice::Idempotent, context);
1393  ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1394  ostr->write(iceP_gn);
1395  ostr->write(iceP_j);
1396  result->endWriteParams();
1397  result->invoke(iceC_IceStormElection_Node_areYouThere_name);
1398  }
1399  catch (const ::Ice::Exception& ex)
1400  {
1401  result->abort(ex);
1402  }
1403  return result;
1404 }
1405 
1406 bool
1407 IceProxy::IceStormElection::Node::end_areYouThere(const ::Ice::AsyncResultPtr& result)
1408 {
1409  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouThere_name);
1410  bool ret;
1411  if (!result->_waitForResponse())
1412  {
1413  try
1414  {
1415  result->_throwUserException();
1416  }
1417  catch (const ::Ice::UserException& ex)
1418  {
1419  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1420  }
1421  }
1422  ::Ice::InputStream* istr = result->_startReadParams();
1423  istr->read(ret);
1424  result->_endReadParams();
1425  return ret;
1426 }
1427 
1428 ::Ice::AsyncResultPtr
1429 IceProxy::IceStormElection::Node::_iceI_begin_sync(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1430 {
1431  _checkTwowayOnly(iceC_IceStormElection_Node_sync_name, sync);
1432  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_sync_name, del, cookie, sync);
1433  try
1434  {
1435  result->prepare(iceC_IceStormElection_Node_sync_name, ::Ice::Idempotent, context);
1436  result->writeEmptyParams();
1437  result->invoke(iceC_IceStormElection_Node_sync_name);
1438  }
1439  catch (const ::Ice::Exception& ex)
1440  {
1441  result->abort(ex);
1442  }
1443  return result;
1444 }
1445 
1446 ::Ice::ObjectPrx
1447 IceProxy::IceStormElection::Node::end_sync(const ::Ice::AsyncResultPtr& result)
1448 {
1449  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_sync_name);
1450  ::Ice::ObjectPrx ret;
1451  if (!result->_waitForResponse())
1452  {
1453  try
1454  {
1455  result->_throwUserException();
1456  }
1457  catch (const ::Ice::UserException& ex)
1458  {
1459  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1460  }
1461  }
1462  ::Ice::InputStream* istr = result->_startReadParams();
1463  istr->read(ret);
1464  result->_endReadParams();
1465  return ret;
1466 }
1467 
1468 ::Ice::AsyncResultPtr
1469 IceProxy::IceStormElection::Node::_iceI_begin_nodes(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1470 {
1471  _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name, sync);
1472  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_nodes_name, del, cookie, sync);
1473  try
1474  {
1475  result->prepare(iceC_IceStormElection_Node_nodes_name, ::Ice::Idempotent, context);
1476  result->writeEmptyParams();
1477  result->invoke(iceC_IceStormElection_Node_nodes_name);
1478  }
1479  catch (const ::Ice::Exception& ex)
1480  {
1481  result->abort(ex);
1482  }
1483  return result;
1484 }
1485 
1487 IceProxy::IceStormElection::Node::end_nodes(const ::Ice::AsyncResultPtr& result)
1488 {
1489  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_nodes_name);
1491  if (!result->_waitForResponse())
1492  {
1493  try
1494  {
1495  result->_throwUserException();
1496  }
1497  catch (const ::Ice::UserException& ex)
1498  {
1499  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1500  }
1501  }
1502  ::Ice::InputStream* istr = result->_startReadParams();
1503  istr->read(ret);
1504  result->_endReadParams();
1505  return ret;
1506 }
1507 
1508 ::Ice::AsyncResultPtr
1509 IceProxy::IceStormElection::Node::_iceI_begin_query(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
1510 {
1511  _checkTwowayOnly(iceC_IceStormElection_Node_query_name, sync);
1512  ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_query_name, del, cookie, sync);
1513  try
1514  {
1515  result->prepare(iceC_IceStormElection_Node_query_name, ::Ice::Idempotent, context);
1516  result->writeEmptyParams();
1517  result->invoke(iceC_IceStormElection_Node_query_name);
1518  }
1519  catch (const ::Ice::Exception& ex)
1520  {
1521  result->abort(ex);
1522  }
1523  return result;
1524 }
1525 
1527 IceProxy::IceStormElection::Node::end_query(const ::Ice::AsyncResultPtr& result)
1528 {
1529  ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_query_name);
1531  if (!result->_waitForResponse())
1532  {
1533  try
1534  {
1535  result->_throwUserException();
1536  }
1537  catch (const ::Ice::UserException& ex)
1538  {
1539  throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1540  }
1541  }
1542  ::Ice::InputStream* istr = result->_startReadParams();
1543  istr->read(ret);
1544  result->_endReadParams();
1545  return ret;
1546 }
1547 
1548 ::IceProxy::Ice::Object*
1550 {
1551  return new Node;
1552 }
1553 
1554 const ::std::string&
1556 {
1557  return ::IceStormElection::Node::ice_staticId();
1558 }
1559 
1561 {
1562 }
1563 
1565 {
1566  return p;
1567 }
1568 
1569 
1570 namespace
1571 {
1572  const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] =
1573  {
1574  "::Ice::Object",
1575  "::IceStormElection::ReplicaObserver"
1576  };
1577 
1578 }
1579 
1580 bool
1581 IceStormElection::ReplicaObserver::ice_isA(const ::std::string& s, const ::Ice::Current&) const
1582 {
1583  return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids, iceC_IceStormElection_ReplicaObserver_ids + 2, s);
1584 }
1585 
1586 ::std::vector< ::std::string>
1588 {
1589  return ::std::vector< ::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0], &iceC_IceStormElection_ReplicaObserver_ids[2]);
1590 }
1591 
1592 const ::std::string&
1593 IceStormElection::ReplicaObserver::ice_id(const ::Ice::Current&) const
1594 {
1595  return ice_staticId();
1596 }
1597 
1598 const ::std::string&
1600 {
1601 #ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
1602  static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
1603  return typeId;
1604 #else
1605  return iceC_IceStormElection_ReplicaObserver_ids[1];
1606 #endif
1607 }
1608 
1609 bool
1610 IceStormElection::ReplicaObserver::_iceD_init(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1611 {
1612  _iceCheckMode(::Ice::Normal, current.mode);
1613  ::Ice::InputStream* istr = inS.startReadParams();
1616  istr->read(iceP_llu);
1617  istr->read(iceP_content);
1618  inS.endReadParams();
1619  this->init(iceP_llu, iceP_content, current);
1620  inS.writeEmptyParams();
1621  return true;
1622 }
1623 
1624 bool
1625 IceStormElection::ReplicaObserver::_iceD_createTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1626 {
1627  _iceCheckMode(::Ice::Normal, current.mode);
1628  ::Ice::InputStream* istr = inS.startReadParams();
1630  ::std::string iceP_name;
1631  istr->read(iceP_llu);
1632  istr->read(iceP_name);
1633  inS.endReadParams();
1634  this->createTopic(iceP_llu, iceP_name, current);
1635  inS.writeEmptyParams();
1636  return true;
1637 }
1638 
1639 bool
1640 IceStormElection::ReplicaObserver::_iceD_destroyTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1641 {
1642  _iceCheckMode(::Ice::Normal, current.mode);
1643  ::Ice::InputStream* istr = inS.startReadParams();
1645  ::std::string iceP_name;
1646  istr->read(iceP_llu);
1647  istr->read(iceP_name);
1648  inS.endReadParams();
1649  this->destroyTopic(iceP_llu, iceP_name, current);
1650  inS.writeEmptyParams();
1651  return true;
1652 }
1653 
1654 bool
1655 IceStormElection::ReplicaObserver::_iceD_addSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1656 {
1657  _iceCheckMode(::Ice::Normal, current.mode);
1658  ::Ice::InputStream* istr = inS.startReadParams();
1660  ::std::string iceP_topic;
1661  ::IceStorm::SubscriberRecord iceP_record;
1662  istr->read(iceP_llu);
1663  istr->read(iceP_topic);
1664  istr->read(iceP_record);
1665  inS.endReadParams();
1666  this->addSubscriber(iceP_llu, iceP_topic, iceP_record, current);
1667  inS.writeEmptyParams();
1668  return true;
1669 }
1670 
1671 bool
1672 IceStormElection::ReplicaObserver::_iceD_removeSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1673 {
1674  _iceCheckMode(::Ice::Normal, current.mode);
1675  ::Ice::InputStream* istr = inS.startReadParams();
1677  ::std::string iceP_topic;
1678  ::Ice::IdentitySeq iceP_subscribers;
1679  istr->read(iceP_llu);
1680  istr->read(iceP_topic);
1681  istr->read(iceP_subscribers);
1682  inS.endReadParams();
1683  this->removeSubscriber(iceP_llu, iceP_topic, iceP_subscribers, current);
1684  inS.writeEmptyParams();
1685  return true;
1686 }
1687 
1688 namespace
1689 {
1690  const ::std::string iceC_IceStormElection_ReplicaObserver_all[] =
1691  {
1692  "addSubscriber",
1693  "createTopic",
1694  "destroyTopic",
1695  "ice_id",
1696  "ice_ids",
1697  "ice_isA",
1698  "ice_ping",
1699  "init",
1700  "removeSubscriber"
1701  };
1702 
1703 }
1704 
1705 bool
1706 IceStormElection::ReplicaObserver::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
1707 {
1708  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_ReplicaObserver_all, iceC_IceStormElection_ReplicaObserver_all + 9, current.operation);
1709  if (r.first == r.second)
1710  {
1711  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
1712  }
1713 
1714  switch (r.first - iceC_IceStormElection_ReplicaObserver_all)
1715  {
1716  case 0:
1717  {
1718  return _iceD_addSubscriber(in, current);
1719  }
1720  case 1:
1721  {
1722  return _iceD_createTopic(in, current);
1723  }
1724  case 2:
1725  {
1726  return _iceD_destroyTopic(in, current);
1727  }
1728  case 3:
1729  {
1730  return _iceD_ice_id(in, current);
1731  }
1732  case 4:
1733  {
1734  return _iceD_ice_ids(in, current);
1735  }
1736  case 5:
1737  {
1738  return _iceD_ice_isA(in, current);
1739  }
1740  case 6:
1741  {
1742  return _iceD_ice_ping(in, current);
1743  }
1744  case 7:
1745  {
1746  return _iceD_init(in, current);
1747  }
1748  case 8:
1749  {
1750  return _iceD_removeSubscriber(in, current);
1751  }
1752  default:
1753  {
1754  assert(false);
1755  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
1756  }
1757  }
1758 }
1759 
1760 void
1762 {
1763  ostr->startSlice(ice_staticId(), -1, true);
1765  ostr->endSlice();
1766 }
1767 
1768 void
1770 {
1771  istr->startSlice();
1773  istr->endSlice();
1774 }
1775 
1776 void
1778 {
1779  handle = ::IceStormElection::ReplicaObserverPtr::dynamicCast(v);
1780  if (v && !handle)
1781  {
1782  IceInternal::Ex::throwUOE(::IceStormElection::ReplicaObserver::ice_staticId(), v);
1783  }
1784 }
1785 
1787 {
1788 }
1789 
1791 {
1792  return p;
1793 }
1794 
1795 
1796 namespace
1797 {
1798  const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] =
1799  {
1800  "::Ice::Object",
1801  "::IceStormElection::TopicManagerSync"
1802  };
1803 
1804 }
1805 
1806 bool
1807 IceStormElection::TopicManagerSync::ice_isA(const ::std::string& s, const ::Ice::Current&) const
1808 {
1809  return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids, iceC_IceStormElection_TopicManagerSync_ids + 2, s);
1810 }
1811 
1812 ::std::vector< ::std::string>
1814 {
1815  return ::std::vector< ::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0], &iceC_IceStormElection_TopicManagerSync_ids[2]);
1816 }
1817 
1818 const ::std::string&
1820 {
1821  return ice_staticId();
1822 }
1823 
1824 const ::std::string&
1826 {
1827 #ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
1828  static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
1829  return typeId;
1830 #else
1831  return iceC_IceStormElection_TopicManagerSync_ids[1];
1832 #endif
1833 }
1834 
1835 bool
1836 IceStormElection::TopicManagerSync::_iceD_getContent(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1837 {
1838  _iceCheckMode(::Ice::Normal, current.mode);
1839  inS.readEmptyParams();
1842  this->getContent(iceP_llu, iceP_content, current);
1843  ::Ice::OutputStream* ostr = inS.startWriteParams();
1844  ostr->write(iceP_llu);
1845  ostr->write(iceP_content);
1846  inS.endWriteParams();
1847  return true;
1848 }
1849 
1850 namespace
1851 {
1852  const ::std::string iceC_IceStormElection_TopicManagerSync_all[] =
1853  {
1854  "getContent",
1855  "ice_id",
1856  "ice_ids",
1857  "ice_isA",
1858  "ice_ping"
1859  };
1860 
1861 }
1862 
1863 bool
1864 IceStormElection::TopicManagerSync::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
1865 {
1866  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_TopicManagerSync_all, iceC_IceStormElection_TopicManagerSync_all + 5, current.operation);
1867  if (r.first == r.second)
1868  {
1869  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
1870  }
1871 
1872  switch (r.first - iceC_IceStormElection_TopicManagerSync_all)
1873  {
1874  case 0:
1875  {
1876  return _iceD_getContent(in, current);
1877  }
1878  case 1:
1879  {
1880  return _iceD_ice_id(in, current);
1881  }
1882  case 2:
1883  {
1884  return _iceD_ice_ids(in, current);
1885  }
1886  case 3:
1887  {
1888  return _iceD_ice_isA(in, current);
1889  }
1890  case 4:
1891  {
1892  return _iceD_ice_ping(in, current);
1893  }
1894  default:
1895  {
1896  assert(false);
1897  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
1898  }
1899  }
1900 }
1901 
1902 void
1904 {
1905  ostr->startSlice(ice_staticId(), -1, true);
1907  ostr->endSlice();
1908 }
1909 
1910 void
1912 {
1913  istr->startSlice();
1915  istr->endSlice();
1916 }
1917 
1918 void
1920 {
1921  handle = ::IceStormElection::TopicManagerSyncPtr::dynamicCast(v);
1922  if (v && !handle)
1923  {
1924  IceInternal::Ex::throwUOE(::IceStormElection::TopicManagerSync::ice_staticId(), v);
1925  }
1926 }
1927 
1929 {
1930 }
1931 
1933 {
1934  return p;
1935 }
1936 
1937 
1938 namespace
1939 {
1940  const ::std::string iceC_IceStormElection_Node_ids[2] =
1941  {
1942  "::Ice::Object",
1943  "::IceStormElection::Node"
1944  };
1945 
1946 }
1947 
1948 bool
1949 IceStormElection::Node::ice_isA(const ::std::string& s, const ::Ice::Current&) const
1950 {
1951  return ::std::binary_search(iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
1952 }
1953 
1954 ::std::vector< ::std::string>
1955 IceStormElection::Node::ice_ids(const ::Ice::Current&) const
1956 {
1957  return ::std::vector< ::std::string>(&iceC_IceStormElection_Node_ids[0], &iceC_IceStormElection_Node_ids[2]);
1958 }
1959 
1960 const ::std::string&
1961 IceStormElection::Node::ice_id(const ::Ice::Current&) const
1962 {
1963  return ice_staticId();
1964 }
1965 
1966 const ::std::string&
1968 {
1969 #ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
1970  static const ::std::string typeId = "::IceStormElection::Node";
1971  return typeId;
1972 #else
1973  return iceC_IceStormElection_Node_ids[1];
1974 #endif
1975 }
1976 
1977 bool
1978 IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1979 {
1980  _iceCheckMode(::Ice::Normal, current.mode);
1981  ::Ice::InputStream* istr = inS.startReadParams();
1982  ::Ice::Int iceP_j;
1983  ::std::string iceP_gn;
1984  istr->read(iceP_j);
1985  istr->read(iceP_gn);
1986  inS.endReadParams();
1987  this->invitation(iceP_j, iceP_gn, current);
1988  inS.writeEmptyParams();
1989  return true;
1990 }
1991 
1992 bool
1993 IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
1994 {
1995  _iceCheckMode(::Ice::Normal, current.mode);
1996  ::Ice::InputStream* istr = inS.startReadParams();
1997  ::Ice::Int iceP_j;
1998  ::std::string iceP_gn;
1999  ::Ice::ObjectPrx iceP_coordinator;
2000  ::Ice::Int iceP_max;
2001  ::Ice::Long iceP_generation;
2002  istr->read(iceP_j);
2003  istr->read(iceP_gn);
2004  istr->read(iceP_coordinator);
2005  istr->read(iceP_max);
2006  istr->read(iceP_generation);
2007  inS.endReadParams();
2008  this->ready(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation, current);
2009  inS.writeEmptyParams();
2010  return true;
2011 }
2012 
2013 bool
2014 IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
2015 {
2016  _iceCheckMode(::Ice::Normal, current.mode);
2017  ::Ice::InputStream* istr = inS.startReadParams();
2018  ::Ice::Int iceP_j;
2019  ::std::string iceP_gn;
2020  ::Ice::IntSeq iceP_forwardedInvites;
2021  ::Ice::ObjectPrx iceP_observer;
2023  ::Ice::Int iceP_max;
2024  istr->read(iceP_j);
2025  istr->read(iceP_gn);
2026  istr->read(iceP_forwardedInvites);
2027  istr->read(iceP_observer);
2028  istr->read(iceP_llu);
2029  istr->read(iceP_max);
2030  inS.endReadParams();
2031  this->accept(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max, current);
2032  inS.writeEmptyParams();
2033  return true;
2034 }
2035 
2036 bool
2037 IceStormElection::Node::_iceD_areYouCoordinator(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
2038 {
2039  _iceCheckMode(::Ice::Idempotent, current.mode);
2040  inS.readEmptyParams();
2041  bool ret = this->areYouCoordinator(current);
2042  ::Ice::OutputStream* ostr = inS.startWriteParams();
2043  ostr->write(ret);
2044  inS.endWriteParams();
2045  return true;
2046 }
2047 
2048 bool
2049 IceStormElection::Node::_iceD_areYouThere(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
2050 {
2051  _iceCheckMode(::Ice::Idempotent, current.mode);
2052  ::Ice::InputStream* istr = inS.startReadParams();
2053  ::std::string iceP_gn;
2054  ::Ice::Int iceP_j;
2055  istr->read(iceP_gn);
2056  istr->read(iceP_j);
2057  inS.endReadParams();
2058  bool ret = this->areYouThere(iceP_gn, iceP_j, current);
2059  ::Ice::OutputStream* ostr = inS.startWriteParams();
2060  ostr->write(ret);
2061  inS.endWriteParams();
2062  return true;
2063 }
2064 
2065 bool
2066 IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
2067 {
2068  _iceCheckMode(::Ice::Idempotent, current.mode);
2069  inS.readEmptyParams();
2070  ::Ice::ObjectPrx ret = this->sync(current);
2071  ::Ice::OutputStream* ostr = inS.startWriteParams();
2072  ostr->write(ret);
2073  inS.endWriteParams();
2074  return true;
2075 }
2076 
2077 bool
2078 IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
2079 {
2080  _iceCheckMode(::Ice::Idempotent, current.mode);
2081  inS.readEmptyParams();
2082  ::IceStormElection::NodeInfoSeq ret = this->nodes(current);
2083  ::Ice::OutputStream* ostr = inS.startWriteParams();
2084  ostr->write(ret);
2085  inS.endWriteParams();
2086  return true;
2087 }
2088 
2089 bool
2090 IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
2091 {
2092  _iceCheckMode(::Ice::Idempotent, current.mode);
2093  inS.readEmptyParams();
2094  ::IceStormElection::QueryInfo ret = this->query(current);
2095  ::Ice::OutputStream* ostr = inS.startWriteParams();
2096  ostr->write(ret);
2097  inS.endWriteParams();
2098  return true;
2099 }
2100 
2101 namespace
2102 {
2103  const ::std::string iceC_IceStormElection_Node_all[] =
2104  {
2105  "accept",
2106  "areYouCoordinator",
2107  "areYouThere",
2108  "ice_id",
2109  "ice_ids",
2110  "ice_isA",
2111  "ice_ping",
2112  "invitation",
2113  "nodes",
2114  "query",
2115  "ready",
2116  "sync"
2117  };
2118 
2119 }
2120 
2121 bool
2122 IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
2123 {
2124  ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_Node_all, iceC_IceStormElection_Node_all + 12, current.operation);
2125  if (r.first == r.second)
2126  {
2127  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
2128  }
2129 
2130  switch (r.first - iceC_IceStormElection_Node_all)
2131  {
2132  case 0:
2133  {
2134  return _iceD_accept(in, current);
2135  }
2136  case 1:
2137  {
2138  return _iceD_areYouCoordinator(in, current);
2139  }
2140  case 2:
2141  {
2142  return _iceD_areYouThere(in, current);
2143  }
2144  case 3:
2145  {
2146  return _iceD_ice_id(in, current);
2147  }
2148  case 4:
2149  {
2150  return _iceD_ice_ids(in, current);
2151  }
2152  case 5:
2153  {
2154  return _iceD_ice_isA(in, current);
2155  }
2156  case 6:
2157  {
2158  return _iceD_ice_ping(in, current);
2159  }
2160  case 7:
2161  {
2162  return _iceD_invitation(in, current);
2163  }
2164  case 8:
2165  {
2166  return _iceD_nodes(in, current);
2167  }
2168  case 9:
2169  {
2170  return _iceD_query(in, current);
2171  }
2172  case 10:
2173  {
2174  return _iceD_ready(in, current);
2175  }
2176  case 11:
2177  {
2178  return _iceD_sync(in, current);
2179  }
2180  default:
2181  {
2182  assert(false);
2183  throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
2184  }
2185  }
2186 }
2187 
2188 void
2189 IceStormElection::Node::_iceWriteImpl(::Ice::OutputStream* ostr) const
2190 {
2191  ostr->startSlice(ice_staticId(), -1, true);
2193  ostr->endSlice();
2194 }
2195 
2196 void
2197 IceStormElection::Node::_iceReadImpl(::Ice::InputStream* istr)
2198 {
2199  istr->startSlice();
2201  istr->endSlice();
2202 }
2203 
2204 void
2206 {
2207  handle = ::IceStormElection::NodePtr::dynamicCast(v);
2208  if (v && !handle)
2209  {
2210  IceInternal::Ex::throwUOE(::IceStormElection::Node::ice_staticId(), v);
2211  }
2212 }
2213 
2214 namespace Ice
2215 {
2216 }
2217 
2218 #endif
IceProxy::IceStormElection::Node::end_accept
void end_accept(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1340
IceStormElection::ReplicaObserver::ice_isA
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1581
IceStormElection::TopicManagerSync::_iceDispatch
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1864
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
IceStormElection::TopicManagerSync
Interface used to sync topics.
Definition: Election.ice:125
IceStormElection::Node::ice_isA
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1949
IceStormElection::Node::_iceD_query
bool _iceD_query(::IceInternal::Incoming &, const ::Ice::Current &) const
Definition: Election.cpp:2090
IceStormElection::ReplicaObserver::_iceD_destroyTopic
bool _iceD_destroyTopic(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1640
IceProxy::IceStormElection::upCast
::IceProxy::Ice::Object * upCast(::IceProxy::IceStormElection::ReplicaObserver *)
Definition: Election.cpp:919
IceStormElection::Node::_iceReadImpl
virtual void _iceReadImpl(::Ice::InputStream *)
Definition: Election.cpp:2197
IceStormElection::Node::_iceD_areYouThere
bool _iceD_areYouThere(::IceInternal::Incoming &, const ::Ice::Current &) const
Definition: Election.cpp:2049
IceProxy::IceStormElection::ReplicaObserver::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1164
IceStormElection::upCast
::Ice::Object * upCast(::IceStormElection::ReplicaObserver *)
Definition: Election.cpp:1564
IceStormElection::QueryInfo
Definition: Election.ice:177
IceProxy::IceStormElection::Node::end_sync
::Ice::ObjectPrx end_sync(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1447
IceStormElection::LogUpdate
A struct used for marking the last log update.
Definition: LLURecord.h:100
IceStormElection::ReplicaObserver::_iceWriteImpl
virtual void _iceWriteImpl(::Ice::OutputStream *) const
Definition: Election.cpp:1761
IceProxy::IceStormElection::TopicManagerSync::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1235
IceProxy::IceStormElection::Node::end_ready
void end_ready(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1310
IceStormElection::_icePatchObjectPtr
void _icePatchObjectPtr(ReplicaObserverPtr &, const ::Ice::ObjectPtr &)
Definition: Election.cpp:1777
IceStormElection::ReplicaObserver
The replica observer.
Definition: Election.ice:42
IceStormElection::TopicManagerSync::~TopicManagerSync
virtual ~TopicManagerSync()
Definition: Election.cpp:1786
IceProxy::IceStormElection::TopicManagerSync::end_getContent
void end_getContent(::IceStormElection::LogUpdate &iceP_llu, ::IceStormElection::TopicContentSeq &iceP_content, const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1208
IceStormElection::TopicManagerSync::_iceReadImpl
virtual void _iceReadImpl(::Ice::InputStream *)
Definition: Election.cpp:1911
IceStormElection::Node::ice_ids
virtual ::std::vector< ::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1955
IceStormElection::Node::_iceD_areYouCoordinator
bool _iceD_areYouCoordinator(::IceInternal::Incoming &, const ::Ice::Current &) const
Definition: Election.cpp:2037
IceProxy::IceStormElection::Node::_newInstance
virtual ::IceProxy::Ice::Object * _newInstance() const
Definition: Election.cpp:1549
IceStormElection::ObserverInconsistencyException
Thrown if an observer detects an inconsistency.
Definition: Election.ice:35
IceInternal::Handle
Definition: forward_declarations.h:8
IceProxy::IceStormElection::Node::end_query
::IceStormElection::QueryInfo end_query(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1527
IceStorm::SubscriberRecord
Used to store persistent information for persistent subscribers.
Definition: SubscriberRecord.h:214
IceStormElection::ObserverInconsistencyException::ice_throw
virtual void ice_throw() const
Definition: Election.cpp:899
IceStormElection::TopicContentSeq
::std::vector< ::IceStormElection::TopicContent > TopicContentSeq
A sequence of topic content.
Definition: Election.h:819
IceProxy::IceStormElection::Node::end_areYouThere
bool end_areYouThere(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1407
IceProxy::IceStormElection::Node::end_areYouCoordinator
bool end_areYouCoordinator(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1364
IceProxy::IceStormElection::TopicManagerSync
Definition: Election.h:1190
IceStormElection::Node
A replica node.
Definition: Election.ice:202
IceStormElection::Node::_iceDispatch
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:2122
IceStormElection::Node::ice_id
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1961
IceProxy::IceStormElection::TopicManagerSync::_newInstance
virtual ::IceProxy::Ice::Object * _newInstance() const
Definition: Election.cpp:1229
IceStormElection::Node::~Node
virtual ~Node()
Definition: Election.cpp:1928
IceStormElection::TopicManagerSync::ice_id
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1819
IceProxy::IceStormElection::_readProxy
void _readProxy(::Ice::InputStream *, ::IceInternal::ProxyHandle< ::IceProxy::IceStormElection::ReplicaObserver > &)
armarx::read
void read(auto &eigen, auto *table)
Definition: FTSensorCalibrationGuiWidgetController.cpp:462
IceProxy::IceStormElection::ReplicaObserver
Definition: Election.h:989
IceStormElection::ReplicaObserver::ice_id
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1593
IceStormElection::TopicManagerSync::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1825
IceStormElection::ReplicaObserver::_iceD_addSubscriber
bool _iceD_addSubscriber(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1655
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
IceStormElection::Node::_iceD_sync
bool _iceD_sync(::IceInternal::Incoming &, const ::Ice::Current &) const
Definition: Election.cpp:2066
IceStormElection::ObserverInconsistencyException::_readImpl
virtual void _readImpl(::Ice::InputStream *)
Definition: Election.cpp:913
IceStormElection::Node::_iceWriteImpl
virtual void _iceWriteImpl(::Ice::OutputStream *) const
Definition: Election.cpp:2189
IceStormElection::ReplicaObserver::_iceD_createTopic
bool _iceD_createTopic(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1625
IceStormElection::ObserverInconsistencyException::ice_id
virtual ::std::string ice_id() const
Definition: Election.cpp:887
IceStormElection::TopicManagerSync::_iceD_getContent
bool _iceD_getContent(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1836
IceStormElection::ReplicaObserver::_iceD_init
bool _iceD_init(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1610
IceProxy::IceStormElection::ReplicaObserver::end_init
void end_init(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:962
IceProxy::IceStormElection::Node::end_invitation
void end_invitation(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1281
IceStormElection::ObserverInconsistencyException::_writeImpl
virtual void _writeImpl(::Ice::OutputStream *) const
Definition: Election.cpp:905
IceStormElection::ReplicaObserver::_iceDispatch
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1706
IceProxy::IceStormElection::Node::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1555
IceStormElection::Node::_iceD_accept
bool _iceD_accept(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:2014
Ice
Definition: DBTypes.cpp:64
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
IceProxy::IceStormElection::ReplicaObserver::end_destroyTopic
void end_destroyTopic(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1048
IceStormElection::ObserverInconsistencyException::ObserverInconsistencyException
ObserverInconsistencyException()
Definition: Election.h:825
IceStormElection::TopicManagerSync::_iceWriteImpl
virtual void _iceWriteImpl(::Ice::OutputStream *) const
Definition: Election.cpp:1903
IceStormElection::TopicManagerSync::ice_ids
virtual ::std::vector< ::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1813
Election.h
IceStormElection::Node::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1967
IceStormElection::ReplicaObserver::_iceD_removeSubscriber
bool _iceD_removeSubscriber(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1672
IceStormElection::NodeInfoSeq
::std::vector< ::IceStormElection::NodeInfo > NodeInfoSeq
A sequence of node info.
Definition: Election.h:857
IceInternal::ProxyHandle< ::IceProxy::IceStormElection::ReplicaObserver >
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
IceStormElection::Node::_iceD_invitation
bool _iceD_invitation(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1978
armarx::aron::write
requires data::isWriter< WriterT > void write(WriterT &aron_w, const Eigen::Matrix< EigenT, rows, cols, options > &input, typename WriterT::ReturnType &ret, const armarx::aron::Path &aron_p=armarx::aron::Path())
Definition: eigen.h:134
IceProxy::IceStormElection::Node::end_nodes
::IceStormElection::NodeInfoSeq end_nodes(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1487
IceStormElection::ReplicaObserver::ice_staticId
static const ::std::string & ice_staticId()
Definition: Election.cpp:1599
IceStormElection::ReplicaObserver::_iceReadImpl
virtual void _iceReadImpl(::Ice::InputStream *)
Definition: Election.cpp:1769
IceProxy::IceStormElection::ReplicaObserver::end_createTopic
void end_createTopic(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1005
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
IceProxy::IceStormElection::Node
Definition: Election.h:1239
IceStormElection::TopicManagerSync::ice_isA
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1807
IceStormElection::Node::_iceD_nodes
bool _iceD_nodes(::IceInternal::Incoming &, const ::Ice::Current &) const
Definition: Election.cpp:2078
IceStormElection::ReplicaObserver::ice_ids
virtual ::std::vector< ::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
Definition: Election.cpp:1587
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
IceStormElection::ObserverInconsistencyException::~ObserverInconsistencyException
virtual ~ObserverInconsistencyException()
Definition: Election.cpp:882
IceProxy::IceStormElection::ReplicaObserver::end_addSubscriber
void end_addSubscriber(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1092
IceStormElection::ObserverInconsistencyException::ice_clone
virtual ObserverInconsistencyException * ice_clone() const
Definition: Election.cpp:893
IceProxy::IceStormElection::ReplicaObserver::end_removeSubscriber
void end_removeSubscriber(const ::Ice::AsyncResultPtr &)
Definition: Election.cpp:1136
IceStormElection::ReplicaObserver::~ReplicaObserver
virtual ~ReplicaObserver()
Definition: Election.cpp:1560
IceStormElection::Node::_iceD_ready
bool _iceD_ready(::IceInternal::Incoming &, const ::Ice::Current &)
Definition: Election.cpp:1993
IceProxy::IceStormElection::ReplicaObserver::_newInstance
virtual ::IceProxy::Ice::Object * _newInstance() const
Definition: Election.cpp:1158