test
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::RelationalBuffer Class Reference

#include <RelationalBuffer.h>

Public Member Functions

RelationalBufferaddVolatileBuffer ()
 
void clear ()
 
bool flush ()
 
BulkInsertOperationnewBulkInsert (const std::string &tableName)
 
DeleteOperationnewDelete (const std::string &tableName, bool addToResult=false)
 
InsertOperationnewInsert (const std::string &tableName)
 
MultiRecordInsertOperationnewMultiRecordInsert (const std::string &tableName)
 
UpdateOperationnewUpdate (const std::string &tableName, bool addToResult=false)
 
 RelationalBuffer (coral::ISchema &schema)
 
void storeBlob (boost::shared_ptr< coral::Blob > blob)
 
virtual ~RelationalBuffer ()
 

Private Attributes

std::vector< boost::shared_ptr
< coral::Blob > > 
m_blobBuffer
 
std::vector< std::pair
< IRelationalOperation *, bool > > 
m_operations
 
coral::ISchema & m_schema
 
std::vector< RelationalBuffer * > m_volatileBuffers
 

Detailed Description

Definition at line 25 of file RelationalBuffer.h.

Constructor & Destructor Documentation

ora::RelationalBuffer::RelationalBuffer ( coral::ISchema &  schema)
explicit

Definition at line 5 of file RelationalBuffer.cc.

5  :
6  m_schema( schema ),
7  m_operations(),
9  m_blobBuffer(){
10 }
std::vector< boost::shared_ptr< coral::Blob > > m_blobBuffer
coral::ISchema & m_schema
tuple schema
Definition: dataDML.py:2334
std::vector< RelationalBuffer * > m_volatileBuffers
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
ora::RelationalBuffer::~RelationalBuffer ( )
virtual

Definition at line 12 of file RelationalBuffer.cc.

References hitfit::clear().

12  {
13  clear();
14 }

Member Function Documentation

ora::RelationalBuffer & ora::RelationalBuffer::addVolatileBuffer ( )

Definition at line 49 of file RelationalBuffer.cc.

49  {
50  RelationalBuffer* newBuffer = new RelationalBuffer( m_schema );
51  m_volatileBuffers.push_back( newBuffer );
52  return *newBuffer;
53 }
coral::ISchema & m_schema
RelationalBuffer(coral::ISchema &schema)
std::vector< RelationalBuffer * > m_volatileBuffers
void ora::RelationalBuffer::clear ( void  )

Definition at line 59 of file RelationalBuffer.cc.

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

59  {
60  for( std::vector< std::pair<IRelationalOperation*,bool> >::const_iterator iOp = m_operations.begin();
61  iOp != m_operations.end(); ++iOp ){
62  delete iOp->first;
63  }
64  m_operations.clear();
65  for( std::vector<RelationalBuffer*>::const_iterator iV = m_volatileBuffers.begin() ;
66  iV != m_volatileBuffers.end(); ++iV ){
67  delete *iV;
68  }
69  m_volatileBuffers.clear();
70  m_blobBuffer.clear();
71 }
std::vector< boost::shared_ptr< coral::Blob > > m_blobBuffer
std::vector< RelationalBuffer * > m_volatileBuffers
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
bool ora::RelationalBuffer::flush ( )

Definition at line 73 of file RelationalBuffer.cc.

References cmsIgProf_Analysis::execute(), convertSQLiteXML::ok, reset(), and runTheMatrix::ret.

