class TypeId

Defined at line 1033 of file ../../third_party/protobuf/src/google/protobuf/message_lite.h

A `std::type_info` equivalent for protobuf message types.

This class is preferred over using `typeid` for a few reasons:

- It works with RTTI disabled.

- It works for `DynamicMessage` types.

- It works in custom vtable mode.

Usage:

- Instead of `typeid(Type)` use `TypeId::Get

<Type

>()`

- Instead of `typeid(expr)` use `TypeId::Get(expr)`

Supports all relationals including

<

=>, and supports hashing via

`absl::Hash`.

Public Methods

TypeId Get (const MessageLite & msg)

Defined at line 1035 of file ../../third_party/protobuf/src/google/protobuf/message_lite.h

template <typename T>
TypeId Get ()

Defined at line 1040 of file ../../third_party/protobuf/src/google/protobuf/message_lite.h

absl::string_view name ()

Name of the message type.

Equivalent to `.GetTypeName()` on the message.

Friends

template <typename H>
H TypeId (H state, TypeId id)
strong_ordering TypeId (TypeId a, TypeId b)
bool TypeId (TypeId a, TypeId b)
bool TypeId (TypeId a, TypeId b)
bool TypeId (TypeId a, TypeId b)
bool TypeId (TypeId a, TypeId b)
bool TypeId (TypeId a, TypeId b)
bool TypeId (TypeId aTypeId b)