artdaq  v3_08_00
artdaq::Globals Class Reference

The artdaq::Globals class contains several variables which are useful across the entire artdaq system. More...

#include <artdaq/DAQdata/Globals.hh>

Static Public Member Functions

static uint32_t seedAndRandom_ ()
 Seed the C random number generator with the current time (if that has not been done already) and generate a random value. More...
 
static int getPartitionNumber_ ()
 Get the current partition number, as defined by the ARTDAQ_PARTITION_NUMBER environment variable. More...
 
static std::string GetMFIteration_ ()
 Get the current iteration for MessageFacility messages. More...
 
static std::string GetMFModuleName_ ()
 Get the current module name for MessageFacility messages. More...
 
static void SetMFIteration_ (std::string name)
 Set the current iteration for MessageFacility messages. More...
 
static void SetMFModuleName_ (std::string name)
 Set the current module name for MessageFacility messages. More...
 
static void CleanUpGlobals ()
 Clean up statically-allocated Manager class instances.
 

Static Public Attributes

static int my_rank_ = -1
 The rank of the current application.
 
static std::unique_ptr
< MetricManager > 
metricMan_ = std::make_unique<artdaq::MetricManager>()
 A handle to MetricManager.
 
static std::unique_ptr
< PortManager
portMan_ = std::make_unique<artdaq::PortManager>()
 A handle to PortManager.
 
static std::string app_name_ = ""
 The name of the current application, to be used in logging and metrics.
 
static int partition_number_ = -1
 The partition number of the current application.
 
static std::mutex mftrace_mutex_
 Mutex to protect mftrace_module_ and mftrace_iteration_.
 
static std::string mftrace_module_ = "DAQ"
 MessageFacility's module and iteration are thread-local, but we want to use them to represent global state in artdaq.
 
static std::string mftrace_iteration_ = "Booted"
 MessageFacility's module and iteration are thread-local, but we want to use them to represent global state in artdaq.
 

Detailed Description

The artdaq::Globals class contains several variables which are useful across the entire artdaq system.

Definition at line 32 of file Globals.hh.

Member Function Documentation

static std::string artdaq::Globals::GetMFIteration_ ( )
inlinestatic

Get the current iteration for MessageFacility messages.

Returns
The current iteration

Definition at line 111 of file Globals.hh.

static std::string artdaq::Globals::GetMFModuleName_ ( )
inlinestatic

Get the current module name for MessageFacility messages.

Returns
The current module name

Definition at line 121 of file Globals.hh.

static int artdaq::Globals::getPartitionNumber_ ( )
inlinestatic

Get the current partition number, as defined by the ARTDAQ_PARTITION_NUMBER environment variable.

Returns
The current partition number (defaults to 0 if unset, will be between 0 and 127)

Definition at line 75 of file Globals.hh.

static uint32_t artdaq::Globals::seedAndRandom_ ( )
inlinestatic

Seed the C random number generator with the current time (if that has not been done already) and generate a random value.

Returns
A random number.

Definition at line 49 of file Globals.hh.

static void artdaq::Globals::SetMFIteration_ ( std::string  name)
inlinestatic

Set the current iteration for MessageFacility messages.

Parameters
nameThe current iteration

Definition at line 131 of file Globals.hh.

static void artdaq::Globals::SetMFModuleName_ ( std::string  name)
inlinestatic

Set the current module name for MessageFacility messages.

Parameters
nameThe current module name

Definition at line 141 of file Globals.hh.


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