Psyllid  v1.12.4
Project 8 Data Acquisisition Software
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
butterfly_house Class Reference

Responsible for starting files. Holds pointer to monarch. More...

#include <butterfly_house.hh>

Inheritance diagram for butterfly_house:
Inheritance graph

Classes

struct  file_info
 

Public Member Functions

 snake_case_mv_accessible (double, max_file_size_mb)
 
void register_file (unsigned a_file_num, const std::string &a_filename, const std::string &a_description, unsigned a_duration_ms)
 
void prepare_files (const scarab::param_node &a_files_config)
 
void start_files ()
 
void finish_files ()
 
void register_writer (egg_writer *a_writer, unsigned a_file_num)
 
void unregister_writer (egg_writer *a_writer)
 
void set_filename (const std::string &a_filename, unsigned a_file_num=0)
 
const std::string & get_filename (unsigned a_file_num)
 
void set_description (const std::string &a_desc, unsigned a_file_num=0)
 
const std::string & get_description (unsigned a_file_num)
 
- Public Member Functions inherited from control_access
 control_access ()
 
virtual ~control_access ()
 

Private Types

typedef std::vector< file_infofile_infos_t
 
typedef file_infos_t::const_iterator file_infos_cit
 
typedef file_infos_t::iterator file_infos_it
 

Private Member Functions

 butterfly_house ()
 
virtual ~butterfly_house ()
 

Private Attributes

file_infos_t f_file_infos
 
std::vector< monarch_wrap_ptrf_mw_ptrs
 
std::multimap< egg_writer *, unsigned > f_writers
 
std::mutex f_house_mutex
 

Friends

class scarab::singleton< butterfly_house >
 
class scarab::destroyer< butterfly_house >
 

Additional Inherited Members

- Public Types inherited from control_access
typedef std::shared_ptr< daq_controldc_ptr_t
 
- Static Public Member Functions inherited from control_access
static void set_daq_control (std::weak_ptr< daq_control > a_daq_control)
 
- Protected Member Functions inherited from control_access
dc_ptr_t use_daq_control ()
 
bool daq_control_expired ()
 
- Static Protected Attributes inherited from control_access
static std::weak_ptr< daq_controlf_daq_control = std::weak_ptr< daq_control >()
 

Detailed Description

Responsible for starting files. Holds pointer to monarch.

Author
N. S. Oblath

Holds one monarch pointer per file. Registers the writer and creates, prepares, starts and finishes egg files via monarch3_wrapper. butterfly_house gets the file size from the psyllid config file and the filename, run duration and description from daq_control. It adds this information to the file header.

Definition at line 56 of file butterfly_house.hh.

Member Typedef Documentation

◆ file_infos_cit

typedef file_infos_t::const_iterator file_infos_cit
private

Definition at line 87 of file butterfly_house.hh.

◆ file_infos_it

typedef file_infos_t::iterator file_infos_it
private

Definition at line 88 of file butterfly_house.hh.

◆ file_infos_t

typedef std::vector< file_info > file_infos_t
private

Definition at line 86 of file butterfly_house.hh.

Constructor & Destructor Documentation

◆ butterfly_house()

butterfly_house ( )
private

Definition at line 24 of file butterfly_house.cc.

◆ ~butterfly_house()

~butterfly_house ( )
privatevirtual

Definition at line 35 of file butterfly_house.cc.

Member Function Documentation

◆ finish_files()

void finish_files ( )

Definition at line 131 of file butterfly_house.cc.

◆ get_description()

const std::string & get_description ( unsigned  a_file_num)

Definition at line 211 of file butterfly_house.cc.

◆ get_filename()

const std::string & get_filename ( unsigned  a_file_num)

Definition at line 196 of file butterfly_house.cc.

◆ prepare_files()

void prepare_files ( const scarab::param_node &  a_files_config)

Definition at line 40 of file butterfly_house.cc.

◆ register_file()

void register_file ( unsigned  a_file_num,
const std::string &  a_filename,
const std::string &  a_description,
unsigned  a_duration_ms 
)

◆ register_writer()

void register_writer ( egg_writer a_writer,
unsigned  a_file_num 
)

Definition at line 153 of file butterfly_house.cc.

◆ set_description()

void set_description ( const std::string &  a_desc,
unsigned  a_file_num = 0 
)

Definition at line 203 of file butterfly_house.cc.

◆ set_filename()

void set_filename ( const std::string &  a_filename,
unsigned  a_file_num = 0 
)

Definition at line 188 of file butterfly_house.cc.

◆ snake_case_mv_accessible()

snake_case_mv_accessible ( double  ,
max_file_size_mb   
)

◆ start_files()

void start_files ( )

Definition at line 70 of file butterfly_house.cc.

◆ unregister_writer()

void unregister_writer ( egg_writer a_writer)

Definition at line 180 of file butterfly_house.cc.

Friends And Related Function Documentation

◆ scarab::destroyer< butterfly_house >

friend class scarab::destroyer< butterfly_house >
friend

Definition at line 98 of file butterfly_house.hh.

◆ scarab::singleton< butterfly_house >

friend class scarab::singleton< butterfly_house >
friend

Definition at line 97 of file butterfly_house.hh.

Member Data Documentation

◆ f_file_infos

file_infos_t f_file_infos
private

Definition at line 89 of file butterfly_house.hh.

◆ f_house_mutex

std::mutex f_house_mutex
mutableprivate

Definition at line 94 of file butterfly_house.hh.

◆ f_mw_ptrs

std::vector< monarch_wrap_ptr > f_mw_ptrs
private

Definition at line 91 of file butterfly_house.hh.

◆ f_writers

std::multimap< egg_writer*, unsigned > f_writers
private

Definition at line 92 of file butterfly_house.hh.


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