CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::RelationalMappingFactory Class Reference

#include <RelationalMapping.h>

Public Member Functions

IRelationalMappingnewProcessor (const Reflex::Type &attributeType, bool blobStreaming=false)
 
 RelationalMappingFactory (TableRegister &tableRegister)
 
virtual ~RelationalMappingFactory ()
 

Private Attributes

TableRegisterm_tableRegister
 

Detailed Description

Definition at line 35 of file RelationalMapping.h.

Constructor & Destructor Documentation

ora::RelationalMappingFactory::RelationalMappingFactory ( TableRegister tableRegister)
explicit

Definition at line 96 of file RelationalMapping.cc.

96  :
97  m_tableRegister( tableRegister ){
98 }
ora::RelationalMappingFactory::~RelationalMappingFactory ( )
virtual

Definition at line 100 of file RelationalMapping.cc.

100  {
101 }

Member Function Documentation

ora::IRelationalMapping * ora::RelationalMappingFactory::newProcessor ( const Reflex::Type &  attributeType,
bool  blobStreaming = false 
)

Definition at line 103 of file RelationalMapping.cc.

References ora::ClassUtils::isTypeContainer(), ora::ClassUtils::isTypeOraPointer(), ora::ClassUtils::isTypePrimitive(), ora::ClassUtils::isTypeUniqueReference(), and ora::ClassUtils::resolvedType().

Referenced by ora::MappingGenerator::createNewDependentMapping(), ora::MappingGenerator::createNewMapping(), ora::OraPtrMapping::process(), ora::ArrayMapping::process(), ora::CArrayMapping::process(), ora::ObjectMapping::process(), and ora::processBaseClasses().

104  {
105  if( blobStreaming ){
106  return new BlobMapping( attributeType, m_tableRegister );
107  }
108  Reflex::Type resType = ClassUtils::resolvedType( attributeType );
109  if ( ora::ClassUtils::isTypePrimitive(resType) ) {
110  return new PrimitiveMapping( attributeType, m_tableRegister );
111  }
112  else if ( resType.IsArray() ){
113  return new CArrayMapping( attributeType, m_tableRegister );
114  }
115  else if ( ora::ClassUtils::isTypeContainer( resType ) ) {
116  return new ArrayMapping( attributeType, m_tableRegister );
117  }
118  else if ( resType.IsPointer() || resType.IsReference() ){
119  return new EmptyMapping();
120  }
121  else if ( ora::ClassUtils::isTypeOraPointer( resType )){
122  return new OraPtrMapping( attributeType, m_tableRegister );
123  }
124  else if ( ora::ClassUtils::isTypeUniqueReference( resType )){
125  return new UniqueReferenceMapping( attributeType, m_tableRegister );
126  }
127  else if ( resType.TypeInfo() == typeid(ora::Reference) ||
128  resType.HasBase( Reflex::Type::ByTypeInfo( typeid(ora::Reference) ) ) ){
129  return new OraReferenceMapping( attributeType, m_tableRegister );
130  }
131  else if ( resType.TypeInfo() == typeid(ora::NamedReference) ||
132  resType.HasBase( Reflex::Type::ByTypeInfo( typeid(ora::NamedReference) ) ) ){
133  return new NamedRefMapping( attributeType, m_tableRegister );
134  }
135  else { // embeddedobject
136  return new ObjectMapping( attributeType, m_tableRegister );
137  }
138 }
bool isTypeOraPointer(const Reflex::Type &typ)
Definition: ClassUtils.cc:250
bool isTypeUniqueReference(const Reflex::Type &typ)
Definition: ClassUtils.cc:271
bool isTypeContainer(const Reflex::Type &typ)
Definition: ClassUtils.cc:147
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
bool isTypePrimitive(const Reflex::Type &typ)
Definition: ClassUtils.cc:143

Member Data Documentation

TableRegister& ora::RelationalMappingFactory::m_tableRegister
private

Definition at line 44 of file RelationalMapping.h.