ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
H5FileSvc Class Reference

#include <H5FileSvc.h>

Inheritance diagram for H5FileSvc:
Collaboration diagram for H5FileSvc:

Public Member Functions

 H5FileSvc (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~H5FileSvc ()
 
StatusCode initialize () override
 
H5::Group * group () override
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Private Member Functions

StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 

Private Attributes

std::unique_ptr< H5::H5File > m_file {nullptr}
 
Gaudi::Property< std::string > m_file_path {this, "path", "", "path to file"}
 

Detailed Description

Definition at line 18 of file H5FileSvc.h.

Constructor & Destructor Documentation

◆ H5FileSvc()

H5FileSvc::H5FileSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 7 of file H5FileSvc.cxx.

7  :
8  AthService(name, pSvcLocator)
9 {
10 }

◆ ~H5FileSvc()

H5FileSvc::~H5FileSvc ( )
default

Member Function Documentation

◆ group()

H5::Group * H5FileSvc::group ( )
overridevirtual

Implements IH5GroupSvc.

Definition at line 22 of file H5FileSvc.cxx.

22  {
23  return m_file.get();
24 }

◆ initialize()

StatusCode H5FileSvc::initialize ( )
override

Definition at line 14 of file H5FileSvc.cxx.

14  {
15  if (m_file_path.empty()) {
16  return StatusCode::FAILURE;
17  }
18  m_file = std::make_unique<H5::H5File>(m_file_path, H5F_ACC_TRUNC);
19  return StatusCode::SUCCESS;
20 }

◆ interfaceID()

const InterfaceID & IH5GroupSvc::interfaceID ( )
inlinestaticinherited

Definition at line 30 of file IH5GroupSvc.h.

30  {
31  static const InterfaceID id("IH5GroupSvc", 1, 0);
32  return id;
33 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ queryInterface()

StatusCode H5FileSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
overrideprivate

Definition at line 31 of file H5FileSvc.cxx.

33 {
34  if ( IH5GroupSvc::interfaceID().versionMatch(riid) ) {
35  // This thing seems to get called when we run the code.
36  //
37  *ppvInterface = dynamic_cast<IH5GroupSvc*>(this);
38  } else {
39  // And this thing gets called when the code is being compiled
40  return AthService::queryInterface(riid, ppvInterface);
41  }
42  addRef();
43  return StatusCode::SUCCESS;
44 }

Member Data Documentation

◆ m_file

std::unique_ptr<H5::H5File> H5FileSvc::m_file {nullptr}
private

Definition at line 29 of file H5FileSvc.h.

◆ m_file_path

Gaudi::Property<std::string> H5FileSvc::m_file_path {this, "path", "", "path to file"}
private

Definition at line 30 of file H5FileSvc.h.


The documentation for this class was generated from the following files:
AthService::AthService
AthService()
H5FileSvc::m_file_path
Gaudi::Property< std::string > m_file_path
Definition: H5FileSvc.h:30
IH5GroupSvc
Definition: IH5GroupSvc.h:23
H5FileSvc::m_file
std::unique_ptr< H5::H5File > m_file
Definition: H5FileSvc.h:29
IH5GroupSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: IH5GroupSvc.h:30
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195