Apache SINGA
A distributed deep learning platform .
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
cluster.pb.h
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: cluster.proto
3 
4 #ifndef PROTOBUF_cluster_2eproto__INCLUDED
5 #define PROTOBUF_cluster_2eproto__INCLUDED
6 
7 #include <string>
8 
9 #include <google/protobuf/stubs/common.h>
10 
11 #if GOOGLE_PROTOBUF_VERSION < 2005000
12 #error This file was generated by a newer version of protoc which is
13 #error incompatible with your Protocol Buffer headers. Please update
14 #error your headers.
15 #endif
16 #if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
17 #error This file was generated by an older version of protoc which is
18 #error incompatible with your Protocol Buffer headers. Please
19 #error regenerate this file with a newer version of protoc.
20 #endif
21 
22 #include <google/protobuf/generated_message_util.h>
23 #include <google/protobuf/message.h>
24 #include <google/protobuf/repeated_field.h>
25 #include <google/protobuf/extension_set.h>
26 #include <google/protobuf/unknown_field_set.h>
27 // @@protoc_insertion_point(includes)
28 
29 namespace singa {
30 
31 // Internal implementation detail -- do not call these.
32 void protobuf_AddDesc_cluster_2eproto();
33 void protobuf_AssignDesc_cluster_2eproto();
34 void protobuf_ShutdownFile_cluster_2eproto();
35 
36 class ClusterProto;
37 class ServerTopology;
38 
39 // ===================================================================
40 
41 class ClusterProto : public ::google::protobuf::Message {
42  public:
43  ClusterProto();
44  virtual ~ClusterProto();
45 
46  ClusterProto(const ClusterProto& from);
47 
48  inline ClusterProto& operator=(const ClusterProto& from) {
49  CopyFrom(from);
50  return *this;
51  }
52 
53  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
54  return _unknown_fields_;
55  }
56 
57  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
58  return &_unknown_fields_;
59  }
60 
61  static const ::google::protobuf::Descriptor* descriptor();
62  static const ClusterProto& default_instance();
63 
64  void Swap(ClusterProto* other);
65 
66  // implements Message ----------------------------------------------
67 
68  ClusterProto* New() const;
69  void CopyFrom(const ::google::protobuf::Message& from);
70  void MergeFrom(const ::google::protobuf::Message& from);
71  void CopyFrom(const ClusterProto& from);
72  void MergeFrom(const ClusterProto& from);
73  void Clear();
74  bool IsInitialized() const;
75 
76  int ByteSize() const;
77  bool MergePartialFromCodedStream(
78  ::google::protobuf::io::CodedInputStream* input);
79  void SerializeWithCachedSizes(
80  ::google::protobuf::io::CodedOutputStream* output) const;
81  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
82  int GetCachedSize() const { return _cached_size_; }
83  private:
84  void SharedCtor();
85  void SharedDtor();
86  void SetCachedSize(int size) const;
87  public:
88 
89  ::google::protobuf::Metadata GetMetadata() const;
90 
91  // nested types ----------------------------------------------------
92 
93  // accessors -------------------------------------------------------
94 
95  // optional int32 nworker_groups = 1;
96  inline bool has_nworker_groups() const;
97  inline void clear_nworker_groups();
98  static const int kNworkerGroupsFieldNumber = 1;
99  inline ::google::protobuf::int32 nworker_groups() const;
100  inline void set_nworker_groups(::google::protobuf::int32 value);
101 
102  // optional int32 nserver_groups = 2;
103  inline bool has_nserver_groups() const;
104  inline void clear_nserver_groups();
105  static const int kNserverGroupsFieldNumber = 2;
106  inline ::google::protobuf::int32 nserver_groups() const;
107  inline void set_nserver_groups(::google::protobuf::int32 value);
108 
109  // optional int32 nworkers_per_group = 3 [default = 1];
110  inline bool has_nworkers_per_group() const;
111  inline void clear_nworkers_per_group();
112  static const int kNworkersPerGroupFieldNumber = 3;
113  inline ::google::protobuf::int32 nworkers_per_group() const;
114  inline void set_nworkers_per_group(::google::protobuf::int32 value);
115 
116  // optional int32 nservers_per_group = 4 [default = 1];
117  inline bool has_nservers_per_group() const;
118  inline void clear_nservers_per_group();
119  static const int kNserversPerGroupFieldNumber = 4;
120  inline ::google::protobuf::int32 nservers_per_group() const;
121  inline void set_nservers_per_group(::google::protobuf::int32 value);
122 
123  // optional int32 nworkers_per_procs = 5 [default = 1];
124  inline bool has_nworkers_per_procs() const;
125  inline void clear_nworkers_per_procs();
126  static const int kNworkersPerProcsFieldNumber = 5;
127  inline ::google::protobuf::int32 nworkers_per_procs() const;
128  inline void set_nworkers_per_procs(::google::protobuf::int32 value);
129 
130  // optional int32 nservers_per_procs = 6 [default = 1];
131  inline bool has_nservers_per_procs() const;
132  inline void clear_nservers_per_procs();
133  static const int kNserversPerProcsFieldNumber = 6;
134  inline ::google::protobuf::int32 nservers_per_procs() const;
135  inline void set_nservers_per_procs(::google::protobuf::int32 value);
136 
137  // optional string hostfile = 10;
138  inline bool has_hostfile() const;
139  inline void clear_hostfile();
140  static const int kHostfileFieldNumber = 10;
141  inline const ::std::string& hostfile() const;
142  inline void set_hostfile(const ::std::string& value);
143  inline void set_hostfile(const char* value);
144  inline void set_hostfile(const char* value, size_t size);
145  inline ::std::string* mutable_hostfile();
146  inline ::std::string* release_hostfile();
147  inline void set_allocated_hostfile(::std::string* hostfile);
148 
149  // optional bool server_worker_separate = 11 [default = false];
150  inline bool has_server_worker_separate() const;
151  inline void clear_server_worker_separate();
152  static const int kServerWorkerSeparateFieldNumber = 11;
153  inline bool server_worker_separate() const;
154  inline void set_server_worker_separate(bool value);
155 
156  // optional int32 nprocs = 12;
157  inline bool has_nprocs() const;
158  inline void clear_nprocs();
159  static const int kNprocsFieldNumber = 12;
160  inline ::google::protobuf::int32 nprocs() const;
161  inline void set_nprocs(::google::protobuf::int32 value);
162 
163  // optional int32 start_port = 13 [default = 6723];
164  inline bool has_start_port() const;
165  inline void clear_start_port();
166  static const int kStartPortFieldNumber = 13;
167  inline ::google::protobuf::int32 start_port() const;
168  inline void set_start_port(::google::protobuf::int32 value);
169 
170  // required string workspace = 14;
171  inline bool has_workspace() const;
172  inline void clear_workspace();
173  static const int kWorkspaceFieldNumber = 14;
174  inline const ::std::string& workspace() const;
175  inline void set_workspace(const ::std::string& value);
176  inline void set_workspace(const char* value);
177  inline void set_workspace(const char* value, size_t size);
178  inline ::std::string* mutable_workspace();
179  inline ::std::string* release_workspace();
180  inline void set_allocated_workspace(::std::string* workspace);
181 
182  // optional string log_dir = 15;
183  inline bool has_log_dir() const;
184  inline void clear_log_dir();
185  static const int kLogDirFieldNumber = 15;
186  inline const ::std::string& log_dir() const;
187  inline void set_log_dir(const ::std::string& value);
188  inline void set_log_dir(const char* value);
189  inline void set_log_dir(const char* value, size_t size);
190  inline ::std::string* mutable_log_dir();
191  inline ::std::string* release_log_dir();
192  inline void set_allocated_log_dir(::std::string* log_dir);
193 
194  // optional string zookeeper_host = 16 [default = "localhost:2181"];
195  inline bool has_zookeeper_host() const;
196  inline void clear_zookeeper_host();
197  static const int kZookeeperHostFieldNumber = 16;
198  inline const ::std::string& zookeeper_host() const;
199  inline void set_zookeeper_host(const ::std::string& value);
200  inline void set_zookeeper_host(const char* value);
201  inline void set_zookeeper_host(const char* value, size_t size);
202  inline ::std::string* mutable_zookeeper_host();
203  inline ::std::string* release_zookeeper_host();
204  inline void set_allocated_zookeeper_host(::std::string* zookeeper_host);
205 
206  // repeated .singa.ServerTopology server_group = 20;
207  inline int server_group_size() const;
208  inline void clear_server_group();
209  static const int kServerGroupFieldNumber = 20;
210  inline const ::singa::ServerTopology& server_group(int index) const;
211  inline ::singa::ServerTopology* mutable_server_group(int index);
212  inline ::singa::ServerTopology* add_server_group();
213  inline const ::google::protobuf::RepeatedPtrField< ::singa::ServerTopology >&
214  server_group() const;
215  inline ::google::protobuf::RepeatedPtrField< ::singa::ServerTopology >*
216  mutable_server_group();
217 
218  // optional int32 stub_timeout = 30 [default = 5000];
219  inline bool has_stub_timeout() const;
220  inline void clear_stub_timeout();
221  static const int kStubTimeoutFieldNumber = 30;
222  inline ::google::protobuf::int32 stub_timeout() const;
223  inline void set_stub_timeout(::google::protobuf::int32 value);
224 
225  // optional int32 worker_timeout = 31 [default = 5000];
226  inline bool has_worker_timeout() const;
227  inline void clear_worker_timeout();
228  static const int kWorkerTimeoutFieldNumber = 31;
229  inline ::google::protobuf::int32 worker_timeout() const;
230  inline void set_worker_timeout(::google::protobuf::int32 value);
231 
232  // optional int32 server_timeout = 32 [default = 5000];
233  inline bool has_server_timeout() const;
234  inline void clear_server_timeout();
235  static const int kServerTimeoutFieldNumber = 32;
236  inline ::google::protobuf::int32 server_timeout() const;
237  inline void set_server_timeout(::google::protobuf::int32 value);
238 
239  // @@protoc_insertion_point(class_scope:singa.ClusterProto)
240  private:
241  inline void set_has_nworker_groups();
242  inline void clear_has_nworker_groups();
243  inline void set_has_nserver_groups();
244  inline void clear_has_nserver_groups();
245  inline void set_has_nworkers_per_group();
246  inline void clear_has_nworkers_per_group();
247  inline void set_has_nservers_per_group();
248  inline void clear_has_nservers_per_group();
249  inline void set_has_nworkers_per_procs();
250  inline void clear_has_nworkers_per_procs();
251  inline void set_has_nservers_per_procs();
252  inline void clear_has_nservers_per_procs();
253  inline void set_has_hostfile();
254  inline void clear_has_hostfile();
255  inline void set_has_server_worker_separate();
256  inline void clear_has_server_worker_separate();
257  inline void set_has_nprocs();
258  inline void clear_has_nprocs();
259  inline void set_has_start_port();
260  inline void clear_has_start_port();
261  inline void set_has_workspace();
262  inline void clear_has_workspace();
263  inline void set_has_log_dir();
264  inline void clear_has_log_dir();
265  inline void set_has_zookeeper_host();
266  inline void clear_has_zookeeper_host();
267  inline void set_has_stub_timeout();
268  inline void clear_has_stub_timeout();
269  inline void set_has_worker_timeout();
270  inline void clear_has_worker_timeout();
271  inline void set_has_server_timeout();
272  inline void clear_has_server_timeout();
273 
274  ::google::protobuf::UnknownFieldSet _unknown_fields_;
275 
276  ::google::protobuf::int32 nworker_groups_;
277  ::google::protobuf::int32 nserver_groups_;
278  ::google::protobuf::int32 nworkers_per_group_;
279  ::google::protobuf::int32 nservers_per_group_;
280  ::google::protobuf::int32 nworkers_per_procs_;
281  ::google::protobuf::int32 nservers_per_procs_;
282  ::std::string* hostfile_;
283  bool server_worker_separate_;
284  ::google::protobuf::int32 nprocs_;
285  ::std::string* workspace_;
286  ::std::string* log_dir_;
287  ::google::protobuf::int32 start_port_;
288  ::google::protobuf::int32 stub_timeout_;
289  ::std::string* zookeeper_host_;
290  static ::std::string* _default_zookeeper_host_;
291  ::google::protobuf::RepeatedPtrField< ::singa::ServerTopology > server_group_;
292  ::google::protobuf::int32 worker_timeout_;
293  ::google::protobuf::int32 server_timeout_;
294 
295  mutable int _cached_size_;
296  ::google::protobuf::uint32 _has_bits_[(17 + 31) / 32];
297 
298  friend void protobuf_AddDesc_cluster_2eproto();
299  friend void protobuf_AssignDesc_cluster_2eproto();
300  friend void protobuf_ShutdownFile_cluster_2eproto();
301 
302  void InitAsDefaultInstance();
303  static ClusterProto* default_instance_;
304 };
305 // -------------------------------------------------------------------
306 
307 class ServerTopology : public ::google::protobuf::Message {
308  public:
309  ServerTopology();
310  virtual ~ServerTopology();
311 
312  ServerTopology(const ServerTopology& from);
313 
314  inline ServerTopology& operator=(const ServerTopology& from) {
315  CopyFrom(from);
316  return *this;
317  }
318 
319  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
320  return _unknown_fields_;
321  }
322 
323  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
324  return &_unknown_fields_;
325  }
326 
327  static const ::google::protobuf::Descriptor* descriptor();
328  static const ServerTopology& default_instance();
329 
330  void Swap(ServerTopology* other);
331 
332  // implements Message ----------------------------------------------
333 
334  ServerTopology* New() const;
335  void CopyFrom(const ::google::protobuf::Message& from);
336  void MergeFrom(const ::google::protobuf::Message& from);
337  void CopyFrom(const ServerTopology& from);
338  void MergeFrom(const ServerTopology& from);
339  void Clear();
340  bool IsInitialized() const;
341 
342  int ByteSize() const;
343  bool MergePartialFromCodedStream(
344  ::google::protobuf::io::CodedInputStream* input);
345  void SerializeWithCachedSizes(
346  ::google::protobuf::io::CodedOutputStream* output) const;
347  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
348  int GetCachedSize() const { return _cached_size_; }
349  private:
350  void SharedCtor();
351  void SharedDtor();
352  void SetCachedSize(int size) const;
353  public:
354 
355  ::google::protobuf::Metadata GetMetadata() const;
356 
357  // nested types ----------------------------------------------------
358 
359  // accessors -------------------------------------------------------
360 
361  // required int32 id = 1;
362  inline bool has_id() const;
363  inline void clear_id();
364  static const int kIdFieldNumber = 1;
365  inline ::google::protobuf::int32 id() const;
366  inline void set_id(::google::protobuf::int32 value);
367 
368  // optional int32 sync_interval = 2;
369  inline bool has_sync_interval() const;
370  inline void clear_sync_interval();
371  static const int kSyncIntervalFieldNumber = 2;
372  inline ::google::protobuf::int32 sync_interval() const;
373  inline void set_sync_interval(::google::protobuf::int32 value);
374 
375  // repeated int32 neighbor = 3;
376  inline int neighbor_size() const;
377  inline void clear_neighbor();
378  static const int kNeighborFieldNumber = 3;
379  inline ::google::protobuf::int32 neighbor(int index) const;
380  inline void set_neighbor(int index, ::google::protobuf::int32 value);
381  inline void add_neighbor(::google::protobuf::int32 value);
382  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
383  neighbor() const;
384  inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
385  mutable_neighbor();
386 
387  // @@protoc_insertion_point(class_scope:singa.ServerTopology)
388  private:
389  inline void set_has_id();
390  inline void clear_has_id();
391  inline void set_has_sync_interval();
392  inline void clear_has_sync_interval();
393 
394  ::google::protobuf::UnknownFieldSet _unknown_fields_;
395 
396  ::google::protobuf::int32 id_;
397  ::google::protobuf::int32 sync_interval_;
398  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > neighbor_;
399 
400  mutable int _cached_size_;
401  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
402 
403  friend void protobuf_AddDesc_cluster_2eproto();
404  friend void protobuf_AssignDesc_cluster_2eproto();
405  friend void protobuf_ShutdownFile_cluster_2eproto();
406 
407  void InitAsDefaultInstance();
408  static ServerTopology* default_instance_;
409 };
410 // ===================================================================
411 
412 
413 // ===================================================================
414 
415 // ClusterProto
416 
417 // optional int32 nworker_groups = 1;
418 inline bool ClusterProto::has_nworker_groups() const {
419  return (_has_bits_[0] & 0x00000001u) != 0;
420 }
421 inline void ClusterProto::set_has_nworker_groups() {
422  _has_bits_[0] |= 0x00000001u;
423 }
424 inline void ClusterProto::clear_has_nworker_groups() {
425  _has_bits_[0] &= ~0x00000001u;
426 }
427 inline void ClusterProto::clear_nworker_groups() {
428  nworker_groups_ = 0;
429  clear_has_nworker_groups();
430 }
431 inline ::google::protobuf::int32 ClusterProto::nworker_groups() const {
432  return nworker_groups_;
433 }
434 inline void ClusterProto::set_nworker_groups(::google::protobuf::int32 value) {
435  set_has_nworker_groups();
436  nworker_groups_ = value;
437 }
438 
439 // optional int32 nserver_groups = 2;
440 inline bool ClusterProto::has_nserver_groups() const {
441  return (_has_bits_[0] & 0x00000002u) != 0;
442 }
443 inline void ClusterProto::set_has_nserver_groups() {
444  _has_bits_[0] |= 0x00000002u;
445 }
446 inline void ClusterProto::clear_has_nserver_groups() {
447  _has_bits_[0] &= ~0x00000002u;
448 }
449 inline void ClusterProto::clear_nserver_groups() {
450  nserver_groups_ = 0;
451  clear_has_nserver_groups();
452 }
453 inline ::google::protobuf::int32 ClusterProto::nserver_groups() const {
454  return nserver_groups_;
455 }
456 inline void ClusterProto::set_nserver_groups(::google::protobuf::int32 value) {
457  set_has_nserver_groups();
458  nserver_groups_ = value;
459 }
460 
461 // optional int32 nworkers_per_group = 3 [default = 1];
462 inline bool ClusterProto::has_nworkers_per_group() const {
463  return (_has_bits_[0] & 0x00000004u) != 0;
464 }
465 inline void ClusterProto::set_has_nworkers_per_group() {
466  _has_bits_[0] |= 0x00000004u;
467 }
468 inline void ClusterProto::clear_has_nworkers_per_group() {
469  _has_bits_[0] &= ~0x00000004u;
470 }
471 inline void ClusterProto::clear_nworkers_per_group() {
472  nworkers_per_group_ = 1;
473  clear_has_nworkers_per_group();
474 }
475 inline ::google::protobuf::int32 ClusterProto::nworkers_per_group() const {
476  return nworkers_per_group_;
477 }
478 inline void ClusterProto::set_nworkers_per_group(::google::protobuf::int32 value) {
479  set_has_nworkers_per_group();
480  nworkers_per_group_ = value;
481 }
482 
483 // optional int32 nservers_per_group = 4 [default = 1];
484 inline bool ClusterProto::has_nservers_per_group() const {
485  return (_has_bits_[0] & 0x00000008u) != 0;
486 }
487 inline void ClusterProto::set_has_nservers_per_group() {
488  _has_bits_[0] |= 0x00000008u;
489 }
490 inline void ClusterProto::clear_has_nservers_per_group() {
491  _has_bits_[0] &= ~0x00000008u;
492 }
493 inline void ClusterProto::clear_nservers_per_group() {
494  nservers_per_group_ = 1;
495  clear_has_nservers_per_group();
496 }
497 inline ::google::protobuf::int32 ClusterProto::nservers_per_group() const {
498  return nservers_per_group_;
499 }
500 inline void ClusterProto::set_nservers_per_group(::google::protobuf::int32 value) {
501  set_has_nservers_per_group();
502  nservers_per_group_ = value;
503 }
504 
505 // optional int32 nworkers_per_procs = 5 [default = 1];
506 inline bool ClusterProto::has_nworkers_per_procs() const {
507  return (_has_bits_[0] & 0x00000010u) != 0;
508 }
509 inline void ClusterProto::set_has_nworkers_per_procs() {
510  _has_bits_[0] |= 0x00000010u;
511 }
512 inline void ClusterProto::clear_has_nworkers_per_procs() {
513  _has_bits_[0] &= ~0x00000010u;
514 }
515 inline void ClusterProto::clear_nworkers_per_procs() {
516  nworkers_per_procs_ = 1;
517  clear_has_nworkers_per_procs();
518 }
519 inline ::google::protobuf::int32 ClusterProto::nworkers_per_procs() const {
520  return nworkers_per_procs_;
521 }
522 inline void ClusterProto::set_nworkers_per_procs(::google::protobuf::int32 value) {
523  set_has_nworkers_per_procs();
524  nworkers_per_procs_ = value;
525 }
526 
527 // optional int32 nservers_per_procs = 6 [default = 1];
528 inline bool ClusterProto::has_nservers_per_procs() const {
529  return (_has_bits_[0] & 0x00000020u) != 0;
530 }
531 inline void ClusterProto::set_has_nservers_per_procs() {
532  _has_bits_[0] |= 0x00000020u;
533 }
534 inline void ClusterProto::clear_has_nservers_per_procs() {
535  _has_bits_[0] &= ~0x00000020u;
536 }
537 inline void ClusterProto::clear_nservers_per_procs() {
538  nservers_per_procs_ = 1;
539  clear_has_nservers_per_procs();
540 }
541 inline ::google::protobuf::int32 ClusterProto::nservers_per_procs() const {
542  return nservers_per_procs_;
543 }
544 inline void ClusterProto::set_nservers_per_procs(::google::protobuf::int32 value) {
545  set_has_nservers_per_procs();
546  nservers_per_procs_ = value;
547 }
548 
549 // optional string hostfile = 10;
550 inline bool ClusterProto::has_hostfile() const {
551  return (_has_bits_[0] & 0x00000040u) != 0;
552 }
553 inline void ClusterProto::set_has_hostfile() {
554  _has_bits_[0] |= 0x00000040u;
555 }
556 inline void ClusterProto::clear_has_hostfile() {
557  _has_bits_[0] &= ~0x00000040u;
558 }
559 inline void ClusterProto::clear_hostfile() {
560  if (hostfile_ != &::google::protobuf::internal::kEmptyString) {
561  hostfile_->clear();
562  }
563  clear_has_hostfile();
564 }
565 inline const ::std::string& ClusterProto::hostfile() const {
566  return *hostfile_;
567 }
568 inline void ClusterProto::set_hostfile(const ::std::string& value) {
569  set_has_hostfile();
570  if (hostfile_ == &::google::protobuf::internal::kEmptyString) {
571  hostfile_ = new ::std::string;
572  }
573  hostfile_->assign(value);
574 }
575 inline void ClusterProto::set_hostfile(const char* value) {
576  set_has_hostfile();
577  if (hostfile_ == &::google::protobuf::internal::kEmptyString) {
578  hostfile_ = new ::std::string;
579  }
580  hostfile_->assign(value);
581 }
582 inline void ClusterProto::set_hostfile(const char* value, size_t size) {
583  set_has_hostfile();
584  if (hostfile_ == &::google::protobuf::internal::kEmptyString) {
585  hostfile_ = new ::std::string;
586  }
587  hostfile_->assign(reinterpret_cast<const char*>(value), size);
588 }
589 inline ::std::string* ClusterProto::mutable_hostfile() {
590  set_has_hostfile();
591  if (hostfile_ == &::google::protobuf::internal::kEmptyString) {
592  hostfile_ = new ::std::string;
593  }
594  return hostfile_;
595 }
596 inline ::std::string* ClusterProto::release_hostfile() {
597  clear_has_hostfile();
598  if (hostfile_ == &::google::protobuf::internal::kEmptyString) {
599  return NULL;
600  } else {
601  ::std::string* temp = hostfile_;
602  hostfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
603  return temp;
604  }
605 }
606 inline void ClusterProto::set_allocated_hostfile(::std::string* hostfile) {
607  if (hostfile_ != &::google::protobuf::internal::kEmptyString) {
608  delete hostfile_;
609  }
610  if (hostfile) {
611  set_has_hostfile();
612  hostfile_ = hostfile;
613  } else {
614  clear_has_hostfile();
615  hostfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
616  }
617 }
618 
619 // optional bool server_worker_separate = 11 [default = false];
620 inline bool ClusterProto::has_server_worker_separate() const {
621  return (_has_bits_[0] & 0x00000080u) != 0;
622 }
623 inline void ClusterProto::set_has_server_worker_separate() {
624  _has_bits_[0] |= 0x00000080u;
625 }
626 inline void ClusterProto::clear_has_server_worker_separate() {
627  _has_bits_[0] &= ~0x00000080u;
628 }
629 inline void ClusterProto::clear_server_worker_separate() {
630  server_worker_separate_ = false;
631  clear_has_server_worker_separate();
632 }
633 inline bool ClusterProto::server_worker_separate() const {
634  return server_worker_separate_;
635 }
636 inline void ClusterProto::set_server_worker_separate(bool value) {
637  set_has_server_worker_separate();
638  server_worker_separate_ = value;
639 }
640 
641 // optional int32 nprocs = 12;
642 inline bool ClusterProto::has_nprocs() const {
643  return (_has_bits_[0] & 0x00000100u) != 0;
644 }
645 inline void ClusterProto::set_has_nprocs() {
646  _has_bits_[0] |= 0x00000100u;
647 }
648 inline void ClusterProto::clear_has_nprocs() {
649  _has_bits_[0] &= ~0x00000100u;
650 }
651 inline void ClusterProto::clear_nprocs() {
652  nprocs_ = 0;
653  clear_has_nprocs();
654 }
655 inline ::google::protobuf::int32 ClusterProto::nprocs() const {
656  return nprocs_;
657 }
658 inline void ClusterProto::set_nprocs(::google::protobuf::int32 value) {
659  set_has_nprocs();
660  nprocs_ = value;
661 }
662 
663 // optional int32 start_port = 13 [default = 6723];
664 inline bool ClusterProto::has_start_port() const {
665  return (_has_bits_[0] & 0x00000200u) != 0;
666 }
667 inline void ClusterProto::set_has_start_port() {
668  _has_bits_[0] |= 0x00000200u;
669 }
670 inline void ClusterProto::clear_has_start_port() {
671  _has_bits_[0] &= ~0x00000200u;
672 }
673 inline void ClusterProto::clear_start_port() {
674  start_port_ = 6723;
675  clear_has_start_port();
676 }
677 inline ::google::protobuf::int32 ClusterProto::start_port() const {
678  return start_port_;
679 }
680 inline void ClusterProto::set_start_port(::google::protobuf::int32 value) {
681  set_has_start_port();
682  start_port_ = value;
683 }
684 
685 // required string workspace = 14;
686 inline bool ClusterProto::has_workspace() const {
687  return (_has_bits_[0] & 0x00000400u) != 0;
688 }
689 inline void ClusterProto::set_has_workspace() {
690  _has_bits_[0] |= 0x00000400u;
691 }
692 inline void ClusterProto::clear_has_workspace() {
693  _has_bits_[0] &= ~0x00000400u;
694 }
695 inline void ClusterProto::clear_workspace() {
696  if (workspace_ != &::google::protobuf::internal::kEmptyString) {
697  workspace_->clear();
698  }
699  clear_has_workspace();
700 }
701 inline const ::std::string& ClusterProto::workspace() const {
702  return *workspace_;
703 }
704 inline void ClusterProto::set_workspace(const ::std::string& value) {
705  set_has_workspace();
706  if (workspace_ == &::google::protobuf::internal::kEmptyString) {
707  workspace_ = new ::std::string;
708  }
709  workspace_->assign(value);
710 }
711 inline void ClusterProto::set_workspace(const char* value) {
712  set_has_workspace();
713  if (workspace_ == &::google::protobuf::internal::kEmptyString) {
714  workspace_ = new ::std::string;
715  }
716  workspace_->assign(value);
717 }
718 inline void ClusterProto::set_workspace(const char* value, size_t size) {
719  set_has_workspace();
720  if (workspace_ == &::google::protobuf::internal::kEmptyString) {
721  workspace_ = new ::std::string;
722  }
723  workspace_->assign(reinterpret_cast<const char*>(value), size);
724 }
725 inline ::std::string* ClusterProto::mutable_workspace() {
726  set_has_workspace();
727  if (workspace_ == &::google::protobuf::internal::kEmptyString) {
728  workspace_ = new ::std::string;
729  }
730  return workspace_;
731 }
732 inline ::std::string* ClusterProto::release_workspace() {
733  clear_has_workspace();
734  if (workspace_ == &::google::protobuf::internal::kEmptyString) {
735  return NULL;
736  } else {
737  ::std::string* temp = workspace_;
738  workspace_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
739  return temp;
740  }
741 }
742 inline void ClusterProto::set_allocated_workspace(::std::string* workspace) {
743  if (workspace_ != &::google::protobuf::internal::kEmptyString) {
744  delete workspace_;
745  }
746  if (workspace) {
747  set_has_workspace();
748  workspace_ = workspace;
749  } else {
750  clear_has_workspace();
751  workspace_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
752  }
753 }
754 
755 // optional string log_dir = 15;
756 inline bool ClusterProto::has_log_dir() const {
757  return (_has_bits_[0] & 0x00000800u) != 0;
758 }
759 inline void ClusterProto::set_has_log_dir() {
760  _has_bits_[0] |= 0x00000800u;
761 }
762 inline void ClusterProto::clear_has_log_dir() {
763  _has_bits_[0] &= ~0x00000800u;
764 }
765 inline void ClusterProto::clear_log_dir() {
766  if (log_dir_ != &::google::protobuf::internal::kEmptyString) {
767  log_dir_->clear();
768  }
769  clear_has_log_dir();
770 }
771 inline const ::std::string& ClusterProto::log_dir() const {
772  return *log_dir_;
773 }
774 inline void ClusterProto::set_log_dir(const ::std::string& value) {
775  set_has_log_dir();
776  if (log_dir_ == &::google::protobuf::internal::kEmptyString) {
777  log_dir_ = new ::std::string;
778  }
779  log_dir_->assign(value);
780 }
781 inline void ClusterProto::set_log_dir(const char* value) {
782  set_has_log_dir();
783  if (log_dir_ == &::google::protobuf::internal::kEmptyString) {
784  log_dir_ = new ::std::string;
785  }
786  log_dir_->assign(value);
787 }
788 inline void ClusterProto::set_log_dir(const char* value, size_t size) {
789  set_has_log_dir();
790  if (log_dir_ == &::google::protobuf::internal::kEmptyString) {
791  log_dir_ = new ::std::string;
792  }
793  log_dir_->assign(reinterpret_cast<const char*>(value), size);
794 }
795 inline ::std::string* ClusterProto::mutable_log_dir() {
796  set_has_log_dir();
797  if (log_dir_ == &::google::protobuf::internal::kEmptyString) {
798  log_dir_ = new ::std::string;
799  }
800  return log_dir_;
801 }
802 inline ::std::string* ClusterProto::release_log_dir() {
803  clear_has_log_dir();
804  if (log_dir_ == &::google::protobuf::internal::kEmptyString) {
805  return NULL;
806  } else {
807  ::std::string* temp = log_dir_;
808  log_dir_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
809  return temp;
810  }
811 }
812 inline void ClusterProto::set_allocated_log_dir(::std::string* log_dir) {
813  if (log_dir_ != &::google::protobuf::internal::kEmptyString) {
814  delete log_dir_;
815  }
816  if (log_dir) {
817  set_has_log_dir();
818  log_dir_ = log_dir;
819  } else {
820  clear_has_log_dir();
821  log_dir_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
822  }
823 }
824 
825 // optional string zookeeper_host = 16 [default = "localhost:2181"];
826 inline bool ClusterProto::has_zookeeper_host() const {
827  return (_has_bits_[0] & 0x00001000u) != 0;
828 }
829 inline void ClusterProto::set_has_zookeeper_host() {
830  _has_bits_[0] |= 0x00001000u;
831 }
832 inline void ClusterProto::clear_has_zookeeper_host() {
833  _has_bits_[0] &= ~0x00001000u;
834 }
835 inline void ClusterProto::clear_zookeeper_host() {
836  if (zookeeper_host_ != _default_zookeeper_host_) {
837  zookeeper_host_->assign(*_default_zookeeper_host_);
838  }
839  clear_has_zookeeper_host();
840 }
841 inline const ::std::string& ClusterProto::zookeeper_host() const {
842  return *zookeeper_host_;
843 }
844 inline void ClusterProto::set_zookeeper_host(const ::std::string& value) {
845  set_has_zookeeper_host();
846  if (zookeeper_host_ == _default_zookeeper_host_) {
847  zookeeper_host_ = new ::std::string;
848  }
849  zookeeper_host_->assign(value);
850 }
851 inline void ClusterProto::set_zookeeper_host(const char* value) {
852  set_has_zookeeper_host();
853  if (zookeeper_host_ == _default_zookeeper_host_) {
854  zookeeper_host_ = new ::std::string;
855  }
856  zookeeper_host_->assign(value);
857 }
858 inline void ClusterProto::set_zookeeper_host(const char* value, size_t size) {
859  set_has_zookeeper_host();
860  if (zookeeper_host_ == _default_zookeeper_host_) {
861  zookeeper_host_ = new ::std::string;
862  }
863  zookeeper_host_->assign(reinterpret_cast<const char*>(value), size);
864 }
865 inline ::std::string* ClusterProto::mutable_zookeeper_host() {
866  set_has_zookeeper_host();
867  if (zookeeper_host_ == _default_zookeeper_host_) {
868  zookeeper_host_ = new ::std::string(*_default_zookeeper_host_);
869  }
870  return zookeeper_host_;
871 }
872 inline ::std::string* ClusterProto::release_zookeeper_host() {
873  clear_has_zookeeper_host();
874  if (zookeeper_host_ == _default_zookeeper_host_) {
875  return NULL;
876  } else {
877  ::std::string* temp = zookeeper_host_;
878  zookeeper_host_ = const_cast< ::std::string*>(_default_zookeeper_host_);
879  return temp;
880  }
881 }
882 inline void ClusterProto::set_allocated_zookeeper_host(::std::string* zookeeper_host) {
883  if (zookeeper_host_ != _default_zookeeper_host_) {
884  delete zookeeper_host_;
885  }
886  if (zookeeper_host) {
887  set_has_zookeeper_host();
888  zookeeper_host_ = zookeeper_host;
889  } else {
890  clear_has_zookeeper_host();
891  zookeeper_host_ = const_cast< ::std::string*>(_default_zookeeper_host_);
892  }
893 }
894 
895 // repeated .singa.ServerTopology server_group = 20;
896 inline int ClusterProto::server_group_size() const {
897  return server_group_.size();
898 }
899 inline void ClusterProto::clear_server_group() {
900  server_group_.Clear();
901 }
902 inline const ::singa::ServerTopology& ClusterProto::server_group(int index) const {
903  return server_group_.Get(index);
904 }
905 inline ::singa::ServerTopology* ClusterProto::mutable_server_group(int index) {
906  return server_group_.Mutable(index);
907 }
908 inline ::singa::ServerTopology* ClusterProto::add_server_group() {
909  return server_group_.Add();
910 }
911 inline const ::google::protobuf::RepeatedPtrField< ::singa::ServerTopology >&
912 ClusterProto::server_group() const {
913  return server_group_;
914 }
915 inline ::google::protobuf::RepeatedPtrField< ::singa::ServerTopology >*
916 ClusterProto::mutable_server_group() {
917  return &server_group_;
918 }
919 
920 // optional int32 stub_timeout = 30 [default = 5000];
921 inline bool ClusterProto::has_stub_timeout() const {
922  return (_has_bits_[0] & 0x00004000u) != 0;
923 }
924 inline void ClusterProto::set_has_stub_timeout() {
925  _has_bits_[0] |= 0x00004000u;
926 }
927 inline void ClusterProto::clear_has_stub_timeout() {
928  _has_bits_[0] &= ~0x00004000u;
929 }
930 inline void ClusterProto::clear_stub_timeout() {
931  stub_timeout_ = 5000;
932  clear_has_stub_timeout();
933 }
934 inline ::google::protobuf::int32 ClusterProto::stub_timeout() const {
935  return stub_timeout_;
936 }
937 inline void ClusterProto::set_stub_timeout(::google::protobuf::int32 value) {
938  set_has_stub_timeout();
939  stub_timeout_ = value;
940 }
941 
942 // optional int32 worker_timeout = 31 [default = 5000];
943 inline bool ClusterProto::has_worker_timeout() const {
944  return (_has_bits_[0] & 0x00008000u) != 0;
945 }
946 inline void ClusterProto::set_has_worker_timeout() {
947  _has_bits_[0] |= 0x00008000u;
948 }
949 inline void ClusterProto::clear_has_worker_timeout() {
950  _has_bits_[0] &= ~0x00008000u;
951 }
952 inline void ClusterProto::clear_worker_timeout() {
953  worker_timeout_ = 5000;
954  clear_has_worker_timeout();
955 }
956 inline ::google::protobuf::int32 ClusterProto::worker_timeout() const {
957  return worker_timeout_;
958 }
959 inline void ClusterProto::set_worker_timeout(::google::protobuf::int32 value) {
960  set_has_worker_timeout();
961  worker_timeout_ = value;
962 }
963 
964 // optional int32 server_timeout = 32 [default = 5000];
965 inline bool ClusterProto::has_server_timeout() const {
966  return (_has_bits_[0] & 0x00010000u) != 0;
967 }
968 inline void ClusterProto::set_has_server_timeout() {
969  _has_bits_[0] |= 0x00010000u;
970 }
971 inline void ClusterProto::clear_has_server_timeout() {
972  _has_bits_[0] &= ~0x00010000u;
973 }
974 inline void ClusterProto::clear_server_timeout() {
975  server_timeout_ = 5000;
976  clear_has_server_timeout();
977 }
978 inline ::google::protobuf::int32 ClusterProto::server_timeout() const {
979  return server_timeout_;
980 }
981 inline void ClusterProto::set_server_timeout(::google::protobuf::int32 value) {
982  set_has_server_timeout();
983  server_timeout_ = value;
984 }
985 
986 // -------------------------------------------------------------------
987 
988 // ServerTopology
989 
990 // required int32 id = 1;
991 inline bool ServerTopology::has_id() const {
992  return (_has_bits_[0] & 0x00000001u) != 0;
993 }
994 inline void ServerTopology::set_has_id() {
995  _has_bits_[0] |= 0x00000001u;
996 }
997 inline void ServerTopology::clear_has_id() {
998  _has_bits_[0] &= ~0x00000001u;
999 }
1000 inline void ServerTopology::clear_id() {
1001  id_ = 0;
1002  clear_has_id();
1003 }
1004 inline ::google::protobuf::int32 ServerTopology::id() const {
1005  return id_;
1006 }
1007 inline void ServerTopology::set_id(::google::protobuf::int32 value) {
1008  set_has_id();
1009  id_ = value;
1010 }
1011 
1012 // optional int32 sync_interval = 2;
1013 inline bool ServerTopology::has_sync_interval() const {
1014  return (_has_bits_[0] & 0x00000002u) != 0;
1015 }
1016 inline void ServerTopology::set_has_sync_interval() {
1017  _has_bits_[0] |= 0x00000002u;
1018 }
1019 inline void ServerTopology::clear_has_sync_interval() {
1020  _has_bits_[0] &= ~0x00000002u;
1021 }
1022 inline void ServerTopology::clear_sync_interval() {
1023  sync_interval_ = 0;
1024  clear_has_sync_interval();
1025 }
1026 inline ::google::protobuf::int32 ServerTopology::sync_interval() const {
1027  return sync_interval_;
1028 }
1029 inline void ServerTopology::set_sync_interval(::google::protobuf::int32 value) {
1030  set_has_sync_interval();
1031  sync_interval_ = value;
1032 }
1033 
1034 // repeated int32 neighbor = 3;
1035 inline int ServerTopology::neighbor_size() const {
1036  return neighbor_.size();
1037 }
1038 inline void ServerTopology::clear_neighbor() {
1039  neighbor_.Clear();
1040 }
1041 inline ::google::protobuf::int32 ServerTopology::neighbor(int index) const {
1042  return neighbor_.Get(index);
1043 }
1044 inline void ServerTopology::set_neighbor(int index, ::google::protobuf::int32 value) {
1045  neighbor_.Set(index, value);
1046 }
1047 inline void ServerTopology::add_neighbor(::google::protobuf::int32 value) {
1048  neighbor_.Add(value);
1049 }
1050 inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
1051 ServerTopology::neighbor() const {
1052  return neighbor_;
1053 }
1054 inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
1055 ServerTopology::mutable_neighbor() {
1056  return &neighbor_;
1057 }
1058 
1059 
1060 // @@protoc_insertion_point(namespace_scope)
1061 
1062 } // namespace singa
1063 
1064 #ifndef SWIG
1065 namespace google {
1066 namespace protobuf {
1067 
1068 
1069 } // namespace google
1070 } // namespace protobuf
1071 #endif // SWIG
1072 
1073 // @@protoc_insertion_point(global_scope)
1074 
1075 #endif // PROTOBUF_cluster_2eproto__INCLUDED
Definition: cluster.pb.h:41
Definition: cluster.pb.h:307