Assimp  v4.1. (December 2018)
CppGenerator Namespace Reference

Functions

def count_args_up (entity, schema)
 
def gen_converter (entity, schema)
 
def gen_type_struct (typen, schema)
 
def generate_fields (entity, schema)
 
def get_base_classes (e, schema)
 
def get_cpp_type (field, schema)
 
def get_derived (e, schema)
 
def get_hierarchy (e, schema)
 
def get_list_bounds (collection_spec)
 
def get_single_conversion (field, schema, argnum=0, classname='?')
 
def handle_unset_args (field, entity, schema, argnum)
 
def resolve_base_type (base, schema)
 
def sort_entity_list (schema)
 
def work (filename)
 

Variables

string input_template_cpp = 'IFCReaderGen.cpp.template'
 
string input_template_h = 'IFCReaderGen.h.template'
 
 output_file_cpp = os.path.join('..','..','code','IFCReaderGen.cpp')
 
 output_file_h = os.path.join('..','..','code','IFCReaderGen.h')
 
string template_allow_derived
 
string template_allow_optional
 
string template_convert_single
 
string template_converter
 
string template_converter_check_argcnt = '\tif (params.GetSize() < {max_arg}) {{ throw STEP::TypeError("expected {max_arg} arguments to {name}"); }}'
 
string template_converter_code_per_field
 
string template_converter_epilogue = '\treturn base;'
 
string template_converter_omitted = '// this data structure is not used yet, so there is no code generated to fill its members\n'
 
string template_converter_prologue_a = '\tsize_t base = GenericFill(db,params,static_cast<{parent}*>(in));\n'
 
string template_converter_prologue_b = '\tsize_t base = 0;\n'
 
string template_entity
 
string template_entity_ni = ''
 
string template_entity_predef = '\tstruct {entity};\n'
 
string template_entity_predef_ni = '\ttypedef NotImplemented {entity}; // (not currently used by Assimp)\n'
 
string template_schema = '\t\tSchemaEntry("{normalized_name}",&STEP::ObjectHelper<{type},{argcnt}>::Construct )\n'
 
string template_schema_type = '\t\tSchemaEntry("{normalized_name}",NULL )\n'
 
string template_stub_decl = '\tDECL_CONV_STUB({type});\n'
 
string template_type
 

Function Documentation

◆ count_args_up()

def CppGenerator.count_args_up (   entity,
  schema 
)

◆ gen_converter()

def CppGenerator.gen_converter (   entity,
  schema 
)

◆ gen_type_struct()

def CppGenerator.gen_type_struct (   typen,
  schema 
)

◆ generate_fields()

def CppGenerator.generate_fields (   entity,
  schema 
)

◆ get_base_classes()

def CppGenerator.get_base_classes (   e,
  schema 
)

◆ get_cpp_type()

def CppGenerator.get_cpp_type (   field,
  schema 
)

◆ get_derived()

def CppGenerator.get_derived (   e,
  schema 
)

◆ get_hierarchy()

def CppGenerator.get_hierarchy (   e,
  schema 
)

◆ get_list_bounds()

def CppGenerator.get_list_bounds (   collection_spec)

◆ get_single_conversion()

def CppGenerator.get_single_conversion (   field,
  schema,
  argnum = 0,
  classname = '?' 
)

◆ handle_unset_args()

def CppGenerator.handle_unset_args (   field,
  entity,
  schema,
  argnum 
)

◆ resolve_base_type()

def CppGenerator.resolve_base_type (   base,
  schema 
)

◆ sort_entity_list()

def CppGenerator.sort_entity_list (   schema)

◆ work()

def CppGenerator.work (   filename)

Variable Documentation

◆ input_template_cpp

string CppGenerator.input_template_cpp = 'IFCReaderGen.cpp.template'

◆ input_template_h

string CppGenerator.input_template_h = 'IFCReaderGen.h.template'

◆ output_file_cpp

CppGenerator.output_file_cpp = os.path.join('..','..','code','IFCReaderGen.cpp')

◆ output_file_h

CppGenerator.output_file_h = os.path.join('..','..','code','IFCReaderGen.h')

◆ template_allow_derived

string CppGenerator.template_allow_derived
Initial value:
1 = r"""
2  if (dynamic_cast<const ISDERIVED*>(&*arg)) {{ in->ObjectHelper<Assimp::IFC::{type},{argcnt}>::aux_is_derived[{argnum}]=true; break; }}"""

◆ template_allow_optional

string CppGenerator.template_allow_optional
Initial value:
1 = r"""
2  if (dynamic_cast<const UNSET*>(&*arg)) break;"""

◆ template_convert_single

string CppGenerator.template_convert_single
Initial value:
1 = r"""
2  try {{ GenericConvert( in->{name}, arg, db ); break; }}
3  catch (const TypeError& t) {{ throw TypeError(t.what() + std::string(" - expected argument {argnum} to {classname} to be a `{full_type}`")); }}"""

◆ template_converter

string CppGenerator.template_converter
Initial value:
1 = r"""
2 // -----------------------------------------------------------------------------------------------------------
3 template <> size_t GenericFill<{type}>(const DB& db, const LIST& params, {type}* in)
4 {{
5 {contents}
6 }}"""

◆ template_converter_check_argcnt

string CppGenerator.template_converter_check_argcnt = '\tif (params.GetSize() < {max_arg}) {{ throw STEP::TypeError("expected {max_arg} arguments to {name}"); }}'

◆ template_converter_code_per_field

string CppGenerator.template_converter_code_per_field
Initial value:
1 = r""" do {{ // convert the '{fieldname}' argument
2  boost::shared_ptr<const DataType> arg = params[base++];{handle_unset}{convert}
3  }} while(0);
4 """

◆ template_converter_epilogue

string CppGenerator.template_converter_epilogue = '\treturn base;'

◆ template_converter_omitted

string CppGenerator.template_converter_omitted = '// this data structure is not used yet, so there is no code generated to fill its members\n'

◆ template_converter_prologue_a

string CppGenerator.template_converter_prologue_a = '\tsize_t base = GenericFill(db,params,static_cast<{parent}*>(in));\n'

◆ template_converter_prologue_b

string CppGenerator.template_converter_prologue_b = '\tsize_t base = 0;\n'

◆ template_entity

string CppGenerator.template_entity
Initial value:
1 = r"""
2 
3  // C++ wrapper for {entity}
4  struct {entity} : {parent} ObjectHelper<{entity},{argcnt}> {{ {entity}() : Object("{entity}") {{}}
5 {fields}
6  }};"""

◆ template_entity_ni

string CppGenerator.template_entity_ni = ''

◆ template_entity_predef

string CppGenerator.template_entity_predef = '\tstruct {entity};\n'

◆ template_entity_predef_ni

string CppGenerator.template_entity_predef_ni = '\ttypedef NotImplemented {entity}; // (not currently used by Assimp)\n'

◆ template_schema

string CppGenerator.template_schema = '\t\tSchemaEntry("{normalized_name}",&STEP::ObjectHelper<{type},{argcnt}>::Construct )\n'

◆ template_schema_type

string CppGenerator.template_schema_type = '\t\tSchemaEntry("{normalized_name}",NULL )\n'

◆ template_stub_decl

string CppGenerator.template_stub_decl = '\tDECL_CONV_STUB({type});\n'

◆ template_type

string CppGenerator.template_type
Initial value:
1 = r"""
2  // C++ wrapper type for {type}
3  typedef {real_type} {type};"""