userver: ugrpc::VisitorCompiler Class Reference
Loading...
Searching...
No Matches
ugrpc::VisitorCompiler Class Referenceabstract

#include <userver/ugrpc/protobuf_visit.hpp>

Detailed Description

Base class for BaseVisitor. Constructs and manages the descriptor graph to collect the data about the messages and enable the visitors to find all selected structures.

Definition at line 70 of file protobuf_visit.hpp.

+ Inheritance diagram for ugrpc::VisitorCompiler:

Public Types

enum class  LockBehavior {
  kNone = 0 ,
  kShared = 1
}
 

Public Member Functions

 VisitorCompiler (VisitorCompiler &&)=delete
 
 VisitorCompiler (const VisitorCompiler &)=delete
 
void Compile (const google::protobuf::Descriptor *descriptor)
 Compiles the visitor for the given message type and its dependent types.
 
void Compile (const DescriptorList &descriptors)
 Compiles the visitor for the given message types and their dependent types.
 
void CompileAllGenerated ()
 Compiles the visitor for all message types we can find. Not guaranteed to find all message types.
 
void CompileGenerated (std::string_view message_name)
 Compiles the visitor for the given generated message type and its dependent types.
 
void CompileGenerated (utils::span< std::string_view > message_names)
 Compiles the visitor for the given generated message type and their dependent types.
 
bool ContainsSelected (const google::protobuf::Descriptor *descriptor)
 Efficiently checks if the message contains any selected structures.
 
virtual void CompileOne (const google::protobuf::Descriptor &descriptor)=0
 Compile one message without nested.
 
virtual bool IsSelected (const google::protobuf::Descriptor &) const =0
 Checks if the message is selected or has anything selected.
 

Member Enumeration Documentation

◆ LockBehavior

Enumerator
kNone 

Do not take shared_mutex locks for any operation on the visitor.

kShared 

Take shared_lock for all read operations on the visitor and unique_lock for all Compile operations.

Definition at line 72 of file protobuf_visit.hpp.

Member Function Documentation

◆ ContainsSelected()

bool ugrpc::VisitorCompiler::ContainsSelected ( const google::protobuf::Descriptor * descriptor)

Efficiently checks if the message contains any selected structures.

You may want to call this before Visit and VisitRecursive to avoid a copy of the message beforehand if you require one.


The documentation for this class was generated from the following file: