grpc
src
cpp
common
auth_property_iterator.cc
Go to the documentation of this file.
1
/*
2
*
3
* Copyright 2015 gRPC authors.
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.apache.org/licenses/LICENSE-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
*/
18
19
#include <utility>
20
21
#include <
grpc/grpc_security.h
>
22
#include <
grpcpp/security/auth_context.h
>
23
#include <
grpcpp/support/string_ref.h
>
24
25
namespace
grpc
{
26
27
AuthPropertyIterator::AuthPropertyIterator
()
28
: property_(nullptr),
ctx_
(nullptr),
index_
(0),
name_
(nullptr) {}
29
30
AuthPropertyIterator::AuthPropertyIterator
(
31
const
grpc_auth_property
* property,
const
grpc_auth_property_iterator
*
iter
)
32
: property_(property),
33
ctx_
(
iter
->
ctx
),
34
index_
(
iter
->
index
),
35
name_
(
iter
->
name
) {}
36
37
AuthPropertyIterator::~AuthPropertyIterator
() {}
38
39
AuthPropertyIterator
&
AuthPropertyIterator::operator++
() {
40
grpc_auth_property_iterator
iter
= {
ctx_
,
index_
,
name_
};
41
property_
=
grpc_auth_property_iterator_next
(&
iter
);
42
ctx_
=
iter
.ctx;
43
index_
=
iter
.index;
44
name_
=
iter
.name;
45
return
*
this
;
46
}
47
48
AuthPropertyIterator
AuthPropertyIterator::operator++
(
int
) {
49
AuthPropertyIterator
tmp
(*
this
);
50
operator++
();
51
return
tmp
;
52
}
53
54
bool
AuthPropertyIterator::operator==
(
const
AuthPropertyIterator
& rhs)
const
{
55
if
(
property_
==
nullptr
|| rhs.
property_
==
nullptr
) {
56
return
property_
== rhs.
property_
;
57
}
else
{
58
return
index_
== rhs.
index_
;
59
}
60
}
61
62
bool
AuthPropertyIterator::operator!=
(
const
AuthPropertyIterator
& rhs)
const
{
63
return
!
operator==
(rhs);
64
}
65
66
AuthProperty
AuthPropertyIterator::operator*
() {
67
return
std::pair<grpc::string_ref, grpc::string_ref>(
68
property_
->
name
,
69
grpc::string_ref
(
property_
->
value
,
property_
->
value_length
));
70
}
71
72
}
// namespace grpc
grpc::string_ref
Definition:
grpcpp/impl/codegen/string_ref.h:43
grpc::AuthPropertyIterator::~AuthPropertyIterator
~AuthPropertyIterator()
Definition:
auth_property_iterator.cc:37
grpc::AuthPropertyIterator::operator*
AuthProperty operator*()
Definition:
auth_property_iterator.cc:66
grpc::AuthPropertyIterator::ctx_
const grpc_auth_context * ctx_
Definition:
grpcpp/impl/codegen/security/auth_context.h:63
ctx
Definition:
benchmark-async.c:30
grpc
Definition:
grpcpp/alarm.h:33
grpc::AuthPropertyIterator::operator!=
bool operator!=(const AuthPropertyIterator &rhs) const
Definition:
auth_property_iterator.cc:62
setup.name
name
Definition:
setup.py:542
ctx_
ClientContext ctx_
Definition:
client_interceptors_end2end_test.cc:289
grpc_security.h
name_
const std::string name_
Definition:
priority.cc:233
grpc_auth_property_iterator_next
const GRPCAPI grpc_auth_property * grpc_auth_property_iterator_next(grpc_auth_property_iterator *it)
Definition:
security_context.cc:182
grpc::AuthPropertyIterator::name_
const char * name_
Definition:
grpcpp/impl/codegen/security/auth_context.h:65
grpc::AuthPropertyIterator::operator==
bool operator==(const AuthPropertyIterator &rhs) const
Definition:
auth_property_iterator.cc:54
grpc_auth_property::name
char * name
Definition:
grpc_security.h:44
grpc_auth_property_iterator
Definition:
grpc_security.h:36
grpc_auth_property::value_length
size_t value_length
Definition:
grpc_security.h:46
grpc::AuthPropertyIterator::property_
const grpc_auth_property * property_
Definition:
grpcpp/impl/codegen/security/auth_context.h:61
index_
size_t index_
Definition:
xds_cluster_resolver.cc:169
grpc_auth_property::value
char * value
Definition:
grpc_security.h:45
grpc_auth_property
Definition:
grpc_security.h:43
grpc::AuthPropertyIterator::operator++
AuthPropertyIterator & operator++()
Definition:
auth_property_iterator.cc:39
index
int index
Definition:
bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
grpc::AuthPropertyIterator
Definition:
grpcpp/impl/codegen/security/auth_context.h:39
grpc::AuthPropertyIterator::index_
size_t index_
Definition:
grpcpp/impl/codegen/security/auth_context.h:64
grpc::AuthProperty
std::pair< string_ref, string_ref > AuthProperty
Definition:
grpcpp/impl/codegen/security/auth_context.h:35
iter
Definition:
test_winkernel.cpp:47
autogen_x86imm.tmp
tmp
Definition:
autogen_x86imm.py:12
grpc::AuthPropertyIterator::AuthPropertyIterator
AuthPropertyIterator()
Definition:
auth_property_iterator.cc:27
auth_context.h
string_ref.h
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:45