Public Member Functions | Private Member Functions | Private Attributes | List of all members
google::protobuf::compiler::python::Generator Class Reference

#include <python_generator.h>

Inheritance diagram for google::protobuf::compiler::python::Generator:
Inheritance graph
[legend]

Public Member Functions

virtual bool Generate (const FileDescriptor *file, const std::string &parameter, GeneratorContext *generator_context, std::string *error) const
 
 Generator ()
 
virtual ~Generator ()
 
- Public Member Functions inherited from google::protobuf::compiler::CodeGenerator
 CodeGenerator ()
 
virtual bool GenerateAll (const std::vector< const FileDescriptor * > &files, const std::string &parameter, GeneratorContext *generator_context, std::string *error) const
 
virtual bool HasGenerateAll () const
 
virtual ~CodeGenerator ()
 

Private Member Functions

void AddEnumToFileDescriptor (const EnumDescriptor &descriptor) const
 
void AddExtensionToFileDescriptor (const FieldDescriptor &descriptor) const
 
void AddMessageToFileDescriptor (const Descriptor &descriptor) const
 
void AddServiceToFileDescriptor (const ServiceDescriptor &descriptor) const
 
void CopyPublicDependenciesAliases (const std::string &copy_from, const FileDescriptor *file) const
 
std::string FieldReferencingExpression (const Descriptor *containing_type, const FieldDescriptor &field, const std::string &python_dict_name) const
 
void FixAllDescriptorOptions () const
 
template<typename DescriptorT >
void FixContainingTypeInDescriptor (const DescriptorT &descriptor, const Descriptor *containing_descriptor) const
 
void FixForeignFieldsInDescriptor (const Descriptor &descriptor, const Descriptor *containing_descriptor) const
 
void FixForeignFieldsInDescriptors () const
 
void FixForeignFieldsInExtension (const FieldDescriptor &extension_field) const
 
void FixForeignFieldsInExtensions () const
 
void FixForeignFieldsInField (const Descriptor *containing_type, const FieldDescriptor &field, const std::string &python_dict_name) const
 
void FixForeignFieldsInNestedExtensions (const Descriptor &descriptor) const
 
void FixOptionsForEnum (const EnumDescriptor &descriptor) const
 
void FixOptionsForField (const FieldDescriptor &field) const
 
void FixOptionsForMessage (const Descriptor &descriptor) const
 
void FixOptionsForOneof (const OneofDescriptor &oneof) const
 
bool GeneratingDescriptorProto () const
 
 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS (Generator)
 
template<typename DescriptorT >
std::string ModuleLevelDescriptorName (const DescriptorT &descriptor) const
 
std::string ModuleLevelMessageName (const Descriptor &descriptor) const
 
std::string ModuleLevelServiceDescriptorName (const ServiceDescriptor &descriptor) const
 
std::string OptionsValue (const std::string &serialized_options) const
 
void PrintAllNestedEnumsInFile () const
 
void PrintDescriptor (const Descriptor &message_descriptor) const
 
void PrintDescriptorKeyAndModuleName (const ServiceDescriptor &descriptor) const
 
void PrintEnum (const EnumDescriptor &enum_descriptor) const
 
void PrintEnumValueDescriptor (const EnumValueDescriptor &descriptor) const
 
void PrintExtensionsInDescriptor (const Descriptor &message_descriptor) const
 
void PrintFieldDescriptor (const FieldDescriptor &field, bool is_extension) const
 
void PrintFieldDescriptorsInDescriptor (const Descriptor &message_descriptor, bool is_extension, const std::string &list_variable_name, int(Descriptor::*CountFn)() const, const FieldDescriptor *(Descriptor::*GetterFn)(int) const) const
 
void PrintFieldsInDescriptor (const Descriptor &message_descriptor) const
 
void PrintFileDescriptor () const
 
void PrintImports () const
 
void PrintMessage (const Descriptor &message_descriptor, const std::string &prefix, std::vector< std::string > *to_register, bool is_nested) const
 
void PrintMessageDescriptors () const
 
void PrintMessages () const
 
void PrintNestedDescriptors (const Descriptor &containing_descriptor) const
 
void PrintNestedEnums (const Descriptor &descriptor) const
 
