artdaq
v3_08_00
|
CommandableFragmentGenerator is a FragmentGenerator-derived abstract class that defines the interface for a FragmentGenerator designed as a state machine with start, stop, etc., transition commands. More...
#include <artdaq/Generators/CommandableFragmentGenerator.hh>
Classes | |
struct | Config |
Configuration of the CommandableFragmentGenerator. May be used for parameter validation More... | |
Public Types | |
using | Parameters = fhicl::WrappedTable< Config > |
Used for ParameterSet validation (if desired) | |
Public Member Functions | |
CommandableFragmentGenerator (const fhicl::ParameterSet &ps) | |
CommandableFragmentGenerator Constructor. More... | |
virtual | ~CommandableFragmentGenerator () |
CommandableFragmentGenerator Destructor. More... | |
void | joinThreads () |
Join any data-taking threads. Should be called when destructing CommandableFragmentGenerator. More... | |
bool | getNext (FragmentPtrs &output) overridefinal |
getNext calls either applyRequests or getNext_ to get any data that is ready to be sent to the EventBuilders More... | |
void | applyRequestsIgnoredMode (artdaq::FragmentPtrs &frags) |
Create fragments using data buffer for request mode Ignored. Precondition: dataBufferMutex_ and request_mutex_ are locked More... | |
void | applyRequestsSingleMode (artdaq::FragmentPtrs &frags) |
Create fragments using data buffer for request mode Single. Precondition: dataBufferMutex_ and request_mutex_ are locked More... | |
void | applyRequestsBufferMode (artdaq::FragmentPtrs &frags) |
Create fragments using data buffer for request mode Buffer. Precondition: dataBufferMutex_ and request_mutex_ are locked More... | |
void | applyRequestsWindowMode (artdaq::FragmentPtrs &frags) |
Create fragments using data buffer for request mode Window. Precondition: dataBufferMutex_ and request_mutex_ are locked More... | |
void | applyRequestsSequenceIDMode (artdaq::FragmentPtrs &frags) |
Create fragments using data buffer for request mode SequenceID. Precondition: dataBufferMutex_ and request_mutex_ are locked More... | |
void | applyRequestsWindowMode_CheckAndFillDataBuffer (artdaq::FragmentPtrs &frags, artdaq::Fragment::fragment_id_t id, artdaq::Fragment::sequence_id_t seq, artdaq::Fragment::timestamp_t ts) |
bool | applyRequests (FragmentPtrs &frags) |
See if any requests have been received, and add the corresponding data Fragment objects to the output list. More... | |
bool | sendEmptyFragment (FragmentPtrs &frags, size_t sequenceId, Fragment::fragment_id_t fragmentId, std::string desc) |
Send an EmptyFragmentType Fragment. More... | |
void | sendEmptyFragments (FragmentPtrs &frags, std::map< Fragment::sequence_id_t, Fragment::timestamp_t > &requests) |
This function is for Buffered and Single request modes, as they can only respond to one data request at a time If the request message seqID > ev_counter, simply send empties until they're equal. More... | |
void | checkSentWindows (Fragment::sequence_id_t seq) |
Check the windows_sent_ooo_ map for sequence IDs that may be removed. More... | |
void | startDataThread () |
Function that launches the data thread (getDataLoop()) | |
void | startMonitoringThread () |
Function that launches the monitoring thread (getMonitoringDataLoop()) | |
void | getDataLoop () |
When separate_data_thread is set to true, this loop repeatedly calls getNext_ and adds returned Fragment objects to the data buffer, blocking when the data buffer is full. | |
bool | waitForDataBufferReady (Fragment::fragment_id_t id) |
Wait for the data buffer to drain (dataBufferIsTooLarge returns false), periodically reporting status. More... | |
bool | dataBufferIsTooLarge (Fragment::fragment_id_t id) |
Test the configured constraints on the data buffer. More... | |
void | getDataBufferStats (Fragment::fragment_id_t id) |
Calculate the size of the dataBuffer and report appropriate metrics. More... | |
void | getDataBuffersStats () |
Calculate the size of all dataBuffers and report appropriate metrics. | |
void | checkDataBuffer (Fragment::fragment_id_t id) |
Perform data buffer pruning operations for the given buffer. If the RequestMode is Single, removes all but the latest Fragment from the data buffer. More... | |
void | checkDataBuffers () |
Perform data buffer pruning operations for all buffers. | |
std::map < Fragment::sequence_id_t, std::chrono::steady_clock::time_point > | GetSentWindowList (Fragment::fragment_id_t id) |
Get the map of Window-mode requests fulfilled by this Fragment Geneerator for the given Fragment ID. More... | |
void | getMonitoringDataLoop () |
This function regularly calls checkHWStatus_(), and sets the isHardwareOK flag accordingly. | |
std::vector < Fragment::fragment_id_t > | fragmentIDs () override |
Get the list of Fragment IDs handled by this CommandableFragmentGenerator. More... | |
size_t | ev_counter () const |
Get the current value of the event counter. More... | |
RequestMode | request_mode () const |
Get the current request mode of the CommandableFragmentGenerator More... | |
void | StartCmd (int run, uint64_t timeout, uint64_t timestamp) |
Start the CommandableFragmentGenerator. More... | |
void | StopCmd (uint64_t timeout, uint64_t timestamp) |
Stop the CommandableFragmentGenerator. More... | |
void | PauseCmd (uint64_t timeout, uint64_t timestamp) |
Pause the CommandableFragmentGenerator. More... | |
void | ResumeCmd (uint64_t timeout, uint64_t timestamp) |
Resume the CommandableFragmentGenerator. More... | |
std::string | ReportCmd (std::string const &which="") |
Get a report about a user-specified run-time quantity. More... | |
virtual std::string | metricsReportingInstanceName () const |
Get the name used when reporting metrics. More... | |
bool | exception () const |
Get the current value of the exception flag. More... | |
virtual bool | metaCommand (std::string const &command, std::string const &arg) |
The meta-command is used for implementing user-specific commands in a CommandableFragmentGenerator. More... | |
Protected Member Functions | |
int | run_number () const |
Get the current Run number. More... | |
int | subrun_number () const |
Get the current Subrun number. More... | |
uint64_t | timeout () const |
Timeout of last command. More... | |
uint64_t | timestamp () const |
Timestamp of last command. More... | |
artdaq::Fragment::fragment_id_t | fragment_id () const |
Get the Fragment ID of this Fragment generator. More... | |
bool | should_stop () const |
Get the current value of the should_stop flag. More... | |
bool | check_stop () |
Routine used by applyRequests to make sure that all outstanding requests have been fulfilled before returning. More... | |
int | board_id () const |
Gets the current board_id. More... | |
size_t | ev_counter_inc (size_t step=1, bool force=false) |
Increment the event counter, if the current RequestMode allows it. More... | |
void | set_exception (bool exception) |
Control the exception flag. More... | |
void | metricsReportingInstanceName (std::string const &name) |
Sets the name for metrics reporting. More... | |
std::string | printMode_ () |
Return the string representation of the current RequestMode. More... | |
size_t | dataBufferFragmentCount_ () |
Get the total number of Fragments in all data buffers. More... | |
std::map < artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t > | GetRequests () const |
Get the current requests being handled by this CommandableFragmentGenerator More... | |
std::pair < artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t > | GetNextRequest () const |
Get the next request (i.e. the request with the lowest sequence ID) to be handled by this CommandableFragmentGenerator More... | |
size_t | GetCurrentRequestCount () const |
Get the number of requests currently stored in the Request Recevier More... | |
virtual bool | getNext_ (FragmentPtrs &output)=0 |
Obtain the next group of Fragments, if any are available. Return false if readout cannot continue, if we are 'stopped', or if we are not running in state-machine mode. Note that getNext_() must return n of each fragmentID declared by fragmentIDs_(). More... | |
virtual bool | checkHWStatus_ () |
Check any relavent hardware status registers. Return false if an error condition exists that should halt data-taking. This function should probably make MetricManager calls. More... | |
virtual void | start ()=0 |
If a CommandableFragmentGenerator subclass is reading from a file, and start() is called, any run-, subrun-, and event-numbers in the data read from the file must be over-written by the specified run number, etc. After a call to StartCmd(), and until a call to StopCmd(), getNext_() is expected to return true as long as datataking is intended. More... | |
virtual void | stopNoMutex ()=0 |
On call to StopCmd, stopNoMutex() is called prior to StopCmd acquiring the mutex More... | |
virtual void | stop ()=0 |
If a CommandableFragmentGenerator subclass is reading from a file, calling stop() should arrange that the next call to getNext_() returns false, rather than allowing getNext_() to read to the end of the file. More... | |
virtual void | pauseNoMutex () |
On call to PauseCmd, pauseNoMutex() is called prior to PauseCmd acquiring the mutex More... | |
virtual void | pause () |
If a CommandableFragmentGenerator subclass is reading from hardware, the implementation of pause() should tell the hardware to stop sending data. More... | |
virtual void | resume () |
The subrun number will be incremented before a call to resume. More... | |
virtual std::string | report () |
Let's say that the contract with the report() functions is that they return a non-empty string if they have something useful to report, but if they don't know how to handle a given request, they simply return an empty string and the ReportCmd() takes care of saying "the xyz command is not currently supported". For backward compatibility, we keep the report function that takes no arguments and add one that takes a "which" argument. In the ReportCmd function, we'll call the more specific one first. More... | |
virtual std::string | reportSpecific (std::string const &what) |
Report the status of a specific quantity More... | |
Protected Attributes | |
std::mutex | mutex_ |
Mutex used to ensure that multiple transition commands do not run at the same time. | |
CommandableFragmentGenerator is a FragmentGenerator-derived abstract class that defines the interface for a FragmentGenerator designed as a state machine with start, stop, etc., transition commands.
Users of classes derived from CommandableFragmentGenerator will call these transitions via the publically defined StartCmd(), StopCmd(), etc.; these public functions contain functionality considered properly universal to all CommandableFragmentGenerator-derived classes, including calls to private virtual functions meant to be overridden in derived classes. The same applies to this class's implementation of the FragmentGenerator::getNext() pure virtual function, which is declared final (i.e., non-overridable in derived classes) and which itself calls a pure virtual getNext_() function to be implemented in derived classes.
State-machine related interface functions will be called only from a single thread. getNext() will be called only from a single thread. The thread from which state-machine interfaces functions are called may be a different thread from the one that calls getNext().
John F., 3/24/14
After some discussion with Kurt, CommandableFragmentGenerator has been updated such that it now contains a member vector fragment_ids_ ; if "fragment_id" is set in the FHiCL document controlling a class derived from CommandableFragmentGenerator, fragment_ids_ will be booked as a length-1 vector, and the value in this vector will be returned by fragment_id(). fragment_id() will throw an exception if the length of the vector isn't 1. If "fragment_ids" is set in the FHiCL document, then fragment_ids_ is filled with the values in the list which "fragment_ids" refers to, otherwise it is set to the empty vector (this is what should happen if the user sets the "fragment_id" variable in the FHiCL document, otherwise exceptions will end up thrown due to the logical conflict). If neither "fragment_id" nor "fragment_ids" is set in the FHiCL document, writers of classes derived from this one will be expected to override the virtual fragmentIDs() function with their own code (the CompositeDriver class is an example of this)
Definition at line 83 of file CommandableFragmentGenerator.hh.
|
explicit |
CommandableFragmentGenerator Constructor.
ps | ParameterSet used to configure CommandableFragmentGenerator. See artdaq::CommandableFragmentGenerator::Config. |
Definition at line 45 of file CommandableFragmentGenerator.cc.
|
virtual |
CommandableFragmentGenerator Destructor.
Joins all threads before returning
Definition at line 147 of file CommandableFragmentGenerator.cc.
bool artdaq::CommandableFragmentGenerator::applyRequests | ( | FragmentPtrs & | frags | ) |
See if any requests have been received, and add the corresponding data Fragment objects to the output list.
[out] | frags | list of FragmentPtr objects ready for transmission |
Definition at line 1130 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsBufferMode | ( | artdaq::FragmentPtrs & | frags | ) |
Create fragments using data buffer for request mode Buffer. Precondition: dataBufferMutex_ and request_mutex_ are locked
frags | Ouput fragments |
Definition at line 903 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsIgnoredMode | ( | artdaq::FragmentPtrs & | frags | ) |
Create fragments using data buffer for request mode Ignored. Precondition: dataBufferMutex_ and request_mutex_ are locked
frags | Ouput fragments |
Definition at line 846 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsSequenceIDMode | ( | artdaq::FragmentPtrs & | frags | ) |
Create fragments using data buffer for request mode SequenceID. Precondition: dataBufferMutex_ and request_mutex_ are locked
frags | Ouput fragments |
Definition at line 1075 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsSingleMode | ( | artdaq::FragmentPtrs & | frags | ) |
Create fragments using data buffer for request mode Single. Precondition: dataBufferMutex_ and request_mutex_ are locked
frags | Ouput fragments |
Definition at line 861 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsWindowMode | ( | artdaq::FragmentPtrs & | frags | ) |
Create fragments using data buffer for request mode Window. Precondition: dataBufferMutex_ and request_mutex_ are locked
frags | Ouput fragments |
Definition at line 1030 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::applyRequestsWindowMode_CheckAndFillDataBuffer | ( | artdaq::FragmentPtrs & | frags, |
artdaq::Fragment::fragment_id_t | id, | ||
artdaq::Fragment::sequence_id_t | seq, | ||
artdaq::Fragment::timestamp_t | ts | ||
) |
Copy data from the relevant data buffer that matches the given timestamp.
frags | Output Fragments |
id | Fragment ID of buffer to search |
seq | Sequence ID of output Fragment |
ts | Timestamp of output Fragment (used to determine window limits) |
Definition at line 952 of file CommandableFragmentGenerator.cc.
|
inlineprotected |
Gets the current board_id.
Definition at line 518 of file CommandableFragmentGenerator.hh.
|
protected |
Routine used by applyRequests to make sure that all outstanding requests have been fulfilled before returning.
Definition at line 289 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::checkDataBuffer | ( | Fragment::fragment_id_t | id | ) |
Perform data buffer pruning operations for the given buffer. If the RequestMode is Single, removes all but the latest Fragment from the data buffer.
id | Fragment ID of buffer In Window and Buffer RequestModes, this function discards the oldest Fragment objects until the data buffer is below its size constraints, then also checks for stale Fragments, based on the timestamp of the most recent Fragment. |
Definition at line 777 of file CommandableFragmentGenerator.cc.
|
protectedvirtual |
Check any relavent hardware status registers. Return false if an error condition exists that should halt data-taking. This function should probably make MetricManager calls.
Reimplemented in artdaqtest::CommandableFragmentGeneratorTest.
Definition at line 484 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::checkSentWindows | ( | Fragment::sequence_id_t | seq | ) |
Check the windows_sent_ooo_ map for sequence IDs that may be removed.
seq | Sequence ID of current window |
Definition at line 1240 of file CommandableFragmentGenerator.cc.
|
inlineprotected |
Get the total number of Fragments in all data buffers.
Definition at line 563 of file CommandableFragmentGenerator.hh.
bool artdaq::CommandableFragmentGenerator::dataBufferIsTooLarge | ( | Fragment::fragment_id_t | id | ) |
Test the configured constraints on the data buffer.
id | Fragment ID of data buffer |
Definition at line 739 of file CommandableFragmentGenerator.cc.
|
inline |
Get the current value of the event counter.
Definition at line 350 of file CommandableFragmentGenerator.hh.
|
protected |
Increment the event counter, if the current RequestMode allows it.
step | Amount to increment the event counter by |
force | Force incrementing the event Counter |
Definition at line 302 of file CommandableFragmentGenerator.cc.
|
inline |
Get the current value of the exception flag.
Definition at line 451 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Get the Fragment ID of this Fragment generator.
cet::exception("FragmentID") | if there is more that one Fragment ID configured for this Fragment Generator |
Definition at line 496 of file CommandableFragmentGenerator.hh.
|
inlineoverride |
Get the list of Fragment IDs handled by this CommandableFragmentGenerator.
Definition at line 334 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Get the number of requests currently stored in the Request Recevier
Definition at line 594 of file CommandableFragmentGenerator.hh.
void artdaq::CommandableFragmentGenerator::getDataBufferStats | ( | Fragment::fragment_id_t | id | ) |
Calculate the size of the dataBuffer and report appropriate metrics.
id | Fragment ID of buffer |
dataBufferMutex must be owned by the calling thread!
Definition at line 750 of file CommandableFragmentGenerator.cc.
|
finaloverride |
getNext calls either applyRequests or getNext_ to get any data that is ready to be sent to the EventBuilders
output | FragmentPtrs object containing Fragments ready for transmission |
Definition at line 164 of file CommandableFragmentGenerator.cc.
|
protectedpure virtual |
Obtain the next group of Fragments, if any are available. Return false if readout cannot continue, if we are 'stopped', or if we are not running in state-machine mode. Note that getNext_() must return n of each fragmentID declared by fragmentIDs_().
output | Reference to list of Fragment pointers to which additional Fragments should be added |
|
inlineprotected |
Get the next request (i.e. the request with the lowest sequence ID) to be handled by this CommandableFragmentGenerator
Definition at line 584 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Get the current requests being handled by this CommandableFragmentGenerator
Definition at line 574 of file CommandableFragmentGenerator.hh.
|
inline |
Get the map of Window-mode requests fulfilled by this Fragment Geneerator for the given Fragment ID.
id | Fragment ID of buffer |
This function is used in CommandableFragmentGenerator_t to verify correct functioning of Window mode
Definition at line 316 of file CommandableFragmentGenerator.hh.
void artdaq::CommandableFragmentGenerator::joinThreads | ( | ) |
Join any data-taking threads. Should be called when destructing CommandableFragmentGenerator.
Join any data-taking threads. Should be called when destructing CommandableFragmentGenerator Sets flags so that threads stop operations.
Definition at line 153 of file CommandableFragmentGenerator.cc.
|
virtual |
The meta-command is used for implementing user-specific commands in a CommandableFragmentGenerator.
command | Name of the command to run |
arg | Argument(s) for command |
Definition at line 490 of file CommandableFragmentGenerator.cc.
|
inlinevirtual |
Get the name used when reporting metrics.
Definition at line 426 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Sets the name for metrics reporting.
name | The new name for metrics reporting |
Definition at line 538 of file CommandableFragmentGenerator.hh.
|
protectedvirtual |
If a CommandableFragmentGenerator subclass is reading from hardware, the implementation of pause() should tell the hardware to stop sending data.
Reimplemented in artdaqtest::CommandableFragmentGeneratorTest, and artdaq::CompositeDriver.
Definition at line 463 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::PauseCmd | ( | uint64_t | timeout, |
uint64_t | timestamp | ||
) |
Pause the CommandableFragmentGenerator.
timeout | Timeout for transition |
timestamp | Timestamp of transition |
A call to PauseCmd() is advisory. It is an indication that the BoardReader should stop the incoming flow of data, if it can do so.
Definition at line 379 of file CommandableFragmentGenerator.cc.
|
protectedvirtual |
On call to PauseCmd, pauseNoMutex() is called prior to PauseCmd acquiring the mutex
Definition at line 458 of file CommandableFragmentGenerator.cc.
|
protected |
Return the string representation of the current RequestMode.
Definition at line 528 of file CommandableFragmentGenerator.cc.
|
protectedvirtual |
Let's say that the contract with the report() functions is that they return a non-empty string if they have something useful to report, but if they don't know how to handle a given request, they simply return an empty string and the ReportCmd() takes care of saying "the xyz command is not currently supported". For backward compatibility, we keep the report function that takes no arguments and add one that takes a "which" argument. In the ReportCmd function, we'll call the more specific one first.
Definition at line 472 of file CommandableFragmentGenerator.cc.
std::string artdaq::CommandableFragmentGenerator::ReportCmd | ( | std::string const & | which = "" | ) |
Get a report about a user-specified run-time quantity.
which | Which quantity to report |
CommandableFragmentGenerator only implements "latest_exception", a report on the last exception received. However, child classes can override the reportSpecific function to provide additional reports.
Definition at line 422 of file CommandableFragmentGenerator.cc.
|
protectedvirtual |
Report the status of a specific quantity
what | Name of the quantity to report |
Definition at line 478 of file CommandableFragmentGenerator.cc.
|
inline |
Get the current request mode of the CommandableFragmentGenerator
Definition at line 356 of file CommandableFragmentGenerator.hh.
|
protectedvirtual |
The subrun number will be incremented before a call to resume.
Reimplemented in artdaqtest::CommandableFragmentGeneratorTest, and artdaq::CompositeDriver.
Definition at line 468 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::ResumeCmd | ( | uint64_t | timeout, |
uint64_t | timestamp | ||
) |
Resume the CommandableFragmentGenerator.
timeout | Timeout for transition |
timestamp | Timestamp of transition |
After a call to ResumeCmd(), the next Fragments returned from getNext() will be part of a new SubRun.
Definition at line 393 of file CommandableFragmentGenerator.cc.
|
inlineprotected |
Get the current Run number.
Definition at line 474 of file CommandableFragmentGenerator.hh.
bool artdaq::CommandableFragmentGenerator::sendEmptyFragment | ( | FragmentPtrs & | frags, |
size_t | sequenceId, | ||
Fragment::fragment_id_t | fragmentId, | ||
std::string | desc | ||
) |
Send an EmptyFragmentType Fragment.
[out] | frags | Output list to append EmptyFragmentType to |
sequenceId | Sequence ID of Empty Fragment | |
fragmentId | Fragment ID of Empty Fragment | |
desc | Message to log with reasoning for sending Empty Fragment |
Definition at line 1213 of file CommandableFragmentGenerator.cc.
void artdaq::CommandableFragmentGenerator::sendEmptyFragments | ( | FragmentPtrs & | frags, |
std::map< Fragment::sequence_id_t, Fragment::timestamp_t > & | requests | ||
) |
This function is for Buffered and Single request modes, as they can only respond to one data request at a time If the request message seqID > ev_counter, simply send empties until they're equal.
[out] | frags | Output list to append EmptyFragmentType to |
requests | List of requests to process |
Definition at line 1224 of file CommandableFragmentGenerator.cc.
|
inlineprotected |
Control the exception flag.
exception | Whether an excpetion has occurred |
Definition at line 532 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Get the current value of the should_stop flag.
Definition at line 506 of file CommandableFragmentGenerator.hh.
|
protectedpure virtual |
If a CommandableFragmentGenerator subclass is reading from a file, and start() is called, any run-, subrun-, and event-numbers in the data read from the file must be over-written by the specified run number, etc. After a call to StartCmd(), and until a call to StopCmd(), getNext_() is expected to return true as long as datataking is intended.
This is a pure virtual function, and must be overriden by Fragment Generator implementations
Implemented in artdaqtest::CommandableFragmentGeneratorTest, and artdaq::CompositeDriver.
void artdaq::CommandableFragmentGenerator::StartCmd | ( | int | run, |
uint64_t | timeout, | ||
uint64_t | timestamp | ||
) |
Start the CommandableFragmentGenerator.
run | Run ID of the new run |
timeout | Timeout for transition |
timestamp | Timestamp of transition |
After a call to 'StartCmd', all Fragments returned by getNext() will be marked as part of a Run with the given run number, and with subrun number 1. Calling StartCmd also resets the event number to 1. After a call to StartCmd(), and until a call to StopCmd, getNext() – and hence the virtual function it calls, getNext_() – should return true as long as datataking is meant to take place, even if a particular call returns no fragments.
Definition at line 312 of file CommandableFragmentGenerator.cc.
|
protectedpure virtual |
If a CommandableFragmentGenerator subclass is reading from a file, calling stop() should arrange that the next call to getNext_() returns false, rather than allowing getNext_() to read to the end of the file.
This is a pure virtual function, and must be overriden by Fragment Generator implementations
Implemented in artdaqtest::CommandableFragmentGeneratorTest, and artdaq::CompositeDriver.
void artdaq::CommandableFragmentGenerator::StopCmd | ( | uint64_t | timeout, |
uint64_t | timestamp | ||
) |
Stop the CommandableFragmentGenerator.
timeout | Timeout for transition |
timestamp | Timestamp of transition |
After a call to StopCmd(), getNext() will eventually return false. This may not happen for several calls, if the implementation has data to be 'drained' from the system.
Definition at line 357 of file CommandableFragmentGenerator.cc.
|
protectedpure virtual |
On call to StopCmd, stopNoMutex() is called prior to StopCmd acquiring the mutex
This is a pure virtual function, and must be overriden by Fragment Generator implementations
Implemented in artdaqtest::CommandableFragmentGeneratorTest, and artdaq::CompositeDriver.
|
inlineprotected |
Get the current Subrun number.
Definition at line 479 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Timeout of last command.
Definition at line 484 of file CommandableFragmentGenerator.hh.
|
inlineprotected |
Timestamp of last command.
Definition at line 489 of file CommandableFragmentGenerator.hh.
bool artdaq::CommandableFragmentGenerator::waitForDataBufferReady | ( | Fragment::fragment_id_t | id | ) |
Wait for the data buffer to drain (dataBufferIsTooLarge returns false), periodically reporting status.
id | Fragment ID of data buffer |
Definition at line 664 of file CommandableFragmentGenerator.cc.