CMS 3D CMS Logo

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

#include <InlineCArrayStreamer.h>

Inheritance diagram for ora::InlineCArrayStreamerBase:
ora::InlineCArrayReader ora::InlineCArrayUpdater ora::InlineCArrayWriter

Public Member Functions

bool buildDataElement (DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer *operationBuffer)
 
 InlineCArrayStreamerBase (const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 
virtual void processArrayElement (DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)=0
 
virtual ~InlineCArrayStreamerBase ()
 

Protected Attributes

edm::TypeWithDict m_arrayType
 
edm::TypeWithDict m_objectType
 
RelationalStreamerFactory m_streamerFactory
 

Private Attributes

MappingElementm_mapping
 

Detailed Description

Definition at line 15 of file InlineCArrayStreamer.h.

Constructor & Destructor Documentation

ora::InlineCArrayStreamerBase::InlineCArrayStreamerBase ( const edm::TypeWithDict objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 12 of file InlineCArrayStreamer.cc.

14  :
15  m_objectType( objectType ),
16  m_arrayType(),
17  m_streamerFactory( contSchema ),
18  m_mapping( mapping ){
19 }
RelationalStreamerFactory m_streamerFactory
ora::InlineCArrayStreamerBase::~InlineCArrayStreamerBase ( )
virtual

Definition at line 21 of file InlineCArrayStreamer.cc.

21  {
22 }

Member Function Documentation

bool ora::InlineCArrayStreamerBase::buildDataElement ( DataElement dataElement,
IRelationalData relationalData,
RelationalBuffer operationBuffer 
)

Definition at line 25 of file InlineCArrayStreamer.cc.

References ora::DataElement::addChild(), i, ora::ClassUtils::resolvedType(), AlCaHLTBitMon_QueryRunRegistry::string, ora::throwException(), and ora::MappingRules::variableNameForArrayIndex().

27  {
29  if ( ! m_arrayType ) {
30  throwException( "Missing dictionary information for the element of array \"" +
31  m_objectType.cppName() + "\"",
32  "InlineCArrayStreamerBase::buildDataElement" );
33  }
34  // Loop over the elements of the array.
35  for ( size_t i=0;i<m_objectType.maximumIndex(0U);++i){
36 
37  // Form the element name
39 
40  // Retrieve the relevant mapping element
41  MappingElement::iterator iMe = m_mapping.find( arrayElementLabel );
42  if ( iMe == m_mapping.end() ) {
43  throwException( "Mapping for Array Element \"" + arrayElementLabel + "\" not found in the mapping element",
44  "InlineCArrayStreamerBase::buildDataElement" );
45  }
46  MappingElement& arrayElementMapping = iMe->second;
47  DataElement& arrayElement = dataElement.addChild( i*m_arrayType.size(), 0 );
48 
49  processArrayElement( arrayElement, relationalData, arrayElementMapping, operationBuffer );
50  }
51  return true;
52 }
int i
Definition: DBlmapReader.cc:9
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:483
size_t maximumIndex(size_t dim) const
static std::string variableNameForArrayIndex(const std::string &arrayVariable, unsigned int index)
const std::string & variableName() const
TypeWithDict toType() const
virtual void processArrayElement(DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)=0
std::string cppName() const
iterator find(const std::string &key)
Retrieves a sub-element.
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
size_t size() const
iterator end()
Returns an iterator in the end of the sequence.
virtual void ora::InlineCArrayStreamerBase::processArrayElement ( DataElement arrayElementOffset,
IRelationalData relationalData,
MappingElement arrayElementMapping,
RelationalBuffer operationBuffer 
)
pure virtual

Member Data Documentation

edm::TypeWithDict ora::InlineCArrayStreamerBase::m_arrayType
protected

Definition at line 30 of file InlineCArrayStreamer.h.

MappingElement& ora::InlineCArrayStreamerBase::m_mapping
private

Definition at line 34 of file InlineCArrayStreamer.h.

edm::TypeWithDict ora::InlineCArrayStreamerBase::m_objectType
protected

Definition at line 29 of file InlineCArrayStreamer.h.

RelationalStreamerFactory ora::InlineCArrayStreamerBase::m_streamerFactory
protected

Definition at line 31 of file InlineCArrayStreamer.h.