Commit fb46b122 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Add a connect() method to connect another selection


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@14115 4525493e-7705-40b1-a816-d608a930855b
parent 6041c7e8
// $Id: CompositeSelection.h,v 1.1 2008-07-30 08:18:52 avalassi Exp $
// $Id: CompositeSelection.h,v 1.2 2008-07-30 15:20:50 avalassi Exp $
#ifndef COOLKERNEL_COMPOSITESELECTION_H
#define COOLKERNEL_COMPOSITESELECTION_H 1
#ifdef COOL260
......@@ -49,6 +49,11 @@ namespace cool
CompositeSelection( const Connective conn,
const std::vector<const IRecordSelection*> selVec );
/// Connect another selection.
/// The input selection is cloned (the clone is owned by this instance).
void connect( const Connective conn,
const IRecordSelection* sel );
/// Can the selection be applied to a record with the given specification?
const bool canSelect( const IRecordSpecification& spec ) const;
......@@ -78,6 +83,9 @@ namespace cool
/// Assignment operator is private
CompositeSelection& operator=( const CompositeSelection& rhs );
/// Constructor with a default connective and no selections - for connect()
CompositeSelection( const Connective conn );
private:
/// The logical connective between connected selections.
......
Package CoolKernel
Package managers: Andrea Valassi, Sven A. Schmidt and Marco Clemencic.
==============================================================================
!2008.06.10 - Andrea
Tag COOL_2_5_0. Production release with API semantic changes, API extensions
and package structure changes to remove the dependency on SEAL.
Upgrade to LCG_55 using the 'de-SEALed' CORAL_2_0_0.
Changes in CoolKernel with respect to COOL_2_4_0a:
- No change in the public CoolKernel API.
- Replace seal::Time by cool::SealBaseTime.
==============================================================================
!2008.06.04 - Andrea
......@@ -16,7 +27,9 @@ NB: Only the (osx105) _config_ branch changes are released in COOL_2_4_0a!
==============================================================================
!2008.04.18 - Marco
- Fixed bug #35709: Windows compile error (after SEAL removal).
Fixed bug #35709: Windows compile error (after SEAL removal).
[Changes relevant to 'de-SEALed' COOL only - not included in COOL_2_4-branch]
==============================================================================
!2008.04.09 - Andrea
......@@ -25,17 +38,22 @@ Undo Marco's changes from 2008.03.20: go back to the COOL_2_4_0 API:
- Remove IDatabaseSvc::load and remove the Reflex dependency.
- Remove IDatabaseSvc::connectionSvc() - move it to IApplication instead.
[Changes relevant to 'de-SEALed' COOL only - not included in COOL_2_4-branch]
==============================================================================
!2008.04.09 - Marco/Andrea
Copied SealBase/Time.h (with minor changes) as new class cool::SealBaseTime to
drop the dependency on SEAL. Added a dependency on Boost (used in some tests).
[Changes relevant to 'de-SEALed' COOL only - not included in COOL_2_4-branch]
==============================================================================
!2008.04.02 - Andrea
Created a COOL_2_4 branch off COOL_2_4_1-pre1 for the whole of COOL:
cvs rtag -r COOL_2_4_1-pre1 -b COOL_2_4-branch cool
For CoolKernel, COOL_2_4_1-pre1 is the same as COOL_2_4_0.
==============================================================================
!2008.03.20 - Marco
......@@ -48,6 +66,8 @@ the RalDatabaseSvc without the need of passing through cool::Application
(but without the configuration steps that happen in cool::Application).
Added a dependency on Reflex to implement cool::IDatabaseSvc::load.
[Changes relevant to 'de-SEALed' COOL only - not included in COOL_2_4-branch]
==============================================================================
!2008.02.28 - Andrea
......
// $Id: CompositeSelection.cpp,v 1.2 2008-07-30 09:21:15 avalassi Exp $
// $Id: CompositeSelection.cpp,v 1.3 2008-07-30 15:20:51 avalassi Exp $
#ifdef COOL260
// Include files
......@@ -79,6 +79,41 @@ CompositeSelection::CompositeSelection( const CompositeSelection& rhs )
//-----------------------------------------------------------------------------
CompositeSelection::CompositeSelection( const Connective conn )
: m_conn( conn )
, m_selVec()
{
}
//-----------------------------------------------------------------------------
void CompositeSelection::connect( const Connective conn,
const IRecordSelection* sel )
{
// Connect using the current logical connective
if ( conn == m_conn )
{
m_selVec.push_back( sel->clone() );
}
// Connect using a different logical connective
else
{
// Copy current selections into a clone and transfer their ownership
CompositeSelection* sel1 = new CompositeSelection( m_conn );
for ( unsigned int iSel = 0; iSel < m_selVec.size(); iSel++ )
{
sel1->m_selVec.push_back( m_selVec[iSel] );
}
m_selVec.clear();
// Redefine this instance using clone, input selection and input connective
m_conn = conn;
m_selVec.push_back( sel1 );
m_selVec.push_back( sel->clone() );
}
}
//-----------------------------------------------------------------------------
const bool
CompositeSelection::canSelect( const IRecordSpecification& rspec ) const
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment