|
gstreamer
|
Multithreaded example showing how to publish synthetic event data through the gstreamer module. More...
#include "gstreamer.h"#include "glogger.h"#include "gdynamicdigitization.h"#include "gutilities.h"#include "gthreads.h"#include <atomic>#include <ranges>#include <vector>#include <memory>#include <unordered_map>
Go to the source code of this file.
Functions | |
| void | run_simulation_in_threads (int nevents, int nthreads, const std::shared_ptr< GLogger > &log, const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > &dynamicRoutinesMap, const std::shared_ptr< GOptions > &gopts) |
| Run a synthetic multithreaded event loop and publish the results through configured streamers. | |
| int | main (int argc, char *argv[]) |
| Entry point for the multithreaded gstreamer example. | |
Variables | |
| const std::string | plugin_name = "test_gdynamic_plugin" |
Summary: This example creates one streamer map per worker thread, builds synthetic detector hits, digitizes them, publishes them through all configured streamers, and closes all outputs at the end of execution.
Related module documentation:
Typical command-line usage:
Definition in file gstreamer_example.cc.
| int main | ( | int | argc, |
| char * | argv[] ) |
Responsibilities:
| argc | Number of command-line arguments. |
| argv | Command-line argument vector. |
EXIT_SUCCESS on normal completion. Definition at line 152 of file gstreamer_example.cc.
| void run_simulation_in_threads | ( | int | nevents, |
| int | nthreads, | ||
| const std::shared_ptr< GLogger > & | log, | ||
| const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > & | dynamicRoutinesMap, | ||
| const std::shared_ptr< GOptions > & | gopts ) |
This function demonstrates the intended ownership and threading model of the gstreamer module:
Event construction flow:
"ctof" The example intentionally uses a compact synthetic dataset so the control flow remains easy to understand while still exercising the full event publication sequence.
| nevents | Total number of events to generate across all workers. |
| nthreads | Number of worker threads to launch. |
| log | Shared logger used for progress and diagnostic messages. |
| dynamicRoutinesMap | Dynamic digitization routines keyed by plugin name. |
| gopts | Parsed options container used to configure the module and dependent components. |
Definition at line 67 of file gstreamer_example.cc.
| const std::string plugin_name = "test_gdynamic_plugin" |
Definition at line 39 of file gstreamer_example.cc.