GRPC C++  1.26.0
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
grpc_core Namespace Reference

Internal thread interface. More...

Namespaces

 channelz
 
 internal
 
 manual_ctor_impl
 
 testing
 

Data Structures

class  AllocatedMetadata
 
class  ApplicationCallbackExecCtx
 Application-callback execution context. More...
 
class  Arena
 
class  AsyncConnectivityStateWatcherInterface
 
class  Atomic
 
class  BackOff
 Implementation of the backoff mechanism described in doc/connection-backoff.md. More...
 
class  BdpEstimator
 
class  ByteStream
 
class  ByteStreamCache
 
class  CallCombiner
 
class  CallCombinerClosureList
 
class  Closure
 
class  Combiner
 
class  CondVar
 
struct  ConnectionMetrics
 
class  ConnectivityStateTracker
 
class  ConnectivityStateWatcherInterface
 
class  DebugLocation
 
class  DefaultDeleteChar
 
class  ExecCtx
 Execution context. More...
 
class  Executor
 
struct  ExternallyManagedSlice
 
class  Fork
 
class  GlobalConfigEnv
 
class  GlobalConfigEnvBool
 
class  GlobalConfigEnvInt32
 
class  GlobalConfigEnvString
 
class  HandshakeManager
 
class  Handshaker
 Handshaker. More...
 
struct  HandshakerArgs
 Handshakers are used to perform initial handshakes on a connection before the client sends the initial request. More...
 
class  HandshakerFactory
 
class  HandshakerRegistry
 
class  InfLenFIFOQueue
 
class  InlinedVector
 
class  InternallyRefCounted
 
class  InternedMetadata
 
struct  InternedSlice
 
struct  InternedSliceRefcount
 
class  LockedMultiProducerSingleConsumerQueue
 
class  LockfreeEvent
 
class  LogicalThread
 
struct  ManagedMemorySlice
 
class  ManualConstructor
 
class  MPMCQueueInterface
 
class  MultiProducerSingleConsumerQueue
 
class  Mutex
 
class  MutexLock
 
class  NonPolymorphicRefCount
 
class  Optional
 
class  Orphanable
 
class  OrphanableDelete
 
class  PidController
 
class  PolymorphicManualConstructor
 
class  PolymorphicRefCount
 
class  RefCount
 
class  RefCounted
 
class  RefcountedMdBase
 
class  RefCountedPtr
 
struct  RefCountedPtrLess
 
class  ReleasableMutexLock
 
class  SliceBufferByteStream
 
class  SliceHashTable
 
class  SliceWeakHashTable
 
class  StaticMetadata
 
struct  StaticMetadataSlice
 
struct  StaticSliceRefcount
 
struct  StringLess
 
class  StringView
 
class  TcpServerFdHandler
 
class  Thread
 
class  ThreadPool
 
class  ThreadPoolInterface
 
class  ThreadPoolWorker
 
struct  ThreadState
 
struct  Timestamp
 
struct  Timestamps
 
class  TracedBuffer
 TracedBuffer is a class to keep track of timestamps for a specific buffer in the TCP layer. More...
 
class  TraceFlag
 
class  TraceFlagList
 
struct  UnmanagedMemorySlice
 
struct  UserData
 

Typedefs

typedef TraceFlag DebugOnlyTraceFlag
 
typedef void(* GlobalConfigEnvErrorFunctionType) (const char *error_message)
 
template<typename T >
using UniquePtr = std::unique_ptr< T, DefaultDeleteChar >
 
template<typename T , typename Deleter = OrphanableDelete>
using OrphanablePtr = std::unique_ptr< T, Deleter >
 
typedef void(* destroy_user_data_func) (void *data)
 

Enumerations

enum  HandshakerType { HANDSHAKER_CLIENT = 0, HANDSHAKER_SERVER, NUM_HANDSHAKER_TYPES }
 
enum  MemoryOrder {
  MemoryOrder::RELAXED = std::memory_order_relaxed, MemoryOrder::CONSUME = std::memory_order_consume, MemoryOrder::ACQUIRE = std::memory_order_acquire, MemoryOrder::RELEASE = std::memory_order_release,
  MemoryOrder::ACQ_REL = std::memory_order_acq_rel, MemoryOrder::SEQ_CST = std::memory_order_seq_cst
}
 
enum  ExecutorType { ExecutorType::DEFAULT = 0, ExecutorType::RESOLVER, ExecutorType::NUM_EXECUTORS }
 
