Ice 3.7 C++11 API Reference
Identity.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 //
5 // Ice version 3.7.10
6 //
7 // <auto-generated>
8 //
9 // Generated from file `Identity.ice'
10 //
11 // Warning: do not edit this file.
12 //
13 // </auto-generated>
14 //
15 
16 #ifndef __Ice_Identity_h__
17 #define __Ice_Identity_h__
18 
20 #include <Ice/ProxyF.h>
21 #include <Ice/ObjectF.h>
22 #include <Ice/ValueF.h>
23 #include <Ice/Exception.h>
24 #include <Ice/LocalObject.h>
25 #include <Ice/StreamHelpers.h>
26 #include <Ice/Comparable.h>
27 #include <IceUtil/ScopedArray.h>
28 #include <Ice/Optional.h>
29 #include <IceUtil/UndefSysMacros.h>
30 
31 #ifndef ICE_IGNORE_VERSION
32 # if ICE_INT_VERSION / 100 != 307
33 # error Ice version mismatch!
34 # endif
35 # if ICE_INT_VERSION % 100 >= 50
36 # error Beta header file detected
37 # endif
38 # if ICE_INT_VERSION % 100 < 10
39 # error Ice patch level mismatch!
40 # endif
41 #endif
42 
43 #ifndef ICE_API
44 # if defined(ICE_STATIC_LIBS)
45 # define ICE_API
46 # elif defined(ICE_API_EXPORTS)
47 # define ICE_API ICE_DECLSPEC_EXPORT
48 # else
49 # define ICE_API ICE_DECLSPEC_IMPORT
50 # endif
51 #endif
52 
53 #ifdef ICE_CPP11_MAPPING // C++11 mapping
54 
55 namespace Ice
56 {
57 
66 struct Identity
67 {
71  ::std::string name;
75  ::std::string category;
76 
81  std::tuple<const ::std::string&, const ::std::string&> ice_tuple() const
82  {
83  return std::tie(name, category);
84  }
85 };
86 
90 using ObjectDict = ::std::map<Identity, ::std::shared_ptr<Object>>;
91 
95 using IdentitySeq = ::std::vector<Identity>;
96 
97 using Ice::operator<;
98 using Ice::operator<=;
99 using Ice::operator>;
100 using Ice::operator>=;
101 using Ice::operator==;
102 using Ice::operator!=;
103 
104 }
105 
107 namespace Ice
108 {
109 
110 template<>
111 struct StreamableTraits<::Ice::Identity>
112 {
113  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
114  static const int minWireSize = 2;
115  static const bool fixedLength = false;
116 };
117 
118 template<typename S>
119 struct StreamReader<::Ice::Identity, S>
120 {
121  static void read(S* istr, ::Ice::Identity& v)
122  {
123  istr->readAll(v.name, v.category);
124  }
125 };
126 
127 }
129 
130 #else // C++98 mapping
131 
132 namespace Ice
133 {
134 
143 struct Identity
144 {
148  ::std::string name;
152  ::std::string category;
153 
154  bool operator==(const Identity& rhs_) const
155  {
156  if(this == &rhs_)
157  {
158  return true;
159  }
160  if(name != rhs_.name)
161  {
162  return false;
163  }
164  if(category != rhs_.category)
165  {
166  return false;
167  }
168  return true;
169  }
170 
171  bool operator<(const Identity& rhs_) const
172  {
173  if(this == &rhs_)
174  {
175  return false;
176  }
177  if(name < rhs_.name)
178  {
179  return true;
180  }
181  else if(rhs_.name < name)
182  {
183  return false;
184  }
185  if(category < rhs_.category)
186  {
187  return true;
188  }
189  else if(rhs_.category < category)
190  {
191  return false;
192  }
193  return false;
194  }
195 
196  bool operator!=(const Identity& rhs_) const
197  {
198  return !operator==(rhs_);
199  }
200  bool operator<=(const Identity& rhs_) const
201  {
202  return operator<(rhs_) || operator==(rhs_);
203  }
204  bool operator>(const Identity& rhs_) const
205  {
206  return !operator<(rhs_) && !operator==(rhs_);
207  }
208  bool operator>=(const Identity& rhs_) const
209  {
210  return !operator<(rhs_);
211  }
212 };
213 
217 typedef ::std::map<Identity, ObjectPtr> ObjectDict;
218 
222 typedef ::std::vector<Identity> IdentitySeq;
223 
224 }
225 
227 namespace Ice
228 {
229 
230 template<>
231 struct StreamableTraits< ::Ice::Identity>
232 {
233  static const StreamHelperCategory helper = StreamHelperCategoryStruct;
234  static const int minWireSize = 2;
235  static const bool fixedLength = false;
236 };
237 
238 template<typename S>
239 struct StreamWriter< ::Ice::Identity, S>
240 {
241  static void write(S* ostr, const ::Ice::Identity& v)
242  {
243  ostr->write(v.name);
244  ostr->write(v.category);
245  }
246 };
247 
248 template<typename S>
249 struct StreamReader< ::Ice::Identity, S>
250 {
251  static void read(S* istr, ::Ice::Identity& v)
252  {
253  istr->read(v.name);
254  istr->read(v.category);
255  }
256 };
257 
258 }
260 
261 #endif
262 
264 #endif
Ice::Identity::name
::std::string name
The name of the Ice object.
Definition: Identity.h:71
Ice::operator!=
bool operator!=(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:196
Optional.h
Ice::Identity::category
::std::string category
The Ice object category.
Definition: Identity.h:75
Ice::ObjectDict
::std::map< Identity, ::std::shared_ptr< Object > > ObjectDict
A mapping between identities and Ice objects.
Definition: Identity.h:90
StreamHelpers.h
Ice::Identity::ice_tuple
std::tuple< const ::std::string &, const ::std::string & > ice_tuple() const
Obtains a tuple containing all of the struct's data members.
Definition: Identity.h:81
Ice::operator==
bool operator==(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:184
Ice::operator<=
bool operator<=(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:148
Ice::operator>=
bool operator>=(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:172
LocalObject.h
PushDisableWarnings.h
ProxyF.h
Ice::operator<
bool operator<(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:136
Ice::IdentitySeq
::std::vector< Identity > IdentitySeq
A sequence of identities.
Definition: Identity.h:95
UndefSysMacros.h
ObjectF.h
Ice::operator>
bool operator>(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:160
Ice
Definition: BuiltinSequences.h:56
Comparable.h
ScopedArray.h
Ice::Identity
The identity of an Ice object.
Definition: Identity.h:67
Exception.h
ValueF.h
PopDisableWarnings.h