73  {
74  bool ret = true;
75  bool go = true;
76  std::vector< std::pair<IRelationalOperation*,bool> >::const_iterator iOp = m_operations.begin();
77  if( iOp != m_operations.end() ){
78  bool ok = (iOp->first)->execute();
79  go = ok || !(iOp->first)->isRequired();
80  ret = ret && (ok || !iOp->second);
81  iOp++;
82  }
83  for( ; iOp != m_operations.end(); ++iOp ){
84  if( go ){
85  bool ok = (iOp->first)->execute();
86  go = ok || !(iOp->first)->isRequired();
87  ret = ret && (ok || !iOp->second);
88  } else {
89  (iOp->first)->reset();
90  }
91  }
92  for( std::vector<RelationalBuffer*>::iterator iV = m_volatileBuffers.begin() ;
93  iV != m_volatileBuffers.end(); ++iV ){
94  (*iV)->flush();
95  delete *iV;
96  }
97  m_volatileBuffers.clear();
98  m_blobBuffer.clear();
99  return ret;
100 }
tuple ret
prodAgent to be discontinued
std::vector< boost::shared_ptr< coral::Blob > > m_blobBuffer
std::vector< RelationalBuffer * > m_volatileBuffers
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
void reset(double vett[256])
Definition: TPedValues.cc:11
ora::BulkInsertOperation & ora::RelationalBuffer::newBulkInsert ( const std::string &  tableName)

Definition at line 22 of file RelationalBuffer.cc.

22  {
23  BulkInsertOperation* newOperation = new BulkInsertOperation( tableName, m_schema );
24  m_operations.push_back( std::make_pair(newOperation,false) );
25  return *newOperation;
26 }
coral::ISchema & m_schema
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
ora::DeleteOperation & ora::RelationalBuffer::newDelete ( const std::string &  tableName,
bool  addToResult = false 
)

Definition at line 41 of file RelationalBuffer.cc.

Referenced by ora::RelationalDeleter::build(), and ora::deleteArrayElements().

42  {
43  DeleteOperation* newOperation = new DeleteOperation( tableName, m_schema );
44  m_operations.push_back( std::make_pair(newOperation,addToResult) );
45  return *newOperation;
46 }
coral::ISchema & m_schema
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
ora::InsertOperation & ora::RelationalBuffer::newInsert ( const std::string &  tableName)

Definition at line 16 of file RelationalBuffer.cc.

Referenced by ora::DependentClassWriter::build().

16  {
17  InsertOperation* newOperation = new InsertOperation( tableName, m_schema );
18  m_operations.push_back( std::make_pair(newOperation,false) );
19  return *newOperation;
20 }
coral::ISchema & m_schema
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
ora::MultiRecordInsertOperation & ora::RelationalBuffer::newMultiRecordInsert ( const std::string &  tableName)

Definition at line 28 of file RelationalBuffer.cc.

Referenced by ora::CArrayWriter::build(), and ora::STLContainerWriter::build().

28  {
29  MultiRecordInsertOperation* newOperation = new MultiRecordInsertOperation( tableName, m_schema );
30  m_operations.push_back( std::make_pair(newOperation,false) );
31  return *newOperation;
32 }
coral::ISchema & m_schema
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
ora::UpdateOperation & ora::RelationalBuffer::newUpdate ( const std::string &  tableName,
bool  addToResult = false 
)

Definition at line 34 of file RelationalBuffer.cc.

35  {
36  UpdateOperation* newOperation = new UpdateOperation( tableName, m_schema );
37  m_operations.push_back( std::make_pair(newOperation,addToResult) );
38  return *newOperation;
39 }
coral::ISchema & m_schema
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
void ora::RelationalBuffer::storeBlob ( boost::shared_ptr< coral::Blob >  blob)

Definition at line 55 of file RelationalBuffer.cc.

55  {
56  m_blobBuffer.push_back( blob );
57 }
std::vector< boost::shared_ptr< coral::Blob > > m_blobBuffer

Member Data Documentation

std::vector< boost::shared_ptr<coral::Blob> > ora::RelationalBuffer::m_blobBuffer
private

Definition at line 51 of file RelationalBuffer.h.

std::vector< std::pair<IRelationalOperation*, bool> > ora::RelationalBuffer::m_operations
private

Definition at line 49 of file RelationalBuffer.h.

coral::ISchema& ora::RelationalBuffer::m_schema
private

Definition at line 48 of file RelationalBuffer.h.

std::vector<RelationalBuffer*> ora::RelationalBuffer::m_volatileBuffers
private

Definition at line 50 of file RelationalBuffer.h.