enum  ExecutorJobType { ExecutorJobType::SHORT = 0, ExecutorJobType::LONG, ExecutorJobType::NUM_JOB_TYPES }
 

Functions

void SetGlobalConfigEnvErrorFunction (GlobalConfigEnvErrorFunctionType func)
 
int JoinHostPort (grpc_core::UniquePtr< char > *out, const char *host, int port)
 Given a host and port, creates a newly-allocated string of the form "host:port" or "[ho:st]:port", depending on whether the host contains colons like an IPv6 literal. More...
 
bool SplitHostPort (StringView name, StringView *host, StringView *port)
 Given a name in the form "host:port" or "[ho:st]:port", split into hostname and port number. More...
 
bool SplitHostPort (StringView name, grpc_core::UniquePtr< char > *host, grpc_core::UniquePtr< char > *port)
 
template<typename T , typename... Args>
std::unique_ptr< T > MakeUnique (Args &&... args)
 
template<typename T , typename... Args>
OrphanablePtr< T > MakeOrphanable (Args &&... args)
 
template<typename T , typename... Args>
RefCountedPtr< T > MakeRefCounted (Args &&... args)
 
bool operator== (StringView lhs, StringView rhs)
 
bool operator!= (StringView lhs, StringView rhs)
 
StringView StringViewFromSlice (const grpc_slice &slice)
 
grpc_core::UniquePtr< char > StringViewToCString (const StringView sv)
 
int StringViewCmp (const StringView lhs, const StringView rhs)
 
void grpc_tcp_set_write_timestamps_callback (void(*fn)(void *, grpc_core::Timestamps *, grpc_error *error))
 Sets the callback function to call when timestamps for a write are collected. More...
 
void grpc_executor_global_init ()
 
void grpc_errqueue_init ()
 
const char * ConnectivityStateName (grpc_connectivity_state state)
 
uint64_t StaticMetadataInitCanary ()
 

Variables

DebugOnlyTraceFlag grpc_call_combiner_trace
 
DebugOnlyTraceFlag grpc_thread_pool_trace
 
DebugOnlyTraceFlag grpc_logical_thread_trace
 
grpc_slice_refcount kNoopRefcount
 
uint32_t g_hash_seed
 
TraceFlag grpc_connectivity_state_trace
 
constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L
 
const StaticMetadataSliceg_static_metadata_slice_table
 
StaticSliceRefcountg_static_metadata_slice_refcounts
 
StaticMetadatag_static_mdelem_table
 
grpc_mdelemg_static_mdelem_manifested
 

Detailed Description

Internal thread interface.

Weak hash table implementation.

Hash table implementation.

