Writes a data element.
128 "STLContainerWriter::write");
133 throwException(
"Object id elements provided are not matching with the mapped id columns.",
134 "STLContainerWriter::write");
141 Reflex::Member firstMember;
142 Reflex::Member secondMember;
144 firstMember = iteratorReturnType.MemberByName(
"first" );
145 if ( ! firstMember ) {
146 throwException(
"Could not find the data member \"first\" for the class \"" +
147 iteratorReturnType.Name(Reflex::SCOPED) +
"\"",
148 "STLContainerWriter::write" );
150 secondMember = iteratorReturnType.MemberByName(
"second" );
151 if ( ! secondMember ) {
152 throwException(
"Could not retrieve the data member \"second\" for the class \"" +
153 iteratorReturnType.Name(Reflex::SCOPED) +
"\"",
154 "STLContainerWriter::write" );
163 if ( containerSize == 0 )
return;
165 size_t startElementIndex =
m_arrayHandler->startElementIndex( data );
166 std::auto_ptr<IArrayIteratorHandler> iteratorHandler(
m_arrayHandler->iterate( data ) );
170 for (
size_t iIndex = startElementIndex; iIndex < containerSize; ++iIndex ) {
175 dataBuff[ columns[0] ].data<
int>() = oid;
176 for(
size_t i = 1;
i < columns.size();
i++ ){
180 void* objectReference = iteratorHandler->object();
181 void* componentData = objectReference;
184 void* keyData =
static_cast< char*
>( objectReference ) + firstMember.Offset();
188 componentData =
static_cast< char*
>( objectReference ) + secondMember.Offset();
193 bulkInsert.processNextIteration();
196 iteratorHandler->increment();
void * address(const void *topLevelAddress) const
std::vector< int > m_recordId
std::auto_ptr< IRelationalWriter > m_keyWriter
Reflex::Type m_objectType
coral::AttributeList & data()
MultiRecordInsertOperation * m_insertOperation
std::auto_ptr< IRelationalWriter > m_dataWriter
const std::vector< std::string > & columnNames() const
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
char data[epos_bytes_allocation]
InsertCache & setUp(int rowCacheSize)
MappingElement & m_mappingElement
std::auto_ptr< IArrayHandler > m_arrayHandler