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 Reflex::Type &typ, size_t &sz, bool &hasDependencies)
 
void _sizeInColumnsForCArray (const Reflex::Type &typ, size_t &sz, bool &hasDependencies)
 
size_t sizeInColumns (const Reflex::Type &topLevelClassType)
 
std::pair< bool, size_t > sizeInColumnsForCArray (const Reflex::Type &arrayType)
 

Function Documentation

void ora::RelationalMapping::_sizeInColumns ( const Reflex::Type &  typ,
size_t &  sz,
bool &  hasDependencies 
)

Definition at line 31 of file RelationalMapping.cc.

References _sizeInColumnsForCArray(), i, ora::ClassUtils::isTypeAssociativeContainer(), ora::ClassUtils::isTypeNamedReference(), ora::ClassUtils::isTypeNonAssociativeContainer(), ora::ClassUtils::isTypeOraPointer(), ora::ClassUtils::isTypePrimitive(), ora::ClassUtils::isTypeUniqueReference(), and ora::ClassUtils::resolvedType().

Referenced by _sizeInColumnsForCArray(), and sizeInColumns().

33  {
34  // resolve possible typedef chains
35  Reflex::Type typ = ClassUtils::resolvedType( topLevelClassType );
36  bool isOraPolyPointer = ora::ClassUtils::isTypeUniqueReference(typ);
37  bool isPrimitive = ora::ClassUtils::isTypePrimitive( typ );
38 
39  // primitive and string
40  if( isPrimitive || isOraPolyPointer || ora::ClassUtils::isTypeNamedReference( typ)) {
41  ++sz;
42  } else if (typ.IsArray()){
43  size_t arraySize = 0;
44  _sizeInColumnsForCArray( typ,arraySize, hasDependencies );
45  if( arraySize < MappingRules::MaxColumnsForInlineCArray ) sz += arraySize;
46  else hasDependencies = true;
47  } else if (typ.TypeInfo() == typeid(ora::Reference) ||
48  typ.HasBase( Reflex::Type::ByTypeInfo( typeid(ora::Reference) ) )){
49  sz += 2;
50  } else {
51 
52  bool isContainer = ora::ClassUtils::isTypeNonAssociativeContainer(typ) ||
54  bool isOraPointer = ora::ClassUtils::isTypeOraPointer(typ);
55  if( !isContainer && !isOraPointer ){
56 
57  // loop over the data members
58  typ.UpdateMembers();
59  //std::vector<Reflex::Type> carrays;
60  for ( size_t i=0; i< typ.DataMemberSize(); i++){
61  Reflex::Member objMember = typ.DataMemberAt(i);
62 
63  // Skip the transient ones
64  if ( objMember.IsTransient() ) continue;
65 
66  // Retrieve the field type
67  Reflex::Type objMemberType = objMember.TypeOf();
68 
69  _sizeInColumns(objMemberType,sz, hasDependencies );
70  }
71  } else {
72  hasDependencies = true;
73  }
74  }
75 }
bool isTypeOraPointer(const Reflex::Type &typ)
Definition: ClassUtils.cc:250
int i
Definition: DBlmapReader.cc:9
bool isTypeAssociativeContainer(const Reflex::Type &typ)
Definition: ClassUtils.cc:211
void _sizeInColumnsForCArray(const Reflex::Type &typ, size_t &sz, bool &hasDependencies)
bool isTypeUniqueReference(const Reflex::Type &typ)
Definition: ClassUtils.cc:271
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
bool isTypePrimitive(const Reflex::Type &typ)
Definition: ClassUtils.cc:143
bool isTypeNamedReference(const Reflex::Type &typ)
Definition: ClassUtils.cc:267
void _sizeInColumns(const Reflex::Type &typ, size_t &sz, bool &hasDependencies)
bool isTypeNonAssociativeContainer(const Reflex::Type &typ)
Definition: ClassUtils.cc:227
void ora::RelationalMapping::_sizeInColumnsForCArray ( const Reflex::Type &  typ,
size_t &  sz,
bool &  hasDependencies 
)

Definition at line 78 of file RelationalMapping.cc.

References _sizeInColumns(), and ora::ClassUtils::resolvedType().

Referenced by _sizeInColumns(), and sizeInColumnsForCArray().

80  {
81  // resolve possible typedef chains
82  Reflex::Type typ = ClassUtils::resolvedType( topLevelClassType );
83  if( !typ.IsArray()){
84  return;
85  }
86 
87  size_t arraySize = typ.ArrayLength();
88  Reflex::Type arrayType = typ.ToType();
89  size_t arrayElementSize = 0;
90  _sizeInColumns(arrayType, arrayElementSize, hasDependencies);
91  size_t totSize = arraySize*arrayElementSize;
92  sz += totSize;
93 }
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
void _sizeInColumns(const Reflex::Type &typ, size_t &sz, bool &hasDependencies)
size_t ora::RelationalMapping::sizeInColumns ( const Reflex::Type &  topLevelClassType)

Definition at line 14 of file RelationalMapping.cc.

References _sizeInColumns().

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

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

Definition at line 22 of file RelationalMapping.cc.

References _sizeInColumnsForCArray().

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

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