9 #include "CoralBase/Attribute.h"
15 m_objectType( objectType ),
17 m_streamerFactory( contSchema ),
29 if ( ! m_arrayType ) {
30 throwException(
"Missing dictionary information for the element of array \"" +
31 m_objectType.Name(Reflex::SCOPED) +
"\"",
32 "InlineCArrayStreamerBase::buildDataElement" );
35 for (
unsigned int i=0;
i<m_objectType.ArrayLength();
i++){
42 if ( iMe == m_mapping.end() ) {
43 throwException(
"Mapping for Array Element \"" + arrayElementLabel +
"\" not found in the mapping element",
44 "InlineCArrayStreamerBase::buildDataElement" );
49 processArrayElement( arrayElement, relationalData, arrayElementMapping, operationBuffer );
62 for( std::vector< IRelationalWriter* >::iterator iW = m_writers.begin();
63 iW != m_writers.end(); ++iW ){
73 IRelationalWriter* arrayElementWriter = m_streamerFactory.newWriter( m_arrayType, arrayElementMapping );
74 m_writers.push_back( arrayElementWriter );
75 arrayElementWriter->
build( arrayElementOffset, relationalData, *operationBuffer );
81 return buildDataElement( dataElement, relationalData, &operationBuffer );
85 for( std::vector< IRelationalWriter* >::iterator iW = m_writers.begin();
86 iW != m_writers.end(); ++iW ){
87 (*iW)->setRecordId( identity );
92 for( std::vector< IRelationalWriter* >::iterator iW = m_writers.begin();
93 iW != m_writers.end(); ++iW ){
94 (*iW)->write( oid, data );
106 for( std::vector< IRelationalUpdater* >::iterator iU = m_updaters.begin();
107 iU != m_updaters.end(); ++iU ){
117 IRelationalUpdater* arrayElementUpdater = m_streamerFactory.newUpdater( m_arrayType, arrayElementMapping );
118 m_updaters.push_back( arrayElementUpdater );
119 arrayElementUpdater->
build( arrayElementOffset, relationalData, *operationBuffer );
125 return buildDataElement( dataElement, relationalData, &operationBuffer );
129 for( std::vector< IRelationalUpdater* >::iterator iU = m_updaters.begin();
130 iU != m_updaters.end(); ++iU){
131 (*iU)->setRecordId( identity );
137 for( std::vector< IRelationalUpdater* >::iterator iU = m_updaters.begin();
138 iU != m_updaters.end(); ++iU ){
139 (*iU)->update( oid, data );
151 for( std::vector< IRelationalReader* >::iterator iStr = m_readers.begin();
152 iStr != m_readers.end(); ++iStr ){
162 IRelationalReader* arrayElementReader = m_streamerFactory.newReader( m_arrayType, arrayElementMapping );
163 m_readers.push_back( arrayElementReader );
164 arrayElementReader->
build( arrayElementOffset, relationalData );
169 return buildDataElement( dataElement, relationalData, 0 );
173 for( std::vector< IRelationalReader* >::iterator iDepReader = m_readers.begin();
174 iDepReader != m_readers.end(); ++iDepReader ){
175 (*iDepReader)->select( oid );
180 for( std::vector< IRelationalReader* >::iterator iDepReader = m_readers.begin();
181 iDepReader != m_readers.end(); ++iDepReader ){
182 (*iDepReader)->setRecordId( identity );
187 for( std::vector< IRelationalReader* >::iterator iDepReader = m_readers.begin();
188 iDepReader != m_readers.end(); ++iDepReader ){
189 (*iDepReader)->read( data );
194 for( std::vector< IRelationalReader* >::iterator iDepReader = m_readers.begin();
195 iDepReader != m_readers.end(); ++iDepReader ){
196 (*iDepReader)->clear();
203 m_objectType( objectType ),
204 m_mapping( mapping ),
void setRecordId(const std::vector< int > &identity)
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
static std::string variableNameForArrayIndex(const std::string &arrayVariable, unsigned int index)
IRelationalReader * newReader()
InlineCArrayReader(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
virtual bool build(DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer)=0
virtual ~InlineCArrayUpdater()
DataElement & addChild(size_t declaringScopeOffset, Reflex::OffsetFunction offsetFunction)
InlineCArrayUpdater(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
InlineCArrayStreamerBase(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
InlineCArrayStreamer(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
bool build(DataElement &dataElement, IRelationalData &relationalData)
void read(void *data)
Reads a data element.
virtual bool build(DataElement &offset, IRelationalData &relationalData)=0
InlineCArrayWriter(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
IRelationalUpdater * newUpdater()
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
void write(int oid, const void *data)
Writes a data element.
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
Reflex::Type resolvedType(const Reflex::Type &typ)
virtual ~InlineCArrayStreamerBase()
bool buildDataElement(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer *operationBuffer)
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
virtual bool build(DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer)=0
virtual ~InlineCArrayWriter()
char data[epos_bytes_allocation]
void update(int oid, const void *data)
Updates a data element.
void processArrayElement(DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)
void setRecordId(const std::vector< int > &identity)
void setRecordId(const std::vector< int > &identity)
void processArrayElement(DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)
void processArrayElement(DataElement &arrayElementOffset, IRelationalData &relationalData, MappingElement &arrayElementMapping, RelationalBuffer *operationBuffer)
IRelationalWriter * newWriter()
virtual ~InlineCArrayReader()