| The Gaudi Framework v32r1 (f65d50dc)

Macros | Functions
SmartDataObjectPtr.cpp File Reference
`#include "GaudiKernel/SmartDataObjectPtr.h"`
`#include "GaudiKernel/DataObject.h"`
`#include "GaudiKernel/IDataProviderSvc.h"`
Include dependency graph for SmartDataObjectPtr.cpp:

Go to the source code of this file.

## Macros
#define | GAUDIKERNEL_SMARTDATAOBJECTPTR_CPP 1

## Functions
bool | operator && (SmartDataObjectPtr &object_1, SmartDataObjectPtr &object_2)
| Helper to test Smart data objects efficiently This construct allows statements like: SmartEvtDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartEvtDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ... More...
bool | operator|| (SmartDataObjectPtr &object_1, SmartDataObjectPtr &object_2)
| Helper to test Smart data objects efficiently This construct allows statements like: SmartEvtDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartEvtDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks || mcvertices ) { ... More...

## Macro Definition Documentation

## ◆ GAUDIKERNEL_SMARTDATAOBJECTPTR_CPP

#define GAUDIKERNEL_SMARTDATAOBJECTPTR_CPP 1

Definition at line 10 of file SmartDataObjectPtr.cpp.

## Function Documentation

## ◆ operator &&()

bool operator && | ( | SmartDataObjectPtr & | object_1,
|  | SmartDataObjectPtr & | object_2
| ) |  |

Helper to test Smart data objects efficiently This construct allows statements like: SmartEvtDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartEvtDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ...

} and tests the existence of BOTH objects in the data store. This is not done inline due to danger of code explosion.

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 118 of file SmartDataObjectPtr.cpp.

118 {
119 return object_1.accessData() && object_2.accessData();
120 }
SmartDataObjectPtr::accessData
DataObject * accessData()
Static Object retrieval method: must call specific function.
Definition: SmartDataObjectPtr.h:86

## ◆ operator||()

bool operator|| | ( | SmartDataObjectPtr & | object_1,
|  | SmartDataObjectPtr & | object_2
| ) |  |

Helper to test Smart data objects efficiently This construct allows statements like: SmartEvtDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartEvtDataPtr<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.

This is not done inline due to danger of code explosion.

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 138 of file SmartDataObjectPtr.cpp.

138 {
139 return object_1.accessData() || object_2.accessData();
140 }
SmartDataObjectPtr::accessData
DataObject * accessData()
Static Object retrieval method: must call specific function.
Definition: SmartDataObjectPtr.h:86