| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* This file is a part of NA64SW software. | ||
| 2 | * Copyright (C) 2015-2022 NA64 Collaboration, CERN | ||
| 3 | * | ||
| 4 | * NA64SW is free software: you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation, either version 3 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "na64calib/manager.hh" | ||
| 20 | #include "na64calib/placements.hh" | ||
| 21 | #include "na64detID/TBName.hh" | ||
| 22 | |||
| 23 | namespace na64dp { | ||
| 24 | namespace calib { | ||
| 25 | |||
| 26 | ///\brief Abstract helper for pretty common case of placements data subscribers | ||
| 27 | class SetupGeometryCache : protected calib::Handle<nameutils::DetectorNaming> | ||
| 28 | , public util::Observable<calib::Placements>::iObserver | ||
| 29 | { | ||
| 30 | protected: | ||
| 31 | log4cpp::Category & _log; | ||
| 32 | public: | ||
| 33 | SetupGeometryCache( calib::Dispatcher & cdsp | ||
| 34 | , log4cpp::Category & logCat | ||
| 35 | , const std::string & namingCalibClass="default" | ||
| 36 | , const std::string & placementsCalibClass="default" | ||
| 37 | ); | ||
| 38 | ✗ | virtual ~SetupGeometryCache() {} | |
| 39 | ✗ | const nameutils::DetectorNaming & naming() const | |
| 40 | ✗ | { return calib::Handle<nameutils::DetectorNaming>::operator*(); } | |
| 41 | /**\brief Shall handle update for a single placement entry */ | ||
| 42 | virtual void handle_single_placement_update(const calib::Placement &) = 0; | ||
| 43 | void handle_update( const calib::Placements & placements ) override; | ||
| 44 | }; | ||
| 45 | |||
| 46 | } // namespace ::na64dp::calib | ||
| 47 | } // namespace na64dp | ||
| 48 | |||
| 49 |