CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
ora::RelationalMapping Namespace Reference

Functions

void _sizeInColumns (const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
 
void _sizeInColumnsForCArray (const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
 
size_t sizeInColumns (const edm::TypeWithDict &topLevelClassType)
 
std::pair< bool, size_t > sizeInColumnsForCArray (const edm::TypeWithDict &arrayType)
 

Function Documentation

void ora::RelationalMapping::_sizeInColumns ( const edm::TypeWithDict typ,
size_t &  sz,
bool &  hasDependencies 
)

Definition at line 32 of file RelationalMapping.cc.

References _sizeInColumnsForCArray(), edm::TypeWithDict::hasBase(), edm::TypeWithDict::isArray(), edm::MemberWithDict::isTransient(), ora::ClassUtils::isTypeAssociativeContainer(), ora::ClassUtils::isTypeNamedReference(), ora::ClassUtils::isTypeNonAssociativeContainer(), ora::ClassUtils::isTypeOraPointer(), ora::ClassUtils::isTypePrimitive(), ora::ClassUtils::isTypeUniqueReference(), ora::ClassUtils::resolvedType(), and edm::MemberWithDict::typeOf().

Referenced by _sizeInColumnsForCArray(), and sizeInColumns().

34  {
35  // resolve possible typedef chains
36  edm::TypeWithDict typ = ClassUtils::resolvedType( topLevelClassType );
37  bool isOraPolyPointer = ora::ClassUtils::isTypeUniqueReference(typ);
38  bool isPrimitive = ora::ClassUtils::isTypePrimitive( typ );
39 
40  // primitive and string
41  if( isPrimitive || isOraPolyPointer || ora::ClassUtils::isTypeNamedReference( typ)) {
42  ++sz;
43  } else if (typ.isArray()){
44  size_t arraySize = 0;
45  _sizeInColumnsForCArray( typ,arraySize, hasDependencies );
46  if( arraySize < MappingRules::MaxColumnsForInlineCArray ) sz += arraySize;
47  else hasDependencies = true;
48  } else if (typ == typeid(ora::Reference) ||
49  typ.hasBase( edm::TypeWithDict( typeid(ora::Reference) ) )){
50  sz += 2;
51  } else {
52 
53  bool isContainer = ora::ClassUtils::isTypeNonAssociativeContainer(typ) ||
55  bool isOraPointer = ora::ClassUtils::isTypeOraPointer(typ);
56  if( !isContainer && !isOraPointer ){
57 
58  // loop over the data members
59  //-ap ignore for now: typ.UpdateMembers();
60  //std::vector<edm::TypeWithDict> carrays;
61  edm::TypeDataMembers members(typ);
62  for (auto const & member : members) {
63  edm::MemberWithDict objMember(member);
64 
65  // Skip the transient ones
66  if ( objMember.isTransient() ) continue;
67 
68  // Retrieve the field type
69  edm::TypeWithDict objMemberType = objMember.typeOf();
70 
71  _sizeInColumns(objMemberType,sz, hasDependencies );
72  }
73  } else {
74  hasDependencies = true;
75  }
76  }
77 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:486
void _sizeInColumns(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
bool isTypeNamedReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:339
bool hasBase(std::string const &) const
bool isTypePrimitive(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:221
bool isTypeOraPointer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:323
bool isArray() const
bool isTypeNonAssociativeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:301
bool isTypeUniqueReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:343
void _sizeInColumnsForCArray(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
bool isTypeAssociativeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:286
void ora::RelationalMapping::_sizeInColumnsForCArray ( const edm::TypeWithDict typ,
size_t &  sz,
bool &  hasDependencies 
)

Definition at line 80 of file RelationalMapping.cc.

References _sizeInColumns(), ora::ClassUtils::arrayLength(), edm::TypeWithDict::isArray(), ora::ClassUtils::resolvedType(), and edm::TypeWithDict::toType().

Referenced by _sizeInColumns(), and sizeInColumnsForCArray().

82  {
83  // resolve possible typedef chains
84  edm::TypeWithDict typ = ClassUtils::resolvedType( topLevelClassType );
85  if( !typ.isArray()){
86  return;
87  }
88 
89  size_t arraySize = ClassUtils::arrayLength( typ );
90  edm::TypeWithDict arrayType = typ.toType();
91  size_t arrayElementSize = 0;
92  _sizeInColumns(arrayType, arrayElementSize, hasDependencies);
93  size_t totSize = arraySize*arrayElementSize;
94  sz += totSize;
95 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:486
void _sizeInColumns(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
TypeWithDict toType() const
bool isArray() const
size_t arrayLength(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:493
size_t ora::RelationalMapping::sizeInColumns ( const edm::TypeWithDict topLevelClassType)

Definition at line 15 of file RelationalMapping.cc.

References _sizeInColumns().

Referenced by ora::MappingGenerator::createNewDependentMapping(), and ora::MappingGenerator::createNewMapping().

15  {
16  size_t sz=0;
17  bool hasDependencies = false;
18  _sizeInColumns(topLevelClassType, sz, hasDependencies );
19  return sz;
20 }
void _sizeInColumns(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
std::pair< bool, size_t > ora::RelationalMapping::sizeInColumnsForCArray ( const edm::TypeWithDict arrayType)

Definition at line 23 of file RelationalMapping.cc.

References _sizeInColumnsForCArray().

Referenced by ora::CArrayMapping::process().

23  {
24  size_t sz=0;
25  bool hasDependencies = false;
26  _sizeInColumnsForCArray(topLevelClassType, sz, hasDependencies );
27  return std::make_pair(hasDependencies,sz);
28 }
void _sizeInColumnsForCArray(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)