SH::SampleComposite Class Reference

This module defines an implementation of Sample that contains composite samples. More...

#include <SampleComposite.h>

Inheritance diagram for SH::SampleComposite:
SH::Sample

List of all members.

Public Member Functions

void testInvariant () const
 test the invariant of this object
 SampleComposite ()
 standard constructor
 SampleComposite (const std::string &name)
 standard constructor
void add (const SamplePtr &sample)
 add a sample to the list

Protected Member Functions

virtual std::size_t getNumFiles () const
virtual std::string getFileName (std::size_t index) const
virtual SamplePtr doMakeLocal () const
virtual std::vector< std::string > doMakeFileList () const
virtual void doUpdateLocation (const std::string &from, const std::string &to)
virtual bool getContains (const std::string &name) const
virtual void doAddSamples (SampleHandler &result)

Detailed Description

This module defines an implementation of Sample that contains composite samples.

Warning:
This class hasn't been maintained in a long time and probably has never been fully functional in the first place.

Constructor & Destructor Documentation

SH::SampleComposite::SampleComposite (  ) 

standard constructor

Guarantee
strong
Failures
out of memory I
Warning:
only to be used by serialization code
SH::SampleComposite::SampleComposite ( const std::string &  name  ) 

standard constructor

Parameters:
name the name of the sample
Guarantee
strong
Failures
low level errors II

Member Function Documentation

void SH::SampleComposite::add ( const SamplePtr sample  ) 

add a sample to the list

Guarantee
strong
Failures
low level errors II
sample contains this sample
Precondition:
!sample.empty()
virtual void SH::SampleComposite::doAddSamples ( SampleHandler result  )  [protected, virtual]

add all samples this sample corresponds to to the given sample handler

Guarantee
basic, may only add some
Failures
out of memory II
Rationale this is used with composite samples to find the
actual list of samples to run on.

Rationale
the virtual part of SH::Sample::addSamples()

Reimplemented from SH::Sample.

virtual std::vector<std::string> SH::SampleComposite::doMakeFileList (  )  const [protected, virtual]

make a list of all files, prestaging them if necessary

Guarantee
basic
Failures
out of memory III
file catalogue failures
prestaging failures

Rationale
the virtual part of Sample::makeFileList

Implements SH::Sample.

virtual SamplePtr SH::SampleComposite::doMakeLocal (  )  const [protected, virtual]

Make this a local sample, i.e. one which can be directly opened with TFile::Open.

Returns:
the local sample, or "this" if this already is a local sample
Guarantee
strong
Failures
out of memory III
can not make local sample

Rationale
the virtual part of SH::Sample::makeLocal()

Implements SH::Sample.

virtual void SH::SampleComposite::doUpdateLocation ( const std::string &  from,
const std::string &  to 
) [protected, virtual]

update all file references starting with from to to

Parameters:
from the original path to the data area
to the new path to the data area
Guarantee
basic, may update partially
Failures
out of memory II
Precondition:
!from.empty()
Postcondition:
!to.empty()
Rationale
this is needed when moving data around without recreating the samples from scratch

Rationale
the virtual part of SH::Sample::updateLocation()

Reimplemented from SH::Sample.

virtual bool SH::SampleComposite::getContains ( const std::string &  name  )  const [protected, virtual]

whether this sample contains a sample of the given name

Returns:
whether this sample contains a sample of the given name (or whether the sample itself has the given name)
Guarantee
no-fail
Rationale
this is used with composite sample to make sure we don't create ring like structures that would lead to endless recursion. the reason to check by name, not by address is that we will probably want to add these samples to a sample handler at some point.

Rationale
the virtual part of SH::Sample::contains()

Reimplemented from SH::Sample.

virtual std::string SH::SampleComposite::getFileName ( std::size_t  index  )  const [protected, virtual]

the name of the file with the given index

Parameters:
index the index of the file
Guarantee
no-fail
Precondition:
index < numFiles()
Postcondition:
!result.empty()
Warning:
this is meant more for debugging and may or may not do what you want, e.g. if this is a grid dataset the file may not be directly accessible.

Rationale
the virtual part of Sample::fileName()

Implements SH::Sample.

virtual std::size_t SH::SampleComposite::getNumFiles (  )  const [protected, virtual]

the number of files in the sample

Guarantee
no-fail

Rationale
the virtual part of Sample::numFiles()

Implements SH::Sample.

void SH::SampleComposite::testInvariant (  )  const

test the invariant of this object

Guarantee
no-fail

Reimplemented from SH::Sample.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1