OpenDDS  Snapshot(2023/04/28-20:55)
Typedefs | Functions | Variables
AstTypeClassification Namespace Reference

Typedefs

typedef size_t Classification
 

Functions

AST_Type * resolveActualType (AST_Type *element)
 
Classification classify (AST_Type *type)
 

Variables

const Classification CL_UNKNOWN = 0
 
const Classification CL_SCALAR = 1
 
const Classification CL_PRIMITIVE = 2
 
const Classification CL_STRUCTURE = 4
 
const Classification CL_STRING = 8
 
const Classification CL_ENUM = 16
 
const Classification CL_UNION = 32
 
const Classification CL_ARRAY = 64
 
const Classification CL_SEQUENCE = 128
 
const Classification CL_WIDE = 256
 
const Classification CL_BOUNDED = 512
 
const Classification CL_INTERFACE = 1024
 
const Classification CL_FIXED = 2048
 

Typedef Documentation

◆ Classification

Definition at line 416 of file dds_generator.h.

Function Documentation

◆ classify()

Classification AstTypeClassification::classify ( AST_Type *  type)
inline

Definition at line 422 of file dds_generator.h.

References CL_ARRAY, CL_BOUNDED, CL_ENUM, CL_FIXED, CL_INTERFACE, CL_PRIMITIVE, CL_SCALAR, CL_SEQUENCE, CL_STRING, CL_STRUCTURE, CL_UNION, CL_UNKNOWN, CL_WIDE, and resolveActualType().

Referenced by bounded_arg(), FieldInfo::EleLen::EleLen(), field_type_name(), GeneratorBase::gen_array(), marshal_generator::gen_enum(), metaclass_generator::gen_enum(), marshal_generator::gen_field_getValueFromSerialized(), FaceGenerator::gen_sequence(), SafetyProfileGenerator::gen_sequence(), FaceGenerator::gen_struct(), SafetyProfileGenerator::gen_struct(), Cxx11Generator::gen_struct(), marshal_generator::gen_typedef(), metaclass_generator::gen_typedef(), GeneratorBase::gen_typedef_varout(), marshal_generator::gen_union(), gen_union_branch(), marshal_generator::gen_union_default(), generate_anon_fields(), GeneratorBase::generate_union_field(), GeneratorBase::generateAssign(), generateCaseBody(), GeneratorBase::generateCopyCtor(), GeneratorBase::generateEqual(), GeneratorBase::generateReset(), getWrapper(), GeneratorBase::map_type(), needs_distinct_type(), needs_forany(), needs_nested_key_only(), GeneratorBase::GenerateUnionAccessors::operator()(), operator<<(), to_cxx_type(), type_to_default(), Cxx11Generator::union_accessors(), Cxx11Generator::union_activate(), and Cxx11Generator::union_reset().

423  {
424  type = resolveActualType(type);
425  switch (type->node_type()) {
426  case AST_Decl::NT_pre_defined: {
427  AST_PredefinedType* p = dynamic_cast<AST_PredefinedType*>(type);
428  switch (p->pt()) {
429  case AST_PredefinedType::PT_any:
430  case AST_PredefinedType::PT_object:
431  return CL_UNKNOWN;
432  case AST_PredefinedType::PT_wchar:
433  return CL_SCALAR | CL_PRIMITIVE | CL_WIDE;
434  default:
435  return CL_SCALAR | CL_PRIMITIVE;
436  }
437  }
438  case AST_Decl::NT_array:
439  return CL_ARRAY;
440  case AST_Decl::NT_union:
441  return CL_UNION;
442  case AST_Decl::NT_string:
443  case AST_Decl::NT_wstring:
444  return CL_SCALAR | CL_STRING |
445  ((dynamic_cast<AST_String*>(type)->max_size()->ev()->u.ulval == 0)
446  ? 0 : CL_BOUNDED) |
447  ((type->node_type() == AST_Decl::NT_wstring) ? CL_WIDE : 0);
448  case AST_Decl::NT_sequence:
449  return CL_SEQUENCE |
450  ((dynamic_cast<AST_Sequence*>(type)->unbounded()) ? 0 : CL_BOUNDED);
451  case AST_Decl::NT_struct:
452  return CL_STRUCTURE;
453  case AST_Decl::NT_enum:
454  return CL_SCALAR | CL_ENUM;
455  case AST_Decl::NT_interface:
456  return CL_INTERFACE;
457 #ifdef ACE_HAS_CDR_FIXED
458  case AST_Decl::NT_fixed:
459  return CL_FIXED;
460 #endif
461  default:
462  return CL_UNKNOWN;
463  }
464  }
const Classification CL_STRING
const Classification CL_SCALAR
const Classification CL_WIDE
const Classification CL_PRIMITIVE
const Classification CL_BOUNDED
const Classification CL_ARRAY
AST_Type * resolveActualType(AST_Type *element)
const Classification CL_UNKNOWN
const Classification CL_FIXED
const Classification CL_STRUCTURE
const Classification CL_INTERFACE
const Classification CL_ENUM
const Classification CL_SEQUENCE
const Classification CL_UNION

