dynamic_filters.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_DYNAMIC_FILTERS_H
18 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_DYNAMIC_FILTERS_H
19 
21 
22 #include <vector>
23 
25 #include <grpc/slice.h>
26 
40 
41 namespace grpc_core {
42 
43 class DynamicFilters : public RefCounted<DynamicFilters> {
44  public:
45  // Implements the interface of RefCounted<>.
46  class Call {
47  public:
48  struct Args {
52  gpr_cycle_counter start_time;
57  };
58 
60 
61  // Continues processing a transport stream op batch.
63 
64  // Sets the 'then_schedule_closure' argument for call stack destruction.
65  // Must be called once per call.
67 
68  // Interface of RefCounted<>.
71  const char* reason) GRPC_MUST_USE_RESULT;
72  // When refcount drops to 0, destroys itself and the associated call stack,
73  // but does NOT free the memory because it's in the call arena.
74  void Unref();
75  void Unref(const DebugLocation& location, const char* reason);
76 
77  private:
78  // Allow RefCountedPtr<> to access IncrementRefCount().
79  template <typename T>
80  friend class RefCountedPtr;
81 
82  // Interface of RefCounted<>.
83  void IncrementRefCount();
84  void IncrementRefCount(const DebugLocation& location, const char* reason);
85 
86  static void Destroy(void* arg, grpc_error_handle error);
87 
90  };
91 
94  std::vector<const grpc_channel_filter*> filters);
95 
96  explicit DynamicFilters(grpc_channel_stack* channel_stack)
97  : channel_stack_(channel_stack) {}
98 
99  ~DynamicFilters() override;
100 
102 
103  private:
105 };
106 
107 } // namespace grpc_core
108 
109 #endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_DYNAMIC_FILTERS_H
grpc_core::CallCombiner
Definition: call_combiner.h:50
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
grpc_core::DebugLocation
Definition: debug_location.h:31
grpc_channel_stack
Definition: channel_stack.h:202
channel_fwd.h
polling_entity.h
grpc_core::DynamicFilters::Call::Args::pollent
grpc_polling_entity * pollent
Definition: dynamic_filters.h:50
slice.h
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::DynamicFilters::Call::Unref
void Unref()
Definition: dynamic_filters.cc:100
arena.h
closure.h
grpc_core::DynamicFilters::Call::Args::call_combiner
CallCombiner * call_combiner
Definition: dynamic_filters.h:56
grpc_core::DynamicFilters::Call
Definition: dynamic_filters.h:46
grpc_core::Arena
Definition: src/core/lib/resource_quota/arena.h:45
grpc_channel_args
Definition: grpc_types.h:132
grpc_core::DynamicFilters::Create
static RefCountedPtr< DynamicFilters > Create(const grpc_channel_args *args, std::vector< const grpc_channel_filter * > filters)
Definition: dynamic_filters.cc:169
T
#define T(upbtypeconst, upbtype, ctype, default_value)
grpc_core::DynamicFilters::Call::Ref
RefCountedPtr< Call > Ref() GRPC_MUST_USE_RESULT
Definition: dynamic_filters.cc:89
grpc_types.h
grpc_core::DynamicFilters::channel_stack_
grpc_channel_stack * channel_stack_
Definition: dynamic_filters.h:104
context.h
grpc_core::DynamicFilters::CreateCall
RefCountedPtr< Call > CreateCall(Call::Args args, grpc_error_handle *error)
Definition: dynamic_filters.cc:193
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::DynamicFilters::Call::after_call_stack_destroy_
grpc_closure * after_call_stack_destroy_
Definition: dynamic_filters.h:89
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
hpack_encoder_fixtures::Args
Args({0, 16384})
grpc_core::DynamicFilters::Call::StartTransportStreamOpBatch
void StartTransportStreamOpBatch(grpc_transport_stream_op_batch *batch)
Definition: dynamic_filters.cc:75
call_combiner.h
arg
Definition: cmdline.cc:40
time.h
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
grpc_core::DynamicFilters::~DynamicFilters
~DynamicFilters() override
Definition: dynamic_filters.cc:189
grpc_core::DynamicFilters::Call::Args::channel_stack
RefCountedPtr< DynamicFilters > channel_stack
Definition: dynamic_filters.h:49
error.h
grpc_polling_entity
Definition: polling_entity.h:38
batch
grpc_transport_stream_op_batch * batch
Definition: retry_filter.cc:243
grpc_core::RefCounted
Definition: ref_counted.h:280
grpc_core::DynamicFilters::Call::Args
Definition: dynamic_filters.h:48
grpc_channel_filter
Definition: channel_stack.h:111
grpc_core::DynamicFilters::Call::Args::deadline
Timestamp deadline
Definition: dynamic_filters.h:53
grpc_core::DynamicFilters::Call::IncrementRefCount
void IncrementRefCount()
Definition: dynamic_filters.cc:124
grpc_core::DynamicFilters::Call::Args::arena
Arena * arena
Definition: dynamic_filters.h:54
debug_location.h
GRPC_MUST_USE_RESULT
#define GRPC_MUST_USE_RESULT
Definition: impl/codegen/port_platform.h:584
ref_counted.h
grpc_core::DynamicFilters
Definition: dynamic_filters.h:43
grpc_core::DynamicFilters::Call::Call
Call(Args args, grpc_error_handle *error)
Definition: dynamic_filters.cc:53
grpc_core::DynamicFilters::Call::Args::start_time
gpr_cycle_counter start_time
Definition: dynamic_filters.h:52
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc_call_context_element
Definition: core/lib/channel/context.h:51
grpc_core::DynamicFilters::Call::Destroy
static void Destroy(void *arg, grpc_error_handle error)
Definition: dynamic_filters.cc:109
grpc_core::DynamicFilters::Call::Args::context
grpc_call_context_element * context
Definition: dynamic_filters.h:55
closure
Definition: proxy.cc:59
ref_counted_ptr.h
transport.h
grpc_core::DynamicFilters::Call::Args::path
grpc_slice path
Definition: dynamic_filters.h:51
setup.template
template
Definition: setup.py:47
grpc_error
Definition: error_internal.h:42
grpc_transport_stream_op_batch
Definition: transport.h:284
grpc_closure
Definition: closure.h:56
grpc_core::DynamicFilters::Call::channel_stack_
RefCountedPtr< DynamicFilters > channel_stack_
Definition: dynamic_filters.h:88
grpc_core::DynamicFilters::Call::SetAfterCallStackDestroy
void SetAfterCallStackDestroy(grpc_closure *closure)
Definition: dynamic_filters.cc:83
time_precise.h
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:17