OpenDDS  Snapshot(2023/04/07-19:43)
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 398 of file dds_generator.h.

Function Documentation

◆ classify()

Classification AstTypeClassification::classify ( AST_Type *  type)
inline

Definition at line 404 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(), func(), GeneratorBase::gen_array(), marshal_generator::gen_enum(), metaclass_generator::gen_enum(), marshal_generator::gen_field_getValueFromSerialized(), FaceGenerator::gen_sequence(), SafetyProfileGenerator::gen_sequence(), metaclass_generator::gen_struct(), 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(), marshal_generator::gen_union_default(), GeneratorBase::generate_union_field(), GeneratorBase::generateAssign(), generateCaseBody(), GeneratorBase::generateCopyCtor(), GeneratorBase::generateEqual(), GeneratorBase::generateReset(), getWrapper(), GeneratorBase::map_type(), GeneratorBase::GenerateUnionAccessors::operator()(), operator<<(), to_cxx_type(), type_to_default(), Cxx11Generator::union_accessors(), Cxx11Generator::union_activate(), and Cxx11Generator::union_reset().

405  {
406  type = resolveActualType(type);
407  switch (type->node_type()) {
408  case AST_Decl::NT_pre_defined: {
409  AST_PredefinedType* p = dynamic_cast<AST_PredefinedType*>(type);
410  switch (p->pt()) {
411  case AST_PredefinedType::PT_any:
412  case AST_PredefinedType::PT_object:
413  return CL_UNKNOWN;
414  case AST_PredefinedType::PT_wchar:
415  return CL_SCALAR | CL_PRIMITIVE | CL_WIDE;
416  default:
417  return CL_SCALAR | CL_PRIMITIVE;
418  }
419  }
420  case AST_Decl::NT_array:
421  return CL_ARRAY;
422  case AST_Decl::NT_union:
423  return CL_UNION;
424  case AST_Decl::NT_string:
425  case AST_Decl::NT_wstring:
426  return CL_SCALAR | CL_STRING |
427  ((dynamic_cast<AST_String*>(type)->max_size()->ev()->u.ulval == 0)
428  ? 0 : CL_BOUNDED) |
429  ((type->node_type() == AST_Decl::NT_wstring) ? CL_WIDE : 0);
430  case AST_Decl::NT_sequence:
431  return CL_SEQUENCE |
432  ((dynamic_cast<AST_Sequence*>(type)->unbounded()) ? 0 : CL_BOUNDED);
433  case AST_Decl::NT_struct:
434  return CL_STRUCTURE;
435  case AST_Decl::NT_enum:
436  return CL_SCALAR | CL_ENUM;
437  case AST_Decl::NT_interface:
438  return CL_INTERFACE;
439 #ifdef ACE_HAS_CDR_FIXED
440  case AST_Decl::NT_fixed:
441  return CL_FIXED;
442 #endif
443  default:
444  return CL_UNKNOWN;
445  }
446  }
const Classification CL_ARRAY
const Classification CL_UNKNOWN
const Classification CL_INTERFACE
const Classification CL_FIXED
const Classification CL_UNION
const Classification CL_STRUCTURE
AST_Type * resolveActualType(AST_Type *element)
const Classification CL_PRIMITIVE
const Classification CL_STRING
const Classification CL_ENUM
const Classification CL_BOUNDED
const Classification CL_SEQUENCE
const Classification CL_SCALAR
const Classification CL_WIDE

◆ resolveActualType()

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

Definition at line 355 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(), metaclass_generator::gen_struct(), 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(), GeneratorBase::generate_union_field(), GeneratorBase::generateAssign(), generateCaseBody(), GeneratorBase::generateCopyCtor(), GeneratorBase::generateEqual(), GeneratorBase::generateReset(), generateSwitchForUnion(), GeneratorBase::map_type(), NestedForLoops::NestedForLoops(), GeneratorBase::GenerateUnionAccessors::operator()(), to_cxx_type(), type_to_default(), Cxx11Generator::union_accessors(), Cxx11Generator::union_activate(), and Cxx11Generator::union_reset().

356  {
357  if (element->node_type() == AST_Decl::NT_typedef) {
358  AST_Typedef* td = dynamic_cast<AST_Typedef*>(element);
359  return td->primitive_base_type();
360  }
361 
362  switch(element->node_type()) {
363  case AST_Decl::NT_interface_fwd:
364  {
365  AST_InterfaceFwd* td = dynamic_cast<AST_InterfaceFwd*>(element);
366  return td->full_definition();
367  }
368  case AST_Decl::NT_valuetype_fwd:
369  {
370  AST_ValueTypeFwd* td = dynamic_cast<AST_ValueTypeFwd*>(element);
371  return td->full_definition();
372  }
373  case AST_Decl::NT_union_fwd:
374  {
375  AST_UnionFwd* td = dynamic_cast<AST_UnionFwd*>(element);
376  return td->full_definition();
377  }
378  case AST_Decl::NT_struct_fwd:
379  {
380  AST_StructureFwd* td = dynamic_cast<AST_StructureFwd*>(element);
381  return td->full_definition();
382  }
383  case AST_Decl::NT_component_fwd:
384  {
385  AST_ComponentFwd* td = dynamic_cast<AST_ComponentFwd*>(element);
386  return td->full_definition();
387  }
388  case AST_Decl::NT_eventtype_fwd:
389  {
390  AST_EventTypeFwd* td = dynamic_cast<AST_EventTypeFwd*>(element);
391  return td->full_definition();
392  }
393  default:
394  return element;
395  }
396  }

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 401 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