service_reflection
Contains metaclasses used to create protocol service and service stub classes from ServiceDescriptor objects at runtime.
The GeneratedServiceType and GeneratedServiceStubType metaclasses are used to inject all useful functionality into the classes output by the protocol compiler at compile-time.
GeneratedServiceStubType
Bases: GeneratedServiceType
Metaclass for service stubs created at runtime from ServiceDescriptors.
This class has similar responsibilities as GeneratedServiceType, except that it creates the service stub classes.
Source code in client/ayon_hiero/vendor/google/protobuf/service_reflection.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
__init__(name, bases, dictionary)
Creates a message service stub class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Name of the class (ignored, here). | required | |
bases | Base classes of the class being constructed. | required | |
dictionary | The class dictionary of the class being constructed. dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object describing this protocol service type. | required |
Source code in client/ayon_hiero/vendor/google/protobuf/service_reflection.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
GeneratedServiceType
Bases: type
Metaclass for service classes created at runtime from ServiceDescriptors.
Implementations for all methods described in the Service class are added here by this class. We also create properties to allow getting/setting all fields in the protocol message.
The protocol compiler currently uses this metaclass to create protocol service classes at runtime. Clients can also manually create their own classes at runtime, as in this example::
mydescriptor = ServiceDescriptor(.....) class MyProtoService(service.Service): metaclass = GeneratedServiceType DESCRIPTOR = mydescriptor myservice_instance = MyProtoService() # ...
Source code in client/ayon_hiero/vendor/google/protobuf/service_reflection.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
__init__(name, bases, dictionary)
Creates a message service class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Name of the class (ignored, but required by the metaclass protocol). | required | |
bases | Base classes of the class being constructed. | required | |
dictionary | The class dictionary of the class being constructed. dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object describing this protocol service type. | required |
Source code in client/ayon_hiero/vendor/google/protobuf/service_reflection.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|