This implementation uses open addressing (https://en.wikipedia.org/wiki/Open_addressing) with linear probing (https://en.wikipedia.org/wiki/Linear_probing).

The keys are grpc_slice objects. The values can be any type.

Hash tables are intentionally immutable, to avoid the need for locking.

This entries in this table are weak: an entry may be removed at any time due to a number of reasons: memory pressure, hash collisions, etc.

The keys are grpc_slice objects. The values are of arbitrary type.

This class is thread unsafe. It's the caller's responsibility to ensure proper locking when accessing its methods.

Typedef Documentation

◆ DebugOnlyTraceFlag

◆ destroy_user_data_func

typedef void(* grpc_core::destroy_user_data_func) (void *data)

◆ GlobalConfigEnvErrorFunctionType

typedef void(* grpc_core::GlobalConfigEnvErrorFunctionType) (const char *error_message)

◆ OrphanablePtr

template<typename T , typename Deleter = OrphanableDelete>
using grpc_core::OrphanablePtr = typedef std::unique_ptr<T, Deleter>

◆ UniquePtr

template<typename T >
using grpc_core::UniquePtr = typedef std::unique_ptr<T, DefaultDeleteChar>

Enumeration Type Documentation

◆ ExecutorJobType

Enumerator
SHORT 
LONG 
NUM_JOB_TYPES 

◆ ExecutorType

Enumerator
DEFAULT 
RESOLVER 
NUM_EXECUTORS 

◆ HandshakerType

Enumerator
HANDSHAKER_CLIENT 
HANDSHAKER_SERVER 
NUM_HANDSHAKER_TYPES 

◆ MemoryOrder

Enumerator
RELAXED 
CONSUME 
ACQUIRE 
RELEASE 
ACQ_REL 
SEQ_CST 

Function Documentation

◆ ConnectivityStateName()

const char* grpc_core::ConnectivityStateName ( grpc_connectivity_state  state)

◆ grpc_errqueue_init()

void grpc_core::grpc_errqueue_init ( )

◆ grpc_executor_global_init()

void grpc_core::grpc_executor_global_init ( )

◆ grpc_tcp_set_write_timestamps_callback()

void grpc_core::grpc_tcp_set_write_timestamps_callback ( void(*)(void *, grpc_core::Timestamps *, grpc_error *error)  fn)

Sets the callback function to call when timestamps for a write are collected.

The callback does not own a reference to error.

◆ JoinHostPort()

int grpc_core::JoinHostPort ( grpc_core::UniquePtr< char > *  out,
const char *  host,
int  port 
)

Given a host and port, creates a newly-allocated string of the form "host:port" or "[ho:st]:port", depending on whether the host contains colons like an IPv6 literal.

If the host is already bracketed, then additional brackets will not be added.

Usage is similar to gpr_asprintf: returns the number of bytes written (excluding the final '\0'), and *out points to a string.

In the unlikely event of an error, returns -1 and sets *out to NULL.

◆ MakeOrphanable()

template<typename T , typename... Args>
OrphanablePtr<T> grpc_core::MakeOrphanable ( Args &&...  args)
inline

◆ MakeRefCounted()

template<typename T , typename... Args>
RefCountedPtr<T> grpc_core::MakeRefCounted ( Args &&...  args)
inline

◆ MakeUnique()

template<typename T , typename... Args>
std::unique_ptr<T> grpc_core::MakeUnique ( Args &&...  args)
inline

◆ operator!=()

bool grpc_core::operator!= ( StringView  lhs,
StringView  rhs 
)
inline

◆ operator==()

bool grpc_core::operator== ( StringView  lhs,
StringView  rhs 
)
inline

◆ SetGlobalConfigEnvErrorFunction()

void grpc_core::SetGlobalConfigEnvErrorFunction ( GlobalConfigEnvErrorFunctionType  func)

◆ SplitHostPort() [1/2]

bool grpc_core::SplitHostPort ( StringView  name,
StringView host,
StringView port 
)

Given a name in the form "host:port" or "[ho:st]:port", split into hostname and port number.

There are two variants of this method: 1) StringView output: port and host are returned as views on name. 2) char* output: port and host are copied into newly allocated strings.

Prefer variant (1) over (2), because no allocation or copy is performed in variant (1). Use (2) only when interacting with C API that mandate null-terminated strings.

Return true on success, false on failure. Guarantees *host and *port are cleared on failure.

◆ SplitHostPort() [2/2]

bool grpc_core::SplitHostPort ( StringView  name,
grpc_core::UniquePtr< char > *  host,
grpc_core::UniquePtr< char > *  port 
)

◆ StaticMetadataInitCanary()

uint64_t grpc_core::StaticMetadataInitCanary ( )

◆ StringViewCmp()

int grpc_core::StringViewCmp ( const StringView  lhs,
const StringView  rhs 
)
inline

◆ StringViewFromSlice()

StringView grpc_core::StringViewFromSlice ( const grpc_slice slice)
inline

◆ StringViewToCString()

grpc_core::UniquePtr<char> grpc_core::StringViewToCString ( const StringView  sv)
inline

Variable Documentation

◆ g_hash_seed

uint32_t grpc_core::g_hash_seed

◆ g_static_mdelem_manifested

grpc_mdelem* grpc_core::g_static_mdelem_manifested

◆ g_static_mdelem_table

StaticMetadata* grpc_core::g_static_mdelem_table

◆ g_static_metadata_slice_refcounts

StaticSliceRefcount* grpc_core::g_static_metadata_slice_refcounts

◆ g_static_metadata_slice_table

const StaticMetadataSlice* grpc_core::g_static_metadata_slice_table

◆ grpc_call_combiner_trace

DebugOnlyTraceFlag grpc_core::grpc_call_combiner_trace

◆ grpc_connectivity_state_trace

TraceFlag grpc_core::grpc_connectivity_state_trace

◆ grpc_logical_thread_trace

DebugOnlyTraceFlag grpc_core::grpc_logical_thread_trace

◆ grpc_thread_pool_trace

DebugOnlyTraceFlag grpc_core::grpc_thread_pool_trace

◆ kGrpcStaticMetadataInitCanary

constexpr uint64_t grpc_core::kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L

◆ kNoopRefcount

grpc_slice_refcount grpc_core::kNoopRefcount