Skip to content

Commit

Permalink
don't make getFrame public
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Sep 17, 2024
1 parent d6061c4 commit 38f8bd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion k4FWCore/components/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Writer final : public Gaudi::Functional::Consumer<void(const EventContext&
}
iosvc->getWriter()->writeFrame(config_metadata_frame, "configuration_metadata");

if (const auto* metadata_frame = std::as_const(*m_metadataSvc).getFrame(); metadata_frame) {
if (const auto* metadata_frame = m_metadataSvc->getFrame(); metadata_frame) {
iosvc->getWriter()->writeFrame(*metadata_frame, podio::Category::Metadata);
}

Expand Down
8 changes: 5 additions & 3 deletions k4FWCore/include/k4FWCore/IMetadataSvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
#include "podio/Frame.h"

class IMetadataSvc : virtual public IInterface {
friend class Writer;

public:
DeclareInterfaceID(IMetadataSvc, 1, 0);

virtual const podio::Frame* getFrame() const = 0;
virtual void setFrame(podio::Frame&& frame) = 0;
virtual void setFrame(podio::Frame&& frame) = 0;

template <typename T> void put(const std::string& name, const T& obj) {
if (!getFrame()) {
Expand All @@ -46,7 +47,8 @@ class IMetadataSvc : virtual public IInterface {
}

protected:
virtual podio::Frame* getFrame() = 0;
virtual podio::Frame* getFrame() = 0;
virtual const podio::Frame* getFrame() const = 0;
};

#endif

0 comments on commit 38f8bd2

Please sign in to comment.