Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Identity.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0-alpha.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 != 30850
19# error Ice version mismatch: an exact match is required for beta generated code
20# endif
21#endif
22
23// NOLINTBEGIN(modernize-concat-nested-namespaces)
24
25/// The Ice RPC framework.
26namespace Ice
27{
28 struct Identity;
29
30 /// A sequence of identities.
31 using IdentitySeq = std::vector<Identity>;
32}
33
34namespace Ice
35{
36 /// Represents the identity of an Ice object. It is comparable to the path of a URI. Its string representation is
37 /// `name` when the category is empty, and `category/name` when the category is not empty.
38 /// @headerfile Ice/Ice.h
39 struct Identity
40 {
41 /// The name of the Ice object. An empty name is not valid.
42 std::string name;
43
44 /// The category of the object.
45 std::string category{};
46
47 /// Creates a tuple with all the fields of this struct.
48 /// @return A tuple with all the fields of this struct.
49 [[nodiscard]] std::tuple<const std::string&, const std::string&> ice_tuple() const
50 {
51 return std::tie(name, category);
52 }
53
54 /// Outputs the name and value of each field of this instance to the stream.
55 /// @param os The output stream.
56 ICE_API void ice_printFields(std::ostream& os) const;
57 };
58
59 /// Outputs the description of an Identity to a stream, including all its fields.
60 /// @param os The output stream.
61 /// @param value The instance to output.
62 /// @return The output stream.
63 ICE_API std::ostream& operator<<(std::ostream& os, const Identity& value);
64
65 /// @cond INTERNAL
66 using Ice::Tuple::operator<;
67 using Ice::Tuple::operator<=;
68 using Ice::Tuple::operator>;
69 using Ice::Tuple::operator>=;
70 using Ice::Tuple::operator==;
71 using Ice::Tuple::operator!=;
72 /// @endcond
73}
74
75namespace Ice
76{
77 /// @cond INTERNAL
78 template<>
79 struct StreamableTraits<::Ice::Identity>
80 {
82 static constexpr int minWireSize = 2;
83 static constexpr bool fixedLength = false;
84 };
85
86 template<>
87 struct StreamReader<::Ice::Identity>
88 {
89 /// Unmarshals a ::Ice::Identity from the input stream.
90 static void read(InputStream* istr, ::Ice::Identity& v)
91 {
92 istr->readAll(v.name, v.category);
93 }
94 };
95 /// @endcond
96}
97
98// NOLINTEND(modernize-concat-nested-namespaces)
99
101#endif
std::vector< Identity > IdentitySeq
A sequence of identities.
Definition Identity.h:31
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:59
std::tuple< const std::string &, const std::string & > ice_tuple() const
Creates a tuple with all the fields of this struct.
Definition Identity.h:49
std::string name
The name of the Ice object. An empty name is not valid.
Definition Identity.h:42
std::string category
The category of the object.
Definition Identity.h:45
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:40
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.