Project
Loading...
Searching...
No Matches
Plugin.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include "Framework/Plugins.h"
17#include "TDatabasePDG.h"
19
20using namespace o2::framework;
21
24 {
25 return new ServiceSpec{
26 .name = "database-pdg",
27 .init = [](ServiceRegistryRef, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
28 auto* wrapper = new o2::framework::O2DatabasePDG();
31 wrapper->setInstance(ptr);
32 return ServiceHandle{TypeIdHelpers::uniqueId<O2DatabasePDG>(), wrapper, ServiceKind::Serial, "database-pdg"};
33 },
35 .exit = [](ServiceRegistryRef, void* service) { (*reinterpret_cast<O2DatabasePDG*>(service))->Delete(); },
36 .kind = ServiceKind::Serial};
37 }
38};
39
42 {
43 return new ServiceSpec{
44 .name = "database-pdg-old",
45 .init = [](ServiceRegistryRef ref, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
46 return ServiceHandle{TypeIdHelpers::uniqueId<TDatabasePDG>(), ref.get<O2DatabasePDG>().get(), ServiceKind::Serial, "database-pdg-old"};
47 },
49 .kind = ServiceKind::Serial};
50 }
51};
52
#define DEFINE_DPL_PLUGIN_INSTANCE(NAME, KIND)
Definition Plugins.h:112
#define DEFINE_DPL_PLUGINS_END
Definition Plugins.h:115
#define DEFINE_DPL_PLUGINS_BEGIN
Definition Plugins.h:107
TBranch * ptr
static void addALICEParticles(TDatabasePDG *db=TDatabasePDG::Instance())
GLint ref
Definition glcorearb.h:291
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
o2::framework::ServiceSpec * create() final
Definition Plugin.cxx:41
o2::framework::ServiceSpec * create() final
Definition Plugin.cxx:23
static ServiceConfigureCallback noConfiguration()
Running state information of a given device.
Definition DeviceState.h:34
ServiceKind kind
Kind of service.
std::string name
Name of the service.