GRPC C++  1.13.0-dev
resource_quota.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016 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 #ifndef GRPCPP_RESOURCE_QUOTA_H
20 #define GRPCPP_RESOURCE_QUOTA_H
21 
22 struct grpc_resource_quota;
23 
26 
27 namespace grpc {
28 
34 class ResourceQuota final : private GrpcLibraryCodegen {
35  public:
37  explicit ResourceQuota(const grpc::string& name);
38  ResourceQuota();
40 
45  ResourceQuota& Resize(size_t new_size);
46 
47  grpc_resource_quota* c_resource_quota() const { return impl_; }
48 
49  private:
50  ResourceQuota(const ResourceQuota& rhs);
51  ResourceQuota& operator=(const ResourceQuota& rhs);
52 
53  grpc_resource_quota* const impl_;
54 };
55 
56 } // namespace grpc
57 
58 #endif // GRPCPP_RESOURCE_QUOTA_H
std::string string
Definition: config.h:35
ResourceQuota represents a bound on memory usage by the gRPC library.
Definition: resource_quota.h:34
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
An Alarm posts the user provided tag to its associated completion queue upon expiry or cancellation...
Definition: alarm.h:31
grpc_resource_quota * c_resource_quota() const
Definition: resource_quota.h:47
struct grpc_resource_quota grpc_resource_quota
Definition: grpc_types.h:614
ResourceQuota & Resize(size_t new_size)
Resize this ResourceQuota to a new size.