void PrintNestedMessages (const Descriptor &containing_descriptor, const std::string &prefix, std::vector< std::string > *to_register) const
 
template<typename DescriptorT , typename DescriptorProtoT >
void PrintSerializedPbInterval (const DescriptorT &descriptor, DescriptorProtoT &proto) const
 
void PrintServiceClass (const ServiceDescriptor &descriptor) const
 
void PrintServiceDescriptor (const ServiceDescriptor &descriptor) const
 
void PrintServiceDescriptors () const
 
void PrintServices () const
 
void PrintServiceStub (const ServiceDescriptor &descriptor) const
 
void PrintTopLevelEnums () const
 
void PrintTopLevelExtensions () const
 

Private Attributes

const FileDescriptorfile_
 
std::string file_descriptor_serialized_
 
Mutex mutex_
 
io::Printerprinter_
 

Detailed Description

Definition at line 66 of file python_generator.h.

Constructor & Destructor Documentation

◆ Generator()

google::protobuf::compiler::python::Generator::Generator ( )

Definition at line 310 of file python_generator.cc.

◆ ~Generator()

google::protobuf::compiler::python::Generator::~Generator ( )
virtual

Definition at line 312 of file python_generator.cc.

Member Function Documentation

◆ AddEnumToFileDescriptor()

void google::protobuf::compiler::python::Generator::AddEnumToFileDescriptor ( const EnumDescriptor descriptor) const
private

Definition at line 936 of file python_generator.cc.

◆ AddExtensionToFileDescriptor()

void google::protobuf::compiler::python::Generator::AddExtensionToFileDescriptor ( const FieldDescriptor descriptor) const
private

Definition at line 948 of file python_generator.cc.

◆ AddMessageToFileDescriptor()

void google::protobuf::compiler::python::Generator::AddMessageToFileDescriptor ( const Descriptor descriptor) const
private

Definition at line 913 of file python_generator.cc.

◆ AddServiceToFileDescriptor()

void google::protobuf::compiler::python::Generator::AddServiceToFileDescriptor ( const ServiceDescriptor descriptor) const
private

Definition at line 924 of file python_generator.cc.

◆ CopyPublicDependenciesAliases()

void google::protobuf::compiler::python::Generator::CopyPublicDependenciesAliases ( const std::string copy_from,
const FileDescriptor file 
) const
private

Definition at line 1408 of file python_generator.cc.

◆ FieldReferencingExpression()

std::string google::protobuf::compiler::python::Generator::FieldReferencingExpression ( const Descriptor containing_type,
const FieldDescriptor field,
const std::string python_dict_name 
) const
private

Definition at line 997 of file python_generator.cc.

◆ FixAllDescriptorOptions()

void google::protobuf::compiler::python::Generator::FixAllDescriptorOptions ( ) const
private

Definition at line 1294 of file python_generator.cc.

◆ FixContainingTypeInDescriptor()

template<typename DescriptorT >
void google::protobuf::compiler::python::Generator::FixContainingTypeInDescriptor ( const DescriptorT &  descriptor,
const Descriptor containing_descriptor 
) const
private

Definition at line 1014 of file python_generator.cc.

◆ FixForeignFieldsInDescriptor()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInDescriptor ( const Descriptor descriptor,
const Descriptor containing_descriptor 
) const
private

Definition at line 877 of file python_generator.cc.

◆ FixForeignFieldsInDescriptors()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInDescriptors ( ) const
private

Definition at line 1030 of file python_generator.cc.

◆ FixForeignFieldsInExtension()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInExtension ( const FieldDescriptor extension_field) const
private

Definition at line 1065 of file python_generator.cc.

◆ FixForeignFieldsInExtensions()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInExtensions ( ) const
private

Definition at line 1053 of file python_generator.cc.

◆ FixForeignFieldsInField()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInField ( const Descriptor containing_type,
const FieldDescriptor field,
const std::string python_dict_name 
) const
private

Definition at line 969 of file python_generator.cc.

◆ FixForeignFieldsInNestedExtensions()

void google::protobuf::compiler::python::Generator::FixForeignFieldsInNestedExtensions ( const Descriptor descriptor) const
private

Definition at line 1085 of file python_generator.cc.

