CMS 3D CMS Logo

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

Public Member Functions

 DeleteBuffer (ContainerSchema &contSchema)
 
size_t flush ()
 
void registerForDelete (int oid)
 
 ~DeleteBuffer ()
 

Private Attributes

std::vector< int > m_buffer
 
std::auto_ptr< RelationalDeleterm_depDeleter
 
std::auto_ptr< RelationalDeleterm_mainDeleter
 
RelationalBuffer m_operationBuffer
 

Detailed Description

Definition at line 207 of file DatabaseContainer.cc.

Constructor & Destructor Documentation

ora::DeleteBuffer::DeleteBuffer ( ContainerSchema contSchema)
inlineexplicit

Definition at line 209 of file DatabaseContainer.cc.

References m_depDeleter, m_mainDeleter, m_operationBuffer, ora::ContainerSchema::mapping(), ora::ContainerSchema::mappingForDependentClasses(), and ora::MappingTree::topElement().

209  :
210  m_buffer(),
211  m_operationBuffer( contSchema.storageSchema() ),
212  m_mainDeleter(),
213  m_depDeleter(){
214  m_mainDeleter.reset( new RelationalDeleter( contSchema.mapping().topElement() ));
216 
217  std::vector<MappingElement> dependentMappings;
218  contSchema.mappingForDependentClasses( dependentMappings );
219  m_depDeleter.reset( new RelationalDeleter( dependentMappings ) );
221  dependentMappings.clear();
222  }
std::vector< int > m_buffer
std::auto_ptr< RelationalDeleter > m_depDeleter
RelationalBuffer m_operationBuffer
std::auto_ptr< RelationalDeleter > m_mainDeleter
ora::DeleteBuffer::~DeleteBuffer ( )
inline

Definition at line 224 of file DatabaseContainer.cc.

224  {
225  }

Member Function Documentation

size_t ora::DeleteBuffer::flush ( )
inline

Definition at line 232 of file DatabaseContainer.cc.

References ora::RelationalBuffer::flush(), m_buffer, m_depDeleter, m_mainDeleter, and m_operationBuffer.

232  {
233  size_t nobj = 0;
234  for( std::vector<int>::const_iterator iD = m_buffer.begin();
235  iD != m_buffer.end(); ++iD ){
236  m_depDeleter->erase( *iD );
237  m_mainDeleter->erase( *iD );
238  if( m_operationBuffer.flush() ) nobj++;
239  }
240  m_buffer.clear();
241  return nobj;
242  }
std::vector< int > m_buffer
std::auto_ptr< RelationalDeleter > m_depDeleter
RelationalBuffer m_operationBuffer
std::auto_ptr< RelationalDeleter > m_mainDeleter
void ora::DeleteBuffer::registerForDelete ( int  oid)
inline

Definition at line 228 of file DatabaseContainer.cc.

References m_buffer.

228  {
229  m_buffer.push_back( oid );
230  }
std::vector< int > m_buffer

Member Data Documentation

std::vector<int> ora::DeleteBuffer::m_buffer
private

Definition at line 245 of file DatabaseContainer.cc.

Referenced by flush(), and registerForDelete().

std::auto_ptr<RelationalDeleter> ora::DeleteBuffer::m_depDeleter
private

Definition at line 248 of file DatabaseContainer.cc.

Referenced by DeleteBuffer(), and flush().

std::auto_ptr<RelationalDeleter> ora::DeleteBuffer::m_mainDeleter
private

Definition at line 247 of file DatabaseContainer.cc.

Referenced by DeleteBuffer(), and flush().

RelationalBuffer ora::DeleteBuffer::m_operationBuffer
private

Definition at line 246 of file DatabaseContainer.cc.

Referenced by DeleteBuffer(), and flush().