CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Attributes

ora::InlineCArrayStreamerBase Class Reference

#include <InlineCArrayStreamer.h>

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

List of all members.

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.

                                                                                     :
  m_objectType( objectType ),
  m_arrayType(),
  m_streamerFactory( contSchema ),
  m_mapping( mapping ){
}
ora::InlineCArrayStreamerBase::~InlineCArrayStreamerBase ( ) [virtual]

Definition at line 21 of file InlineCArrayStreamer.cc.

                                                      {
}

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(), ora::throwException(), and ora::MappingRules::variableNameForArrayIndex().

                                                                                       {
  m_arrayType = ClassUtils::resolvedType( m_objectType.ToType() );  
  if ( ! m_arrayType ) {
    throwException( "Missing dictionary information for the element of array \"" +
                    m_objectType.Name(Reflex::SCOPED) + "\"",
                    "InlineCArrayStreamerBase::buildDataElement" );
  }
  // Loop over the elements of the array.
  for ( unsigned int i=0;i<m_objectType.ArrayLength();i++){

    // Form the element name
    std::string arrayElementLabel = MappingRules::variableNameForArrayIndex( m_mapping.variableName(),i);

    // Retrieve the relevant mapping element
    MappingElement::iterator iMe = m_mapping.find( arrayElementLabel );
    if ( iMe == m_mapping.end() ) {
      throwException( "Mapping for Array Element \"" + arrayElementLabel + "\" not found in the mapping element",
                      "InlineCArrayStreamerBase::buildDataElement" );
    }
    MappingElement& arrayElementMapping = iMe->second;
    DataElement& arrayElement = dataElement.addChild( i*m_arrayType.SizeOf(), 0 );

    processArrayElement( arrayElement, relationalData, arrayElementMapping, operationBuffer );
  }
  return true;
}
virtual void ora::InlineCArrayStreamerBase::processArrayElement ( DataElement arrayElementOffset,
IRelationalData relationalData,
MappingElement arrayElementMapping,
RelationalBuffer operationBuffer 
) [pure virtual]

Member Data Documentation

Definition at line 30 of file InlineCArrayStreamer.h.

Definition at line 34 of file InlineCArrayStreamer.h.

Definition at line 29 of file InlineCArrayStreamer.h.

Definition at line 31 of file InlineCArrayStreamer.h.