◆ FixOptionsForEnum()

void google::protobuf::compiler::python::Generator::FixOptionsForEnum ( const EnumDescriptor descriptor) const
private

Definition at line 1329 of file python_generator.cc.

◆ FixOptionsForField()

void google::protobuf::compiler::python::Generator::FixOptionsForField ( const FieldDescriptor field) const
private

Definition at line 1351 of file python_generator.cc.

◆ FixOptionsForMessage()

void google::protobuf::compiler::python::Generator::FixOptionsForMessage ( const Descriptor descriptor) const
private

Definition at line 1373 of file python_generator.cc.

◆ FixOptionsForOneof()

void google::protobuf::compiler::python::Generator::FixOptionsForOneof ( const OneofDescriptor oneof) const
private

Definition at line 1317 of file python_generator.cc.

◆ Generate()

bool google::protobuf::compiler::python::Generator::Generate ( const FileDescriptor file,
const std::string parameter,
GeneratorContext generator_context,
std::string error 
) const
virtual

Implements google::protobuf::compiler::CodeGenerator.

Definition at line 314 of file python_generator.cc.

◆ GeneratingDescriptorProto()

bool google::protobuf::compiler::python::Generator::GeneratingDescriptorProto ( ) const
private

Definition at line 1197 of file python_generator.cc.

◆ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS()

google::protobuf::compiler::python::Generator::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS ( Generator  )
private

◆ ModuleLevelDescriptorName()

template<typename DescriptorT >
std::string google::protobuf::compiler::python::Generator::ModuleLevelDescriptorName ( const DescriptorT &  descriptor) const
private

Definition at line 1206 of file python_generator.cc.

◆ ModuleLevelMessageName()

std::string google::protobuf::compiler::python::Generator::ModuleLevelMessageName ( const Descriptor descriptor) const
private

Definition at line 1237 of file python_generator.cc.

◆ ModuleLevelServiceDescriptorName()

std::string google::protobuf::compiler::python::Generator::ModuleLevelServiceDescriptorName ( const ServiceDescriptor descriptor) const
private

Definition at line 1248 of file python_generator.cc.

◆ OptionsValue()

std::string google::protobuf::compiler::python::Generator::OptionsValue ( const std::string serialized_options) const
private

Definition at line 1118 of file python_generator.cc.

◆ PrintAllNestedEnumsInFile()

void google::protobuf::compiler::python::Generator::PrintAllNestedEnumsInFile ( ) const
private

Definition at line 492 of file python_generator.cc.

◆ PrintDescriptor()

void google::protobuf::compiler::python::Generator::PrintDescriptor ( const Descriptor message_descriptor) const
private

Definition at line 691 of file python_generator.cc.

◆ PrintDescriptorKeyAndModuleName()

void google::protobuf::compiler::python::Generator::PrintDescriptorKeyAndModuleName ( const ServiceDescriptor descriptor) const
private

Definition at line 653 of file python_generator.cc.

◆ PrintEnum()

void google::protobuf::compiler::python::Generator::PrintEnum ( const EnumDescriptor enum_descriptor) const
private

Definition at line 501 of file python_generator.cc.

◆ PrintEnumValueDescriptor()

void google::protobuf::compiler::python::Generator::PrintEnumValueDescriptor ( const EnumValueDescriptor descriptor) const
private

Definition at line 1099 of file python_generator.cc.

◆ PrintExtensionsInDescriptor()

void google::protobuf::compiler::python::Generator::PrintExtensionsInDescriptor ( const Descriptor message_descriptor) const
private

Definition at line 1189 of file python_generator.cc.

◆ PrintFieldDescriptor()

void google::protobuf::compiler::python::Generator::PrintFieldDescriptor ( const FieldDescriptor field,
bool  is_extension 
) const
private

Definition at line 1129 of file python_generator.cc.

◆ PrintFieldDescriptorsInDescriptor()

void google::protobuf::compiler::python::Generator::PrintFieldDescriptorsInDescriptor ( const Descriptor message_descriptor,
bool  is_extension,
const std::string list_variable_name,
int(Descriptor::*)() const  CountFn,
const FieldDescriptor *(Descriptor::*)(int) const  GetterFn 
) const
private

