Package google :: Package protobuf :: Module descriptor :: Class DescriptorBase
[frames] | no frames]

Class DescriptorBase

source code

object --+
         |
        DescriptorBase
Known Subclasses:

Descriptors base class.

This class is the base of all descriptor classes. It provides common options
related functionaility.

Attributes:
  has_options:  True if the descriptor has non-default options.  Usually it
      is not necessary to read this -- just call GetOptions() which will
      happily return the default instance.  However, it's sometimes useful
      for efficiency, and also useful inside the protobuf implementation to
      avoid some bootstrapping issues.

Instance Methods
 
__init__(self, options, options_class_name)
Initialize the descriptor given its options message and the name of the class of the options message.
source code
 
GetOptions(self)
Retrieves descriptor options.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, options, options_class_name)
(Constructor)

source code 

Initialize the descriptor given its options message and the name of the class of the options message. The name of the class is required in case the options message is None and has to be created.

Overrides: object.__init__

GetOptions(self)

source code 

Retrieves descriptor options.

This method returns the options set or creates the default options for the descriptor.