Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 ) { ... More...
 
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 = ... More...
 
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 = ... More...
 
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 ) { ... More...
 
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 = ... More...
 
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 = ... More...
 

Function Documentation

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 132 of file SmartDataStorePtr.h.

132  {
133  if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
134  if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
135  return true; // Fine: Both objects exist
136  }
137  }
138  return false; // Tough luck: One is missing.
139 }
TYPE * accessTypeSafeData()
Internal type safe accessor to data.
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 152 of file SmartDataStorePtr.h.

152  {
153  if ( test ) { // Test existence of the first object
154  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
155  return true; // Fine: Both objects exist
156  }
157  }
158  return false; // Tough luck: One is missing.
159 }
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 172 of file SmartDataStorePtr.h.

172  {
173  if ( test ) { // Test existence of the first object
174  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
175  return true; // Fine: Both objects exist
176  }
177  }
178  return false; // Tough luck: One is missing.
179 }
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 196 of file SmartDataStorePtr.h.

196  {
197  if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
198  return true;
199  }
200  if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
201  return true;
202  }
203  return false; // Tough luck: Both are missing.
204 }
TYPE * accessTypeSafeData()
Internal type safe accessor to data.
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 217 of file SmartDataStorePtr.h.

217  {
218  if ( test ) { // Test existence of the first object
219  return true;
220  }
221  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
222  return true; // Fine: Both objects exist
223  }
224  return false; // Tough luck: One is missing.
225 }
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 238 of file SmartDataStorePtr.h.

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