Definition at line 1163 of file python_generator.cc.

◆ PrintFieldsInDescriptor()

void google::protobuf::compiler::python::Generator::PrintFieldsInDescriptor ( const Descriptor message_descriptor) const
private

Definition at line 1179 of file python_generator.cc.

◆ PrintFileDescriptor()

void google::protobuf::compiler::python::Generator::PrintFileDescriptor ( ) const
private

Definition at line 415 of file python_generator.cc.

◆ PrintImports()

void google::protobuf::compiler::python::Generator::PrintImports ( ) const
private

Definition at line 373 of file python_generator.cc.

◆ PrintMessage()

void google::protobuf::compiler::python::Generator::PrintMessage ( const Descriptor message_descriptor,
const std::string prefix,
std::vector< std::string > *  to_register,
bool  is_nested 
) const
private

Definition at line 816 of file python_generator.cc.

◆ PrintMessageDescriptors()

void google::protobuf::compiler::python::Generator::PrintMessageDescriptors ( ) const
private

Definition at line 569 of file python_generator.cc.

◆ PrintMessages()

void google::protobuf::compiler::python::Generator::PrintMessages ( ) const
private

Definition at line 796 of file python_generator.cc.

◆ PrintNestedDescriptors()

void google::protobuf::compiler::python::Generator::PrintNestedDescriptors ( const Descriptor containing_descriptor) const
private

Definition at line 788 of file python_generator.cc.

◆ PrintNestedEnums()

void google::protobuf::compiler::python::Generator::PrintNestedEnums ( const Descriptor descriptor) const
private

Definition at line 541 of file python_generator.cc.

◆ PrintNestedMessages()

void google::protobuf::compiler::python::Generator::PrintNestedMessages ( const Descriptor containing_descriptor,
const std::string prefix,
std::vector< std::string > *  to_register 
) const
private

Definition at line 859 of file python_generator.cc.

◆ PrintSerializedPbInterval()

template<typename DescriptorT , typename DescriptorProtoT >
void google::protobuf::compiler::python::Generator::PrintSerializedPbInterval ( const DescriptorT &  descriptor,
DescriptorProtoT &  proto 
) const
private

Definition at line 1268 of file python_generator.cc.

◆ PrintServiceClass()

void google::protobuf::compiler::python::Generator::PrintServiceClass ( const ServiceDescriptor descriptor) const
private

Definition at line 662 of file python_generator.cc.

◆ PrintServiceDescriptor()

void google::protobuf::compiler::python::Generator::PrintServiceDescriptor ( const ServiceDescriptor descriptor) const
private

Definition at line 592 of file python_generator.cc.

◆ PrintServiceDescriptors()

void google::protobuf::compiler::python::Generator::PrintServiceDescriptors ( ) const
private

Definition at line 576 of file python_generator.cc.

◆ PrintServices()

void google::protobuf::compiler::python::Generator::PrintServices ( ) const
private

Definition at line 584 of file python_generator.cc.

◆ PrintServiceStub()

void google::protobuf::compiler::python::Generator::PrintServiceStub ( const ServiceDescriptor descriptor) const
private

Definition at line 674 of file python_generator.cc.

◆ PrintTopLevelEnums()

void google::protobuf::compiler::python::Generator::PrintTopLevelEnums ( ) const
private

Definition at line 464 of file python_generator.cc.

◆ PrintTopLevelExtensions()

void google::protobuf::compiler::python::Generator::PrintTopLevelExtensions ( ) const
private

Definition at line 551 of file python_generator.cc.

Member Data Documentation

◆ file_

const FileDescriptor* google::protobuf::compiler::python::Generator::file_
mutableprivate

Definition at line 166 of file python_generator.h.

◆ file_descriptor_serialized_

std::string google::protobuf::compiler::python::Generator::file_descriptor_serialized_
mutableprivate

Definition at line 167 of file python_generator.h.

◆ mutex_

Mutex google::protobuf::compiler::python::Generator::mutex_
mutableprivate

Definition at line 165 of file python_generator.h.

◆ printer_

io::Printer* google::protobuf::compiler::python::Generator::printer_
mutableprivate

Definition at line 168 of file python_generator.h.


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


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:09