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::ObjectMapping Class Reference

#include <RelationalMapping.h>

Inheritance diagram for ora::ObjectMapping:
ora::IRelationalMapping

Public Member Functions

 ObjectMapping (const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
 
void process (MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
 
 ~ObjectMapping ()
 
- Public Member Functions inherited from ora::IRelationalMapping
virtual ~IRelationalMapping ()
 

Private Attributes

TableRegisterm_tableRegister
 
edm::TypeWithDict m_type
 

Detailed Description

Definition at line 157 of file RelationalMapping.h.

Constructor & Destructor Documentation

ora::ObjectMapping::ObjectMapping ( const edm::TypeWithDict attributeType,
TableRegister tableRegister 
)

Definition at line 532 of file RelationalMapping.cc.

532  :
533  m_type(attributeType), m_tableRegister( tableRegister ){
534 }
edm::TypeWithDict m_type
TableRegister & m_tableRegister
ora::ObjectMapping::~ObjectMapping ( )

Definition at line 536 of file RelationalMapping.cc.

536  {
537 }

Member Function Documentation

void ora::ObjectMapping::process ( MappingElement parentElement,
const std::string &  attributeName,
const std::string &  attributeNameForSchema,
const std::string &  scopeNameForSchema 
)
virtual

Implements ora::IRelationalMapping.

Definition at line 587 of file RelationalMapping.cc.

References ora::MappingElement::appendSubElement(), className(), ora::MappingElement::columnNames(), edm::MemberWithDict::declaringType(), ora::isLoosePersistencyOnWriting(), ora::isMappedToBlob(), edm::MemberWithDict::isStatic(), edm::MemberWithDict::isTransient(), edm::MemberWithDict::name(), ora::RelationalMappingFactory::newProcessor(), ora::MappingElement::objectMappingElementType(), ora::processBaseClasses(), ora::ClassUtils::resolvedType(), ora::MappingElement::setColumnNames(), AlCaHLTBitMon_QueryRunRegistry::string, ora::MappingElement::tableName(), ora::throwException(), and edm::MemberWithDict::typeOf().

Referenced by ConfigBuilder.ConfigBuilder::__init__(), ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::anyOf(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HARVESTING(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

590  {
593  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, className, parentElement.tableName() );
594  me.setColumnNames( parentElement.columnNames() );
595 
596  // resolve possible typedef chains
598  // process base class data members
599  processBaseClasses( me, m_type, scopeNameForSchema, m_tableRegister );
600  RelationalMappingFactory mappingFactory( m_tableRegister );
601  std::string scope = attributeName;
602  std::string objectScopeNameForSchema = scopeNameForSchema;
603  if( !objectScopeNameForSchema.empty() ) objectScopeNameForSchema +="_";
604  objectScopeNameForSchema += attributeNameForSchema;
605 
606  // loop over the data members
607  edm::TypeDataMembers members(objectType);
608  for (auto const & member : members) {
609  edm::MemberWithDict objectMember(member);
610  // Skip the transient and the static ones
611  if ( objectMember.isTransient() || objectMember.isStatic() || isLoosePersistencyOnWriting( objectMember )) continue;
612 
613  // Retrieve the field type
614  edm::TypeWithDict type = ClassUtils::resolvedType( objectMember.typeOf() );
615  // Check for the existence of the dictionary information
616  if ( !type ){
617  throwException( "Type for data member \""+objectMember.name()+"\" of class \""+className+
618  "\" has not been found in the dictionary.",
619  "ObjectMapping::process");
620  }
621 
622  // check if the member is from a class in the inheritance tree
623  edm::TypeWithDict declaringType = ClassUtils::resolvedType( objectMember.declaringType());
624  if( declaringType != objectType ){
625  continue;
626  }
627  // Retrieve the field name
628  std::string objectMemberName = objectMember.name();
629  std::string objectNameForSchema = objectMember.name();
630 
631  bool blobStreaming = isMappedToBlob( objectMember );
632 
633  std::auto_ptr<IRelationalMapping> processor( mappingFactory.newProcessor( type, blobStreaming ) );
634  processor->process( me, objectMemberName, objectNameForSchema, objectScopeNameForSchema );
635  }
636 
637 }
type
Definition: HCALResponse.h:21
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:483
void processBaseClasses(MappingElement &mappingElement, const edm::TypeWithDict &objType, const std::string &scopeNameForSchema, TableRegister &tableRegister)
edm::TypeWithDict m_type
MappingElement & appendSubElement(const std::string &elementType, const std::string &variableName, const std::string &variableType, const std::string &tableName)
std::string cppName() const
static std::string objectMappingElementType()
Returns the name of the object mapping element type.
bool isMappedToBlob(const edm::MemberWithDict &dataMember)
TableRegister & m_tableRegister
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
bool isLoosePersistencyOnWriting(const edm::MemberWithDict &dataMember)
std::string className(const T &t)
Definition: ClassName.h:30
void setColumnNames(const std::vector< std::string > &columns)

Member Data Documentation

TableRegister& ora::ObjectMapping::m_tableRegister
private

Definition at line 167 of file RelationalMapping.h.

edm::TypeWithDict ora::ObjectMapping::m_type
private

Definition at line 166 of file RelationalMapping.h.