CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::RelationalDeleter Class Reference

#include <RelationalDeleter.h>

List of all members.

Public Member Functions

void build (RelationalBuffer &buffer)
void clear ()
void erase (int itemId)
 RelationalDeleter (const std::vector< MappingElement > &mappingList)
 RelationalDeleter (MappingElement &dataMapping)
virtual ~RelationalDeleter ()
 Destructor.

Private Attributes

std::vector< const
MappingElement * > 
m_mappings
std::vector< DeleteOperation * > m_operations

Detailed Description

Definition at line 12 of file RelationalDeleter.h.


Constructor & Destructor Documentation

ora::RelationalDeleter::RelationalDeleter ( MappingElement dataMapping) [explicit]

Definition at line 9 of file RelationalDeleter.cc.

References m_mappings.

                                                                    :
  m_mappings(),
  m_operations(){
  m_mappings.push_back( &dataMapping );
}
ora::RelationalDeleter::RelationalDeleter ( const std::vector< MappingElement > &  mappingList) [explicit]

Definition at line 15 of file RelationalDeleter.cc.

References m_mappings.

                                                                                     :
  m_mappings(),
  m_operations(){
  for(  std::vector<MappingElement>::const_iterator iMe = mappingList.begin();
        iMe != mappingList.end(); ++iMe ){
    m_mappings.push_back( &(*iMe) );
  } 
}
ora::RelationalDeleter::~RelationalDeleter ( ) [virtual]

Destructor.

Definition at line 24 of file RelationalDeleter.cc.

References hitfit::clear().

                                        {
  clear();
}

Member Function Documentation

void ora::RelationalDeleter::build ( RelationalBuffer buffer)

Definition at line 32 of file RelationalDeleter.cc.

References ora::InputRelationalData::addWhereId(), first, i, ora::RelationalBuffer::newDelete(), and edm::second().

                                                          {
  m_operations.clear();
  for( std::vector<const MappingElement*>::iterator iMe = m_mappings.begin();
       iMe != m_mappings.end(); iMe++  ){
    std::vector<std::pair<std::string,std::string> > tableHierarchy = (*iMe)->tableHierarchy();
    size_t sz = tableHierarchy.size();
    for( size_t i=1; i<sz+1; i++ ){
      DeleteOperation& delOperation = buffer.newDelete( tableHierarchy[sz-i].first, i==sz );
      delOperation.addWhereId( tableHierarchy[sz-i].second );
      m_operations.push_back(&delOperation);      
    }
  }
}
void ora::RelationalDeleter::clear ( void  )

Definition at line 28 of file RelationalDeleter.cc.

                                {
  m_operations.clear();
}
void ora::RelationalDeleter::erase ( int  itemId)

Definition at line 46 of file RelationalDeleter.cc.

                                            {
  for( std::vector<DeleteOperation*>::const_iterator iDel = m_operations.begin();
       iDel != m_operations.end(); ++iDel ){
    coral::AttributeList& whereData = (*iDel)->whereData();
    whereData.begin()->data<int>() = itemId;
  }
}

Member Data Documentation

std::vector<const MappingElement*> ora::RelationalDeleter::m_mappings [private]

Definition at line 29 of file RelationalDeleter.h.

Referenced by RelationalDeleter().

Definition at line 30 of file RelationalDeleter.h.