The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
SmartDataStorePtr.h File Reference
Include dependency graph for SmartDataStorePtr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SmartDataStorePtr< TYPE, LOADER >
 A small class used to access easily (and efficiently) data items residing in data stores. More...
 

Functions

template<class A, class LDA, class B, class LDB>
bool operator&& (SmartDataStorePtr< A, LDA > &object_1, SmartDataStorePtr< B, LDB > &object_2)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.
 
template<class B, class LDB>
bool operator&& (bool test, SmartDataStorePtr< B, LDB > &object)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.
 
template<class B, class LDB>
bool operator&& (SmartDataStorePtr< B, LDB > &object, bool test)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.
 
template<class A, class LDA, class B, class LDB>
bool operator|| (SmartDataStorePtr< A, LDA > &object_1, SmartDataStorePtr< B, LDB > &object_2)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks || mcvertices ) { ... } and tests the existence of at least one objects in the data store.
 
template<class B, class LDB>
bool operator|| (bool test, SmartDataStorePtr< B, LDB > &object)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test || mcvertices ) { ... } and tests the existence of BOTH objects in the data store.
 
template<class B, class LDB>
bool operator|| (SmartDataStorePtr< B, LDB > &object, bool test)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.
 

Function Documentation

◆ operator&&() [1/3]

template<class B, class LDB>
bool operator&& ( bool test,
SmartDataStorePtr< B, LDB > & object )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
testFirst boolean to test
objectSmart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 149 of file SmartDataStorePtr.h.

149 {
150 if ( test ) { // Test existence of the first object
151 if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
152 return true; // Fine: Both objects exist
153 }
154 }
155 return false; // Tough luck: One is missing.
156}

◆ operator&&() [2/3]

template<class A, class LDA, class B, class LDB>
bool operator&& ( SmartDataStorePtr< A, LDA > & object_1,
SmartDataStorePtr< B, LDB > & object_2 )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
object_1Smart pointer to object 1
object_2Smart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 129 of file SmartDataStorePtr.h.

129 {
130 if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
131 if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
132 return true; // Fine: Both objects exist
133 }
134 }
135 return false; // Tough luck: One is missing.
136}
TYPE * accessTypeSafeData()
Internal type safe accessor to data.

◆ operator&&() [3/3]

template<class B, class LDB>
bool operator&& ( SmartDataStorePtr< B, LDB > & object,
bool test )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
objectSmart pointer to second object
testSecond boolean to test
Returns
Boolean indicating existence of both objects

Definition at line 169 of file SmartDataStorePtr.h.

169 {
170 if ( test ) { // Test existence of the first object
171 if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
172 return true; // Fine: Both objects exist
173 }
174 }
175 return false; // Tough luck: One is missing.
176}

◆ operator||() [1/3]

template<class B, class LDB>
bool operator|| ( bool test,
SmartDataStorePtr< B, LDB > & object )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test || mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
testFirst boolean to test
objectSmart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 214 of file SmartDataStorePtr.h.

214 {
215 if ( test ) { // Test existence of the first object
216 return true;
217 }
218 if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
219 return true; // Fine: Both objects exist
220 }
221 return false; // Tough luck: One is missing.
222}

◆ operator||() [2/3]

template<class A, class LDA, class B, class LDB>
bool operator|| ( SmartDataStorePtr< A, LDA > & object_1,
SmartDataStorePtr< B, LDB > & object_2 )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks || mcvertices ) { ... } and tests the existence of at least one objects in the data store.

The second object will then NOT be loaded. It is assumed that the second choice is only an alternative usable in case the first object cannot be retrieved.

Parameters
object_1Smart pointer to object 1
object_2Smart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 193 of file SmartDataStorePtr.h.

193 {
194 if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
195 return true;
196 }
197 if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
198 return true;
199 }
200 return false; // Tough luck: Both are missing.
201}

◆ operator||() [3/3]

template<class B, class LDB>
bool operator|| ( SmartDataStorePtr< B, LDB > & object,
bool test )

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
objectSmart pointer to second object
testSecond boolean to test
Returns
Boolean indicating existence of both objects

Definition at line 235 of file SmartDataStorePtr.h.

235 {
236 if ( test ) { // Test existence of the first object
237 return true;
238 }
239 if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
240 return true; // Fine: Both objects exist
241 }
242 return false; // Tough luck: One is missing.
243}