Package google :: Package protobuf :: Module service_reflection :: Class GeneratedServiceType
[frames] | no frames]

Type GeneratedServiceType

source code

object --+    
         |    
      type --+
             |
            GeneratedServiceType
Known Subclasses:

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()
...

Instance Methods
the object's type
__init__(cls, name, bases, dictionary)
Creates a message service class.
source code

Inherited from type: __call__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __instancecheck__, __le__, __lt__, __ne__, __new__, __repr__, __setattr__, __subclasscheck__, __subclasses__, mro

Inherited from object: __format__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from type: __abstractmethods__, __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __itemsize__, __mro__, __name__, __weakrefoffset__

Inherited from object: __class__

Method Details

__init__(cls, name, bases, dictionary)
(Constructor)

source code 
Creates a message service class.

Args:
  name: Name of the class (ignored, but required by the metaclass
    protocol).
  bases: Base classes of the class being constructed.
  dictionary: The class dictionary of the class being constructed.
    dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
    describing this protocol service type.

Returns: the object's type
Overrides: object.__init__