All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 150 of file SmartDataStorePtr.h.

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

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

190  {
191  if ( test ) { // Test existence of the first object
192  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
193  return true; // Fine: Both objects exist
194  }
195  }
196  return false; // Tough luck: One is missing.
197 }
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 214 of file SmartDataStorePtr.h.

214  {
215  if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
216  return true;
217  }
218  if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
219  return true;
220  }
221  return false; // Tough luck: Both are missing.
222 }
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 236 of file SmartDataStorePtr.h.

236  {
237  if ( test ) { // Test existence of the first object
238  return true;
239  }
240  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
241  return true; // Fine: Both objects exist
242  }
243  return false; // Tough luck: One is missing.
244 }
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 257 of file SmartDataStorePtr.h.

257  {
258  if ( test ) { // Test existence of the first object
259  return true;
260  }
261  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
262  return true; // Fine: Both objects exist
263  }
264  return false; // Tough luck: One is missing.
265 }