◆ resolveActualType()

AST_Type* AstTypeClassification::resolveActualType ( AST_Type *  element)
inline

Definition at line 373 of file dds_generator.h.

Referenced by classify(), container_base_type(), container_element_limit(), FieldInfo::EleLen::EleLen(), marshal_generator::gen_enum(), metaclass_generator::gen_enum(), marshal_generator::gen_field_getValueFromSerialized(), FaceGenerator::gen_struct(), SafetyProfileGenerator::gen_struct(), marshal_generator::gen_typedef(), metaclass_generator::gen_typedef(), langmap_generator::gen_typedef(), marshal_generator::gen_union(), marshal_generator::gen_union_default(), generate_anon_fields(), GeneratorBase::generate_union_field(), GeneratorBase::generateAssign(), generateCaseBody(), GeneratorBase::generateCopyCtor(), GeneratorBase::generateEqual(), GeneratorBase::generateReset(), generateSwitchForUnion(), GeneratorBase::map_type(), needs_distinct_type(), needs_forany(), needs_nested_key_only(), NestedForLoops::NestedForLoops(), GeneratorBase::GenerateUnionAccessors::operator()(), to_cxx_type(), type_to_default(), Cxx11Generator::union_accessors(), Cxx11Generator::union_activate(), and Cxx11Generator::union_reset().

374  {
375  if (element->node_type() == AST_Decl::NT_typedef) {
376  AST_Typedef* td = dynamic_cast<AST_Typedef*>(element);
377  return td->primitive_base_type();
378  }
379 
380  switch(element->node_type()) {
381  case AST_Decl::NT_interface_fwd:
382  {
383  AST_InterfaceFwd* td = dynamic_cast<AST_InterfaceFwd*>(element);
384  return td->full_definition();
385  }
386  case AST_Decl::NT_valuetype_fwd:
387  {
388  AST_ValueTypeFwd* td = dynamic_cast<AST_ValueTypeFwd*>(element);
389  return td->full_definition();
390  }
391  case AST_Decl::NT_union_fwd:
392  {
393  AST_UnionFwd* td = dynamic_cast<AST_UnionFwd*>(element);
394  return td->full_definition();
395  }
396  case AST_Decl::NT_struct_fwd:
397  {
398  AST_StructureFwd* td = dynamic_cast<AST_StructureFwd*>(element);
399  return td->full_definition();
400  }
401  case AST_Decl::NT_component_fwd:
402  {
403  AST_ComponentFwd* td = dynamic_cast<AST_ComponentFwd*>(element);
404  return td->full_definition();
405  }
406  case AST_Decl::NT_eventtype_fwd:
407  {
408  AST_EventTypeFwd* td = dynamic_cast<AST_EventTypeFwd*>(element);
409  return td->full_definition();
410  }
411  default:
412  return element;
413  }
414  }

Variable Documentation

◆ CL_ARRAY

const Classification AstTypeClassification::CL_ARRAY = 64

◆ CL_BOUNDED

const Classification AstTypeClassification::CL_BOUNDED = 512

◆ CL_ENUM

const Classification AstTypeClassification::CL_ENUM = 16

◆ CL_FIXED

const Classification AstTypeClassification::CL_FIXED = 2048

◆ CL_INTERFACE

const Classification AstTypeClassification::CL_INTERFACE = 1024

Definition at line 419 of file dds_generator.h.

Referenced by classify(), marshal_generator::gen_enum(), and GeneratorBase::map_type().

◆ CL_PRIMITIVE

const Classification AstTypeClassification::CL_PRIMITIVE = 2

◆ CL_SCALAR

const Classification AstTypeClassification::CL_SCALAR = 1

◆ CL_SEQUENCE

const Classification AstTypeClassification::CL_SEQUENCE = 128

◆ CL_STRING

const Classification AstTypeClassification::CL_STRING = 8

◆ CL_STRUCTURE

const Classification AstTypeClassification::CL_STRUCTURE = 4

◆ CL_UNION

const Classification AstTypeClassification::CL_UNION = 32

◆ CL_UNKNOWN

const Classification AstTypeClassification::CL_UNKNOWN = 0

◆ CL_WIDE

const Classification AstTypeClassification::CL_WIDE = 256