(self, s, element, element_type=None)
return '%s%s' % (s, decorator)
Convert a discovery name to a suitable C++ class name.

    In C++, nested class names cannot share the same name as the outer class
    name.

    Overrides the default.

    Args:
      s: (str) A rosy name of data element.
      element: (object) The object we need a class name for.
      element_type: (str) The kind of object we need a class name for.
    Returns:
      A name suitable for use as a class in the generator's target language.
Convert a discovery name to a suitable C++ class name.
Convert a discovery name to a suitable C ++ class name .
def ToClassName(self, s, element, element_type=None):
    """Convert a discovery name to a suitable C++ class name.

    In C++, nested class names cannot share the same name as the outer class
    name.

    Overrides the default.

    Args:
      s: (str) A rosy name of data element.
      element: (object) The object we need a class name for.
      element_type: (str) The kind of object we need a class name for.
    Returns:
      A name suitable for use as a class in the generator's target language.
    """
    s = utilities.CamelCase(s)
    if s in CppLanguageModel.RESERVED_CLASS_NAMES:
      s = '%s%s' % (utilities.CamelCase(self.values['name']), s)

    decorator = ''
    if isinstance(element, api.Method):
      resource = element.parent
      while isinstance(resource, api.Resource):
        s = '%s_%s' % (resource.values['className'], s)
        resource = resource.parent
      decorator = 'Method'
    elif isinstance(element, api.Resource):
      decorator = 'Resource'
    elif isinstance(element, api.Api):
      if not s.endswith('Service'):
        decorator = 'Service'
    else:
      return s

    return '%s%s' % (s, decorator)
def ToClassName ( self , s , element , element_type = None ) : s = utilities . CamelCase ( s ) if s in CppLanguageModel . RESERVED_CLASS_NAMES : s = '%s%s' % ( utilities . CamelCase ( self . values [ 'name' ] ) , s ) decorator = '' if isinstance ( element , api . Method ) : resource = element . parent while isinstance ( resource , api . Resource ) : s = '%s_%s' % ( resource . values [ 'className' ] , s ) resource = resource . parent decorator = 'Method' elif isinstance ( element , api . Resource ) : decorator = 'Resource' elif isinstance ( element , api . Api ) : if not s . endswith ( 'Service' ) : decorator = 'Service' else : return s return '%s%s' % ( s , decorator )