ifw-ccf 6.0.0
 
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1
6
7#ifndef CCF_CONTROL_CONFIG_HPP_
8#define CCF_CONTROL_CONFIG_HPP_
9
11
12namespace ifw::ccf::control {
13
14 struct RecipeInfo {
15 std::string m_name;
16 std::string m_adapter;
17 };
18
20 std::string m_name;
21 std::string m_adapter;
22 };
23
24 struct PipelineInfo {
25 std::string m_pipeline;
28 std::map<std::string, RecipeInfo> m_recipes;
29 std::map<std::string, PublisherInfo> m_publishers;
30 };
31
35 public:
36
37 // Singleton instance.
39
41 static Config& Instance();
42
43
44 Config();
45 virtual ~Config();
46
48 void LoadConfig(const std::string& filename = "", bool reset = false);
49
51 int16_t GetNbOfProcThreads();
52
54 std::string GetProcThreadName(const uint16_t nb);
55
57 const std::vector<std::string>& GetProcThreadNames();
58
60 const PipelineInfo& GetPipelineInfo(const std::string& proc_thread_name);
61
63 const std::map<std::string, RecipeInfo>&
64 GetRecipesForProcThread(const std::string& proc_thread_name);
65
67 const std::map<std::string, PublisherInfo>&
68 GetPubsForProcThread(const std::string& proc_thread_name);
69
71 const PublisherInfo& GetPubInfo(const std::string& proc_thread_name,
72 const std::string& pub_thread_name);
73
74 private:
75 std::vector<std::string> m_proc_thread_names;
76 std::map<std::string, PipelineInfo> m_proc_thread_map;
77 };
78
80 inline Config& GetCfg() {
81 return Config::Instance();
82 }
83
84} // namespace ifw::ccf::control
85
86#endif // CCF_CONTROL_CONFIG_HPP_
Definition config.hpp:54
Provides access to the command line options and the configuration parameters stored in the configurat...
Definition config.hpp:34
static Config & Instance()
Return reference to unique instance of the configuration class.
Definition config.cpp:13
const PipelineInfo & GetPipelineInfo(const std::string &proc_thread_name)
Get pipeline (processing thread) info.
Definition config.cpp:112
const std::vector< std::string > & GetProcThreadNames()
Get the Processing Thread names.
Definition config.cpp:86
const PublisherInfo & GetPubInfo(const std::string &proc_thread_name, const std::string &pub_thread_name)
Get the info about the Publisher from the Processing and Publisher Thread numbers.
Definition config.cpp:121
static Config * s_instance
Definition config.hpp:38
const std::map< std::string, RecipeInfo > & GetRecipesForProcThread(const std::string &proc_thread_name)
Get Recipes defined for a given Processing Trhead.
Definition config.cpp:92
int16_t GetNbOfProcThreads()
Definition config.cpp:73
std::string GetProcThreadName(const uint16_t nb)
Get the Processing Thread name from the number.
Definition config.cpp:78
Config()
Definition config.cpp:20
virtual ~Config()
Definition config.cpp:24
void LoadConfig(const std::string &filename="", bool reset=false)
See ifw::core::utils::bat::Config.
Definition config.cpp:28
const std::map< std::string, PublisherInfo > & GetPubsForProcThread(const std::string &proc_thread_name)
Get the Processing Thread names.
Definition config.cpp:102
Definition acqThread.cpp:11
Config & GetCfg()
Return reference to the CCF Control Configuration object (Singleton instance).
Definition config.hpp:80
Definition config.hpp:24
bool m_allow_frame_skipping
Definition config.hpp:27
std::string m_pipeline
Definition config.hpp:25
std::map< std::string, PublisherInfo > m_publishers
Definition config.hpp:29
int8_t m_output_queue_size
Definition config.hpp:26
std::map< std::string, RecipeInfo > m_recipes
Definition config.hpp:28
Definition config.hpp:19
std::string m_name
Definition config.hpp:20
std::string m_adapter
Definition config.hpp:21
Definition config.hpp:14
std::string m_adapter
Definition config.hpp:16
std::string m_name
Definition config.hpp:15