Savarese Software Research Corporation
Message.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2006 Savarese Software Research Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.savarese.com/software/ApacheLicense-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
23 #ifndef __SSRC_SPREAD_MESSAGE_H
24 #define __SSRC_SPREAD_MESSAGE_H
25 
26 #include <ssrc/spread/detail/ByteBuffer.h>
28 
30 
47 class Message : public BaseMessage, public detail::ByteBuffer {
48 protected:
49 
50 #ifdef LIBSSRCSPREAD_ENABLE_MEMBERSHIP_INFO
51 
52  virtual int sp_get_membership_info(Spread::membership_info *info) const {
53  return Spread::SP_get_memb_info(&(this->operator[](0)), service(), info);
54  }
55 
56  virtual int sp_get_vs_set_members(const Spread::vs_set_info *vs_set,
57  Spread::group_type member_names[],
58  unsigned int member_names_count)
59  const
60  {
61  return
62  Spread::SP_get_vs_set_members(&(this->operator[](0)),
63  vs_set, member_names, member_names_count);
64  }
65 
66  virtual int sp_get_vs_sets_info(Spread::vs_set_info *vs_sets,
67  unsigned int num_vs_sets,
68  unsigned int *index)
69  const
70  {
71  return
72  Spread::SP_get_vs_sets_info(&(this->operator[](0)),
73  vs_sets, num_vs_sets, index);
74  }
75 
76 #endif
77 
78 public:
79 
80  enum {
83  };
84 
93  explicit Message(const unsigned int capacity = DefaultCapacity) :
94  detail::ByteBuffer(capacity) { }
95 
96  virtual unsigned int size() const {
97  return detail::ByteBuffer::size();
98  }
99 
100  virtual void clear() {
101  return detail::ByteBuffer::clear();
102  }
103 
104 };
105 
107 
108 #endif

Savarese Software Research Corporation
Copyright © 2006-2015 Savarese Software Research Corporation. All rights reserved.