# List of files containing definitions of the structures to setup interfaces for. struct_def_files = [ '../tao/code/tao_struct.f90', '../sim_utils/plot/quick_plot_struct.f90', ] # List of use statements needed in various Fortran modules conversion_use_statements = ['use tao_struct', 'use equality_mod', 'use bmad_cpp_convert_mod'] equality_use_statements = ['use tao_struct', 'use equality_mod'] test_use_statements = ['use bmad_cpp_test_mod'] # List of structures to setup interfaces for. # List must be in ordered such that if struct A is a component of struct B, # then A must be before B in the list. struct_list = [ 'qp_rect_struct', 'qp_line_struct', 'qp_symbol_struct', 'qp_point_struct', 'qp_axis_struct', 'tao_cmd_history_struct', 'tao_real_pointer_struct', 'tao_logical_array_struct', 'tao_integer_array_struct', # 'tao_string_array_struct', Ignore until interface can handle var size strings. 'tao_expression_info_struct', 'tao_eval_stack1_struct', 'tao_ele_shape_struct', 'tao_pattern_point_struct', 'tao_pattern_curve_struct', 'tao_shape_pattern_struct', 'tao_drawing_struct', 'tao_wave_kick_pt_struct', 'tao_wave_struct', 'tao_title_struct', 'tao_data_var_component_struct', 'tao_histogram_struct', 'tao_curve_struct', 'tao_graph_struct', 'tao_plot_struct', 'tao_plot_region_struct', 'tao_plot_page_struct', 'tao_plot_array_struct', 'tao_graph_array_struct', 'tao_curve_array_struct', 'tao_data_struct', 'tao_d1_data_struct', 'tao_d2_data_struct', 'tao_data_array_struct', 'tao_d1_data_array_struct', 'tao_d2_data_array_struct', 'tao_var_slave_struct', 'tao_var_struct', 'tao_v1_var_struct', 'tao_var_array_struct', 'tao_v1_var_array_struct', 'tao_building_wall_point_struct', 'tao_building_wall_section_struct', 'tao_building_wall_struct', 'tao_global_struct', 'tao_alias_struct', 'tao_command_file_struct', 'tao_common_struct', 'tao_lat_mode_struct', 'tao_sigma_mat_struct', 'tao_lattice_branch_struct', 'tao_lattice_struct', 'tao_element_struct', 'tao_ping_scale_struct', 'tao_universe_branch_struct', 'tao_beam_struct', 'tao_universe_calc_struct', 'tao_mpi_struct', 'tao_dynamic_aperture_struct', 'tao_universe_struct', 'tao_super_universe_struct', ] # List of structure components to not translate. # Can specify these using the syntax: # or # % component_no_translate_list = set([ ]) # List of structure components links: # Structure components that are just links to other structures are handled differently. # 1) Not call delete in the C++ destructor. # 2) Ignore in Fortran and C++ equality tests (could go around in circles). # 3) Do not create a test pattern in interface test code. interface_ignore_list = set([ 'tao_real_pointer_struct%r', 'tao_logical_array_struct%l', 'tao_integer_array_struct%i', 'tao_string_array_struct%s', 'tao_curve_struct%g', 'tao_graph_struct%p', 'tao_plot_struct%r', 'tao_plot_array_struct%p', 'tao_graph_array_struct%g', 'tao_curve_array_struct%c', 'tao_data_struct%d1', 'tao_d1_data_struct%d2', 'tao_d1_data_struct%d', 'tao_data_array_struct%d', 'tao_d1_data_array_struct%d1', 'tao_d2_data_array_struct%d2', 'tao_this_var_struct%model_value', 'tao_this_var_struct%base_value', 'tao_var_struct%model_value', 'tao_var_struct%base_value', 'tao_var_struct%v1', 'tao_v1_var_struct%v', 'tao_var_array_struct%v', 'tao_v1_var_array_struct%v1', 'tao_common_struct%u_working', 'tao_universe_struct%common', 'tao_universe_struct%model', 'tao_universe_struct%base', 'tao_universe_struct%design', 'tao_universe_struct%uni_branch', ]) # List of structure components that are structures and are defined externally. # There are no such structures for the cpp_bmad_interface library but there # are for the cpp_tao_interface library. structs_defined_externally = set([ 'ele_struct', 'bunch_params_struct', 'coord_struct', 'lat_struct', 'normal_modes_struct', 'rad_int_all_ele_struct', 'beam_struct', 'beam_init_struct', 'aperture_scan_struct', ]) # Translations on C++ side to avoid clash with reserved words c_side_name_translation = { 'tao_plot_page_struct%template' : 'plot_template', 'tao_var_struct%this' : 'this1', 'tao_title_struct%string' : 'title' } # Include header files for main header file include_header_files = [ '#include "cpp_bmad_classes.h"', ] # Directory where the output is put equality_mod_dir = 'code' equality_mod_file = 'tao_equality_mod' test_dir = 'interface_test' code_dir = 'code' # Lower bounds for allocatable and pointer arrays on the fortran side def f_side_lbound (id_name): if id_name == 'branch%ele': return '0' else: return '1' # custom C++ side init c_custom_constructors = { } #----------------------------------------------- # Function to customize the interface code. def customize(struct_definitions): for struct in struct_definitions: pass