|
|
| App () |
| | Default constructor.
|
| | App (const std::string &configuration_path) |
| | Constructor with custom configuration path.
|
|
virtual | ~App ()=default |
| | Virtual destructor.
|
| template<typename T> |
| bool | create_tap (const std::string &name) |
| | Creates a tap for publishing messages.
|
| template<typename T> |
| bool | publish_tap (const std::string &name, const T &message) |
| | Publishes a message to a tap.
|
| template<typename T> |
| bool | create_consumer_tap (const std::string &name, const std::function< void(const T &message)> &callback) |
| | Creates a consumer tap for receiving messages Tip: Don't do a lot of work in the callback, it will be called in a separate thread Instead, just queue the message for later processing.
|
| virtual bool | setup ()=0 |
| | Setup function to be implemented by derived classes.
|
| virtual bool | start () |
| | Starts the application.
|
|
virtual void | stop () |
| | Stops the application.
|
|
| virtual bool | setup_reader (const uint32_t node_id) |
| | Sets up the data reader.
|
| virtual bool | setup_publisher (const PublisherType &publisher_type, const std::string &publisher_endpoint) |
| | Sets up the data publisher.
|
| bool | load_device_configuration (const std::string &path) |
| | Loads device configuration from file.
|
| bool | enable_function_profiling (const std::chrono::milliseconds &period) |
| | Enables function profiling.
|
| void | start_profile (const std::string &name) |
| | Starts profiling a function.
|
| void | stop_profile (const std::string &name) |
| | Stops profiling a function.
|
| void | print_profile (const std::string &name) |
| | Prints profile information.
|
| bool | get_app_config (std::function< bool(const synapse::ApplicationNodeConfig &)> validator, synapse::ApplicationNodeConfig &output_config) |
| | Gets the application parameters from the device configuration.
|
|
void | disable_log_streaming () |
|
virtual void | main ()=0 |
| | Main loop to be implemented by derived classes.
|
|
|
std::atomic< bool > | node_running_ {false} |
| | Flag indicating if the node is running.
|
|
zmq::context_t | zmq_context_ |
| | ZMQ context for communication.
|
|
std::shared_ptr< synapse::ZMQDataReader > | data_reader_ {nullptr} |
| | Data reader for receiving data.
|
|
std::shared_ptr< synapse::DataPublisher > | data_publisher_ {nullptr} |
| | Data publisher for sending data.
|
|
TapManager | tap_manager_ |
| | Manager for handling taps.
|
|
std::shared_ptr< synapse::log::SynapseLogSink< std::mutex > > | log_sink_ {nullptr} |
| | Custom log sink for capturing and streaming application logs.
|
|
std::optional< uint64_t > | log_subscription_id_ {std::nullopt} |
| | ID for the log streaming subscription.
|
|
synapse::DeviceConfiguration | device_configuration_ |
| | Device configuration.
|
|
synapse::FunctionProfilerManager | function_profiler_manager_ |
| | Function profiler manager.
|
|
std::thread | function_profiling_thread_ |
| | Thread for function profiling.
|
|
std::atomic< bool > | function_profiling_enabled_ {false} |
| | Flag indicating if function profiling is enabled.
|
|
std::thread | main_loop_thread_ |
| | Thread for the main loop.
|
Base class for Synapse applications.
Provides core functionality for data reading/publishing, tap management, and performance profiling.