| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# SmartDataStorePtr.h File Reference

`#include "GaudiKernel/SmartDataObjectPtr.h"`

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...
## Defines
#define | GAUDIKERNEL_SMARTDATASTOREPTR_H 1
## 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 ) { .
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 = .
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 = .
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 ) { .
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 = .
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 = .

## Define Documentation

#define GAUDIKERNEL_SMARTDATASTOREPTR_H 1

Definition at line 13 of file SmartDataStorePtr.h.

## Function Documentation

template<class B, class LDB>

bool operator && | ( | SmartDataStorePtr< B, LDB > & | object,
|  | bool | test |
| ) |  |  | `[inline]`

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:

  | object | Smart pointer to second object
  | test | Second boolean to test

Returns:
  Boolean indicating existence of both objects

Definition at line 190 of file SmartDataStorePtr.h.

    00190                                                                   {
    00191   if ( test )    {                                   // Test existence of the first object
    00192     if ( 0 != object.accessTypeSafeData() )    {     // Test existence of the second object
    00193       return true;                                   // Fine: Both objects exist
    00194     }
    00195   }
    00196   return false;                                      // Tough luck: One is missing.
    00197 }

template<class B, class LDB>

bool operator && | ( | bool | test,
|  | SmartDataStorePtr< B, LDB > & | object |
| ) |  |  | `[inline]`

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:

  | test | First boolean to test
  | object | Smart pointer to second object

Returns:
  Boolean indicating existence of both objects

Definition at line 170 of file SmartDataStorePtr.h.

    00170                                                                   {
    00171   if ( test )    {                                   // Test existence of the first object
    00172     if ( 0 != object.accessTypeSafeData() )    {     // Test existence of the second object
    00173       return true;                                   // Fine: Both objects exist
    00174     }
    00175   }
    00176   return false;                                      // Tough luck: One is missing.
    00177 }

template<class A, class LDA, class B, class LDB>

bool operator && | ( | SmartDataStorePtr< A, LDA > & | object_1,
|  | SmartDataStorePtr< B, LDB > & | object_2 |
| ) |  |  | `[inline]`

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_1 | Smart pointer to object 1
  | object_2 | Smart pointer to second object

Returns:
  Boolean indicating existence of both objects

Definition at line 150 of file SmartDataStorePtr.h.

    00150                                                                                               {
    00151   if ( 0 != object_1.accessTypeSafeData() )    {     // Test existence of the first object
    00152     if ( 0 != object_2.accessTypeSafeData() )    {   // Test existence of the second object
    00153       return true;                                   // Fine: Both objects exist
    00154     }
    00155   }
    00156   return false;                                      // Tough luck: One is missing.
    00157 }

template<class B, class LDB>

bool operator|| | ( | SmartDataStorePtr< B, LDB > & | object,
|  | bool | test |
| ) |  |  | `[inline]`

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:

  | object | Smart pointer to second object
  | test | Second boolean to test

Returns:
  Boolean indicating existence of both objects

Definition at line 257 of file SmartDataStorePtr.h.

    00257                                                                   {
    00258   if ( test )    {                                 // Test existence of the first object
    00259     return true;
    00260   }
    00261   if ( 0 != object.accessTypeSafeData() )    {     // Test existence of the second object
    00262     return true;                                   // Fine: Both objects exist
    00263   }
    00264   return false;                                    // Tough luck: One is missing.
    00265 }

template<class B, class LDB>

bool operator|| | ( | bool | test,
|  | SmartDataStorePtr< B, LDB > & | object |
| ) |  |  | `[inline]`

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:

  | test | First boolean to test
  | object | Smart pointer to second object

Returns:
  Boolean indicating existence of both objects

Definition at line 236 of file SmartDataStorePtr.h.

    00236                                                                   {
    00237   if ( test )    {                                 // Test existence of the first object
    00238     return true;
    00239   }
    00240   if ( 0 != object.accessTypeSafeData() )    {     // Test existence of the second object
    00241     return true;                                   // Fine: Both objects exist
    00242   }
    00243   return false;                                    // Tough luck: One is missing.
    00244 }

template<class A, class LDA, class B, class LDB>

bool operator|| | ( | SmartDataStorePtr< A, LDA > & | object_1,
|  | SmartDataStorePtr< B, LDB > & | object_2 |
| ) |  |  | `[inline]`

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_1 | Smart pointer to object 1
  | object_2 | Smart pointer to second object

Returns:
  Boolean indicating existence of both objects

Definition at line 214 of file SmartDataStorePtr.h.

    00214                                                                                               {
    00215   if ( 0 != object_1.accessTypeSafeData() )    {     // Test existence of the first object
    00216     return true;
    00217   }
    00218   if ( 0 != object_2.accessTypeSafeData() )    {     // Test existence of the second object
    00219     return true;
    00220   }
    00221   return false;                                      // Tough luck: Both are missing.
    00222 }