Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Identity.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0
4// <auto-generated>Generated from Slice file 'Identity.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Ice_Identity_h_
8#define Ice_Identity_h_
9
11#include <Ice/Config.h>
12#include <Ice/StreamHelpers.h>
13#include <Ice/TupleCompare.h>
14#include <string>
15#include <vector>
16
17#ifndef ICE_DISABLE_VERSION
18# if ICE_INT_VERSION / 100 != 308
19# error Ice version mismatch!
20# endif
21# if ICE_INT_VERSION % 100 >= 50
22# error Beta header file detected
23# endif
24# if ICE_INT_VERSION % 100 < 0
25# error Ice patch level mismatch!
26# endif
27#endif
28
29// NOLINTBEGIN(modernize-concat-nested-namespaces)
30
31/// The Ice RPC framework.
32namespace Ice
33{
34 struct Identity;
35
36 /// A sequence of identities.
37 using IdentitySeq = std::vector<Identity>;
38}
39
40namespace Ice
41{
42 /// Represents the identity of an Ice object. It is comparable to the path of a URI. Its string representation is
43 /// `name` when the category is empty, and `category/name` when the category is not empty.
44 /// @remarks The Slice compiler generated this struct from Slice struct `::Ice::Identity`.
45 /// @headerfile Ice/Ice.h
46 struct Identity
47 {
48 /// The name of the Ice object. An empty name is not valid.
49 std::string name;
50
51 /// The category of the object.
52 std::string category{};
53
54 /// Creates a tuple with all the fields of this struct.
55 /// @return A tuple with all the fields of this struct.
56 [[nodiscard]] std::tuple<const std::string&, const std::string&> ice_tuple() const
57 {
58 return std::tie(name, category);
59 }
60
61 /// Outputs the name and value of each field of this instance to the stream.
62 /// @param os The output stream.
63 ICE_API void ice_printFields(std::ostream& os) const;
64 };
65
66 /// Outputs the description of an Identity to a stream, including all its fields.
67 /// @param os The output stream.
68 /// @param value The instance to output.
69 /// @return The output stream.
70 ICE_API std::ostream& operator<<(std::ostream& os, const Identity& value);
71
72 /// @cond INTERNAL
73 using Ice::Tuple::operator<;
74 using Ice::Tuple::operator<=;
75 using Ice::Tuple::operator>;
76 using Ice::Tuple::operator>=;
77 using Ice::Tuple::operator==;
78 using Ice::Tuple::operator!=;
79 /// @endcond
80}
81
82namespace Ice
83{
84 /// @cond INTERNAL
85 template<>
86 struct StreamableTraits<::Ice::Identity>
87 {
89 static constexpr int minWireSize = 2;
90 static constexpr bool fixedLength = false;
91 };
92
93 template<>
94 struct StreamReader<::Ice::Identity>
95 {
96 /// Unmarshals a ::Ice::Identity from the input stream.
97 static void read(InputStream* istr, ::Ice::Identity& v)
98 {
99 istr->readAll(v.name, v.category);
100 }
101 };
102 /// @endcond
103}
104
105// NOLINTEND(modernize-concat-nested-namespaces)
106
108#endif
std::vector< Identity > IdentitySeq
A sequence of identities.
Definition Identity.h:37
int StreamHelperCategory
The stream helper category allows to select a StreamHelper specialization for a specific category of ...
constexpr StreamHelperCategory StreamHelperCategoryStruct
Generated struct types.
std::ostream & operator<<(std::ostream &os, const Identity &value)
Outputs the description of an Identity to a stream, including all its fields.
The Ice RPC framework.
Definition SampleEvent.h:66
std::tuple< const std::string &, const std::string & > ice_tuple() const
Creates a tuple with all the fields of this struct.
Definition Identity.h:56
std::string name
The name of the Ice object. An empty name is not valid.
Definition Identity.h:49
std::string category
The category of the object.
Definition Identity.h:52
void ice_printFields(std::ostream &os) const
Outputs the name and value of each field of this instance to the stream.
Represents the identity of an Ice object.
Definition Identity.h:47
static constexpr bool fixedLength
Indicates if the type is always encoded on a fixed number of bytes.
static constexpr int minWireSize
The minimum number of bytes needed to marshal this type.
static constexpr StreamHelperCategory helper
The category trait, used for selecting the appropriate StreamHelper.