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 Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 
virtual void processArrayElement (DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)=0
 
virtual ~InlineCArrayStreamerBase ()
 

Protected Attributes

Reflex::Type m_arrayType
 
Reflex::Type 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 Reflex::Type &  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.Name(Reflex::SCOPED) + "\"",
32  "InlineCArrayStreamerBase::buildDataElement" );
33  }
34  // Loop over the elements of the array.
35  for ( unsigned int i=0;i<m_objectType.ArrayLength();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.SizeOf(), 0 );
48 
49  processArrayElement( arrayElement, relationalData, arrayElementMapping, operationBuffer );
50  }
51  return true;
52 }
int i
Definition: DBlmapReader.cc:9
static std::string variableNameForArrayIndex(const std::string &arrayVariable, unsigned int index)
const std::string & variableName() const
virtual void processArrayElement(DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)=0
iterator find(const std::string &key)
Retrieves a sub-element.
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
iterator end()
Returns an iterator in the end of the sequence.
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
virtual void ora::InlineCArrayStreamerBase::processArrayElement ( DataElement arrayElementOffset,
IRelationalData relationalData,
MappingElement arrayElementMapping,
RelationalBuffer operationBuffer 
)
pure virtual

Member Data Documentation

Reflex::Type 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.

Reflex::Type 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.