parameters: (self, obj)
docstring: Defined to generate includes within a file.
          Usually used for the base classes but also for Port types
          @param args: the instance of the concrete element to operation on.
docstring_summary: Defined to generate includes within a file.
          Usually used for the base classes but also for Port types
docstring_tokens: Defined to generate includes within a file . Usually used for the base classes but also for Port types
function: def includes1Visit(self, obj):
          """
          Defined to generate includes within a file.
          Usually used for the base classes but also for Port types
          @param args: the instance of the concrete element to operation on.
          """
          relative_path = self.relativePath()
          #
          DEBUG.debug("Relative path: %s", relative_path)
          #
          c = includes1TopologyH.includes1TopologyH()
          temp = obj.get_comp_list()
  
          # Only generate port connections
          c.connect_only = False
          if obj.connect_only:
              c.connect_only = True
          # Generate Components as pointers
          c.is_ptr = False
          if obj.is_ptr:
              c.is_ptr = True
          else:
              if not obj.connect_only:
                  c.is_ptr = True
                  obj.is_ptr = True
  
          c.component_header_list = []
          for component in temp:
              #
              # Hack to fix the include file so it is consistent...
              if self.__config.get("component", "XMLDefaultFileName") == "False":
                  namespace = ""
              else:
                  namespace = component.get_namespace()
              #
              # Added configurable override for includes for testing
              if self.__config.get("includes", "comp_include_path") == "None":
                  if relative_path is not None:
                      path = relative_path
                  else:
                      path = component.get_namespace()
              else:
                  path = self.__config.get("includes", "comp_include_path")
              c.path = path
              c.component_header_list.append((path, namespace, component.get_kind()))
          #
          # Build list of unique component types here...
          comp_types = [k[2] for k in c.component_header_list]
          comp_types = self.__model_parser.uniqueList(comp_types)
          comp_headers = c.component_header_list
          #
          # Recreate component_header_list here with only unique types...
          c.component_header_list = []
          for k in comp_types:
              for comp in comp_headers:
                  if k == comp[2]:
                      c.component_header_list.append(comp)
                      break
  
          #
          ## Create Component Declarations
          component_list = []
          for component in temp:
              d = {
                  "ns": component.get_namespace(),
                  "name": component.get_name(),
                  "kind": component.get_kind(),
              }
              component_list.append(dict(d))
  
          c.component_import_list = []
          for xml_name in obj.get_instance_header_dict():
              if obj.get_instance_header_dict()[xml_name] is not None:
                  xml_path = obj.get_instance_header_dict()[xml_name]
              else:
                  xml_path = xml_name
                  xml_path = xml_path.strip()
                  xml_path = xml_path.replace("i.xml", "")
                  xml_path += "c.hpp"
              c.component_import_list.append(xml_path)
  
          c.component_declarations = []
  
          for component in component_list:
              if obj.is_ptr:
                  declaration_template = """{ns}::{kind}Impl* {name}_ptr = 0;""".format(
                      **component
                  )
              else:
                  declaration_template = """{ns}::{kind}Impl {name}("{name}");""".format(
                      **component
                  )
              c.component_declarations.append(declaration_template)
  
          self._writeTmpl(c, "includes1Visit")
function_tokens: def includes1Visit ( self , obj ) : relative_path = self . relativePath ( ) # DEBUG . debug ( "Relative path: %s" , relative_path ) # c = includes1TopologyH . includes1TopologyH ( ) temp = obj . get_comp_list ( ) # Only generate port connections c . connect_only = False if obj . connect_only : c . connect_only = True # Generate Components as pointers c . is_ptr = False if obj . is_ptr : c . is_ptr = True else : if not obj . connect_only : c . is_ptr = True obj . is_ptr = True c . component_header_list = [ ] for component in temp : # # Hack to fix the include file so it is consistent... if self . __config . get ( "component" , "XMLDefaultFileName" ) == "False" : namespace = "" else : namespace = component . get_namespace ( ) # # Added configurable override for includes for testing if self . __config . get ( "includes" , "comp_include_path" ) == "None" : if relative_path is not None : path = relative_path else : path = component . get_namespace ( ) else : path = self . __config . get ( "includes" , "comp_include_path" ) c . path = path c . component_header_list . append ( ( path , namespace , component . get_kind ( ) ) ) # # Build list of unique component types here... comp_types = [ k [ 2 ] for k in c . component_header_list ] comp_types = self . __model_parser . uniqueList ( comp_types ) comp_headers = c . component_header_list # # Recreate component_header_list here with only unique types... c . component_header_list = [ ] for k in comp_types : for comp in comp_headers : if k == comp [ 2 ] : c . component_header_list . append ( comp ) break # ## Create Component Declarations component_list = [ ] for component in temp : d = { "ns" : component . get_namespace ( ) , "name" : component . get_name ( ) , "kind" : component . get_kind ( ) , } component_list . append ( dict ( d ) ) c . component_import_list = [ ] for xml_name in obj . get_instance_header_dict ( ) : if obj . get_instance_header_dict ( ) [ xml_name ] is not None : xml_path = obj . get_instance_header_dict ( ) [ xml_name ] else : xml_path = xml_name xml_path = xml_path . strip ( ) xml_path = xml_path . replace ( "i.xml" , "" ) xml_path += "c.hpp" c . component_import_list . append ( xml_path ) c . component_declarations = [ ] for component in component_list : if obj . is_ptr : declaration_template = """{ns}::{kind}Impl* {name}_ptr = 0;""" . format ( * * component ) else : declaration_template = """{ns}::{kind}Impl {name}("{name}");""" . format ( * * component ) c . component_declarations . append ( declaration_template ) self . _writeTmpl ( c , "includes1Visit" )