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

Manages one or multiple sets of midge-nodes. More...

#include <stream_manager.hh>

Classes

struct  stream_template
 

Public Types

typedef std::shared_ptr< midge::diptera > midge_ptr_t
 

Public Member Functions

 stream_manager ()
 
virtual ~stream_manager ()
 
bool initialize (const scarab::param_node &a_config)
 
bool add_stream (const std::string &a_name, const scarab::param_node &a_node)
 
const stream_templateget_stream (const std::string &a_name) const
 
void remove_stream (const std::string &a_name)
 
bool configure_node (const std::string &a_stream_name, const std::string &a_node_name, const scarab::param_node &a_config)
 
bool dump_node_config (const std::string &a_stream_name, const std::string &a_node_name, scarab::param_node &a_config) const
 
void reset_midge ()
 
bool must_reset_midge () const
 
midge_package get_midge ()
 
void return_midge (midge_package &&a_midge)
 
active_node_bindingsget_node_bindings ()
 
std::string get_node_run_str () const
 
bool is_in_use () const
 
dripline::reply_ptr_t handle_add_stream_request (const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t handle_remove_stream_request (const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t handle_configure_node_request (const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t handle_dump_config_node_request (const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t handle_get_stream_list_request (const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t handle_get_stream_node_list_request (const dripline::request_ptr_t a_request)
 

Private Types

typedef std::map< std::string, stream_templatestreams_t
 

Private Member Functions

void _add_stream (const std::string &a_name, const scarab::param_node &a_node)
 
void _add_stream (const std::string &a_name, const std::string &a_type, const scarab::param_node &a_node)
 
void _remove_stream (const std::string &a_name)
 
void _configure_node (const std::string &a_stream_name, const std::string &a_node_name, const scarab::param_node &a_config)
 
void _dump_node_config (const std::string &a_stream_name, const std::string &a_node_name, scarab::param_node &a_config) const
 
void clear_node_bindings ()
 

Private Attributes

streams_t f_streams
 
std::mutex f_manager_mutex
 
midge_ptr_t f_midge
 
active_node_bindings f_node_bindings
 
bool f_must_reset_midge
 
std::mutex f_midge_mutex
 

Detailed Description

Manages one or multiple sets of midge-nodes.

Author
N. S. Oblath

Holds pointer to midge object that is running all nodes. With initialization, stream_manager is given the node configurations set for the currently running psyllid instance. A stream is added for every configured set of midge nodes. For every node in a node config an instance of the nodes builder class is created. daq_control activate-daq calls reset_midge in stream_manager. reset_midge makes fresh copies of the configured node classes and the node binding classes and adds the classes and all the node connections to the midge object. The node binding classes allow access to the nodes held and owned by midge. Via the node binding classes some node configurations can be changed while the daq is activated. When the daq is de- or re-activated these settings are lost, as stream_manager makes a fresh copy of every node with the original/global configurations.

Definition at line 51 of file stream_manager.hh.

Member Typedef Documentation

◆ midge_ptr_t

typedef std::shared_ptr< midge::diptera > midge_ptr_t

Definition at line 67 of file stream_manager.hh.

◆ streams_t

typedef std::map< std::string, stream_template > streams_t
private

Definition at line 115 of file stream_manager.hh.

Constructor & Destructor Documentation

◆ stream_manager()

Definition at line 32 of file stream_manager.cc.

◆ ~stream_manager()

~stream_manager ( )
virtual

Definition at line 42 of file stream_manager.cc.

Member Function Documentation

◆ _add_stream() [1/2]

void _add_stream ( const std::string &  a_name,
const scarab::param_node &  a_node 
)
private

Definition at line 175 of file stream_manager.cc.

◆ _add_stream() [2/2]

void _add_stream ( const std::string &  a_name,
const std::string &  a_type,
const scarab::param_node &  a_node 
)
private

Definition at line 213 of file stream_manager.cc.

◆ _configure_node()

void _configure_node ( const std::string &  a_stream_name,
const std::string &  a_node_name,
const scarab::param_node &  a_config 
)
private

Definition at line 131 of file stream_manager.cc.

◆ _dump_node_config()

void _dump_node_config ( const std::string &  a_stream_name,
const std::string &  a_node_name,
scarab::param_node &  a_config 
) const
private

Definition at line 152 of file stream_manager.cc.

◆ _remove_stream()

void _remove_stream ( const std::string &  a_name)
private

Definition at line 287 of file stream_manager.cc.

◆ add_stream()

bool add_stream ( const std::string &  a_name,
const scarab::param_node &  a_node 
)

Definition at line 74 of file stream_manager.cc.

◆ clear_node_bindings()

void clear_node_bindings ( )
private

Definition at line 417 of file stream_manager.cc.

◆ configure_node()

bool configure_node ( const std::string &  a_stream_name,
const std::string &  a_node_name,
const scarab::param_node &  a_config 
)

Definition at line 103 of file stream_manager.cc.

◆ dump_node_config()

bool dump_node_config ( const std::string &  a_stream_name,
const std::string &  a_node_name,
scarab::param_node &  a_config 
) const

Definition at line 117 of file stream_manager.cc.

◆ get_midge()

midge_package get_midge ( )

Definition at line 372 of file stream_manager.cc.

◆ get_node_bindings()

active_node_bindings * get_node_bindings ( )
inline

Definition at line 141 of file stream_manager.hh.

◆ get_node_run_str()

std::string get_node_run_str ( ) const

Definition at line 389 of file stream_manager.cc.

◆ get_stream()

const stream_manager::stream_template * get_stream ( const std::string &  a_name) const
inline

Definition at line 127 of file stream_manager.hh.

◆ handle_add_stream_request()

dripline::reply_ptr_t handle_add_stream_request ( const dripline::request_ptr_t  a_request)

Definition at line 429 of file stream_manager.cc.

◆ handle_configure_node_request()

dripline::reply_ptr_t handle_configure_node_request ( const dripline::request_ptr_t  a_request)

Definition at line 476 of file stream_manager.cc.

◆ handle_dump_config_node_request()

dripline::reply_ptr_t handle_dump_config_node_request ( const dripline::request_ptr_t  a_request)

Definition at line 556 of file stream_manager.cc.

◆ handle_get_stream_list_request()

dripline::reply_ptr_t handle_get_stream_list_request ( const dripline::request_ptr_t  a_request)

Definition at line 614 of file stream_manager.cc.

◆ handle_get_stream_node_list_request()

dripline::reply_ptr_t handle_get_stream_node_list_request ( const dripline::request_ptr_t  a_request)

Definition at line 641 of file stream_manager.cc.

◆ handle_remove_stream_request()

dripline::reply_ptr_t handle_remove_stream_request ( const dripline::request_ptr_t  a_request)

Definition at line 448 of file stream_manager.cc.

◆ initialize()

bool initialize ( const scarab::param_node &  a_config)

Definition at line 56 of file stream_manager.cc.

◆ is_in_use()

bool is_in_use ( ) const

Definition at line 406 of file stream_manager.cc.

◆ must_reset_midge()

bool must_reset_midge ( ) const
inline

Definition at line 135 of file stream_manager.hh.

◆ remove_stream()

void remove_stream ( const std::string &  a_name)

Definition at line 89 of file stream_manager.cc.

◆ reset_midge()

void reset_midge ( )

Definition at line 313 of file stream_manager.cc.

◆ return_midge()

void return_midge ( midge_package &&  a_midge)

Definition at line 381 of file stream_manager.cc.

Member Data Documentation

◆ f_manager_mutex

std::mutex f_manager_mutex
mutableprivate

Definition at line 118 of file stream_manager.hh.

◆ f_midge

midge_ptr_t f_midge
private

Definition at line 120 of file stream_manager.hh.

◆ f_midge_mutex

std::mutex f_midge_mutex
mutableprivate

Definition at line 123 of file stream_manager.hh.

◆ f_must_reset_midge

bool f_must_reset_midge
private

Definition at line 122 of file stream_manager.hh.

◆ f_node_bindings

active_node_bindings f_node_bindings
private

Definition at line 121 of file stream_manager.hh.

◆ f_streams

streams_t f_streams
private

Definition at line 116 of file stream_manager.hh.


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