parameters: (basepath, fileroot, head, namespace, schema, description)
docstring: Generates the .h file containing the definition of the structure specified
    by the schema.
  
    Args:
      basepath: The base directory in which files are generated.
      fileroot: The filename and path, relative to basepath, of the file to
          create, without an extension.
      head: The string to output as the header of the .h file.
      namespace: A string corresponding to the C++ namespace to use.
      schema: A dict containing the schema. See comment at the top of this file.
      description: A dict containing the description. See comment at the top of
          this file.
docstring_summary: Generates the .h file containing the definition of the structure specified
    by the schema.
docstring_tokens: Generates the . h file containing the definition of the structure specified by the schema .
function: def _GenerateH(basepath, fileroot, head, namespace, schema, description):
    """Generates the .h file containing the definition of the structure specified
    by the schema.
  
    Args:
      basepath: The base directory in which files are generated.
      fileroot: The filename and path, relative to basepath, of the file to
          create, without an extension.
      head: The string to output as the header of the .h file.
      namespace: A string corresponding to the C++ namespace to use.
      schema: A dict containing the schema. See comment at the top of this file.
      description: A dict containing the description. See comment at the top of
          this file.
    """
  
    h_filename = fileroot + '.h'
    with open(os.path.join(basepath, h_filename), 'w') as f:
      f.write(head)
  
      f.write('#include <cstddef>\n')
      f.write('\n')
  
      header_guard = _GenerateHeaderGuard(h_filename)
      f.write('#ifndef %s\n' % header_guard)
      f.write('#define %s\n' % header_guard)
      f.write('\n')
  
      for header in schema.get('headers', []):
        f.write('#include "%s"\n' % header)
      f.write('\n')
  
      if namespace:
        f.write('namespace %s {\n' % namespace)
        f.write('\n')
  
      f.write(struct_generator.GenerateStruct(
        schema['type_name'], schema['schema']))
      f.write('\n')
  
      for var_name, value in description.get('int_variables', []).items():
        f.write('extern const int %s;\n' % var_name)
      f.write('\n')
  
      for element_name, element in description['elements'].items():
        f.write('extern const %s %s;\n' % (schema['type_name'], element_name))
  
      if namespace:
        f.write('\n')
        f.write('}  // namespace %s\n' % namespace)
  
      f.write('\n')
      f.write( '#endif  // %s\n' % header_guard)
function_tokens: def _GenerateH ( basepath , fileroot , head , namespace , schema , description ) : h_filename = fileroot + '.h' with open ( os . path . join ( basepath , h_filename ) , 'w' ) as f : f . write ( head ) f . write ( '#include <cstddef>\n' ) f . write ( '\n' ) header_guard = _GenerateHeaderGuard ( h_filename ) f . write ( '#ifndef %s\n' % header_guard ) f . write ( '#define %s\n' % header_guard ) f . write ( '\n' ) for header in schema . get ( 'headers' , [ ] ) : f . write ( '#include "%s"\n' % header ) f . write ( '\n' ) if namespace : f . write ( 'namespace %s {\n' % namespace ) f . write ( '\n' ) f . write ( struct_generator . GenerateStruct ( schema [ 'type_name' ] , schema [ 'schema' ] ) ) f . write ( '\n' ) for var_name , value in description . get ( 'int_variables' , [ ] ) . items ( ) : f . write ( 'extern const int %s;\n' % var_name ) f . write ( '\n' ) for element_name , element in description [ 'elements' ] . items ( ) : f . write ( 'extern const %s %s;\n' % ( schema [ 'type_name' ] , element_name ) ) if namespace : f . write ( '\n' ) f . write ( '}  // namespace %s\n' % namespace ) f . write ( '\n' ) f . write ( '#endif  // %s\n' % header_guard )