The Gaudi Framework  master (da3d77e1)
ObjectFactory.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_DATAOBJECTFACTORY_H
12 #define GAUDIKERNEL_DATAOBJECTFACTORY_H
13 
14 #include <Gaudi/PluginService.h>
15 
16 class IInterface;
17 class DataObject;
18 class ContainedObject;
19 
20 using ObjFactory = Gaudi::PluginService::Factory<IInterface*( IInterface* )>;
21 using DataObjFactory = Gaudi::PluginService::Factory<DataObject*()>;
22 using ContainedObjFactory = Gaudi::PluginService::Factory<ContainedObject*()>;
23 
24 // Macros to declare component factories
25 #define DECLARE_OBJECT_FACTORY( x ) DECLARE_FACTORY( x, ObjFactory )
26 #define DECLARE_NAMESPACE_OBJECT_FACTORY( n, x ) \
27  using n::x; \
28  DECLARE_FACTORY( x, ObjFactory )
29 
30 #define DECLARE_CONTAINEDOBJECT_FACTORY( x ) DECLARE_FACTORY_WITH_ID( x, x::classID(), ContainedObjFactory )
31 #define DECLARE_DATAOBJECT_FACTORY( x ) DECLARE_FACTORY_WITH_ID( x, x::classID(), DataObjFactory )
32 
33 #endif // GAUDIKERNEL_OBJECTFactory_H
ContainedObjFactory
Gaudi::PluginService::Factory< ContainedObject *()> ContainedObjFactory
Definition: ObjectFactory.h:22
ObjFactory
Gaudi::PluginService::Factory< IInterface *(IInterface *)> ObjFactory
Definition: ObjectFactory.h:20
PluginService.h
DataObjFactory
Gaudi::PluginService::Factory< DataObject *()> DataObjFactory
Definition: ObjectFactory.h:21
IInterface
Definition: IInterface.h:239
DataObject
Definition: DataObject.h:36
ContainedObject
Definition: ContainedObject.h:41