Public Member Functions | Private Attributes | List of all members
WireCell::Gen::WireSchemaFile Class Reference

#include <WireSchemaFile.h>

Inheritance diagram for WireCell::Gen::WireSchemaFile:
WireCell::IWireSchema WireCell::IConfigurable WireCell::IComponent< IWireSchema > WireCell::IComponent< IConfigurable > WireCell::Interface WireCell::Interface

Public Member Functions

 WireSchemaFile (const char *frfilename="")
 
virtual ~WireSchemaFile ()
 
virtual const WireSchema::Storewire_schema_store () const
 Return the field response data. More...
 
virtual void configure (const WireCell::Configuration &cfg)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IWireSchema
virtual ~IWireSchema ()
 
- Public Member Functions inherited from WireCell::IComponent< IWireSchema >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

std::string m_fname
 
WireSchema::Store m_store
 

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IWireSchema >
typedef std::shared_ptr< IWireSchemapointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Definition at line 16 of file WireSchemaFile.h.

Constructor & Destructor Documentation

Gen::WireSchemaFile::WireSchemaFile ( const char *  frfilename = "")

Definition at line 13 of file WireSchemaFile.cxx.

Gen::WireSchemaFile::~WireSchemaFile ( )
virtual

Definition at line 18 of file WireSchemaFile.cxx.

19 {
20 }

Member Function Documentation

void Gen::WireSchemaFile::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 23 of file WireSchemaFile.cxx.

24 {
25  m_fname = get(cfg, "filename", m_fname);
26  if (m_fname.empty()) {
27  THROW(ValueError() << errmsg{"must give a wire schema filename"});
28  }
29  m_store = WireSchema::load(m_fname.c_str());
30 }
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
#define THROW(e)
Definition: Exceptions.h:25
Store load(const char *filename)
Definition: WireSchema.cxx:14
WireCell::Configuration Gen::WireSchemaFile::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 32 of file WireSchemaFile.cxx.

33 {
35  cfg["filename"] = m_fname;
36  return cfg;
37 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
const WireSchema::Store & Gen::WireSchemaFile::wire_schema_store ( ) const
virtual

Return the field response data.

Implements WireCell::IWireSchema.

Definition at line 40 of file WireSchemaFile.cxx.

41 {
42  return m_store;
43 }

Member Data Documentation

std::string WireCell::Gen::WireSchemaFile::m_fname
private

Definition at line 27 of file WireSchemaFile.h.

WireSchema::Store WireCell::Gen::WireSchemaFile::m_store
private

Definition at line 28 of file WireSchemaFile.h.


The documentation for this class was generated from the following files: