IDS peak genericC++  v1.6.0
peak_environment_inspector.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
15 #include <peak/dll_interface/peak_dll_interface_util.hpp>
16 
17 #include <string>
18 #include <vector>
19 
20 
21 namespace peak
22 {
26 namespace core
27 {
28 
33 {
34 public:
35  EnvironmentInspector() = delete;
36  ~EnvironmentInspector() = delete;
37  EnvironmentInspector(const EnvironmentInspector& other) = delete;
38  EnvironmentInspector& operator=(const EnvironmentInspector& other) = delete;
41 
59  static std::vector<std::string> CollectCTIPaths();
60 };
61 
62 } /* namespace core */
63 } /* namespace peak */
64 
65 /* Implementation */
66 namespace peak
67 {
68 namespace core
69 {
70 
71 inline std::vector<std::string> EnvironmentInspector::CollectCTIPaths()
72 {
73  CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_EnvironmentInspector_UpdateCTIPaths(); });
74 
75  auto ctiPaths = QueryStringArrayFromCInterfaceFunction(
76  [&](size_t* numCtiPaths) {
78  },
79  [&](size_t index, char* ctiPath, size_t* ctiPathSize) {
80  return PEAK_C_ABI_PREFIX PEAK_EnvironmentInspector_GetCTIPath(index, ctiPath, ctiPathSize);
81  });
82 
83  return ctiPaths;
84 }
85 
86 } /* namespace core */
87 } /* namespace peak */
PEAK_C_API PEAK_EnvironmentInspector_UpdateCTIPaths()
Collects the paths to the CTIs installed on the system.
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
EnvironmentInspector & operator=(const EnvironmentInspector &other)=delete
PEAK_C_API PEAK_EnvironmentInspector_GetNumCTIPaths(size_t *numCtiPaths)
Asks for the number of CTI paths.
Allows to inspect the environment the application is running in.
Definition: peak_environment_inspector.hpp:32
static std::vector< std::string > CollectCTIPaths()
Collects producer library paths found in the current environment.
Definition: peak_environment_inspector.hpp:71
PEAK_C_API PEAK_EnvironmentInspector_GetCTIPath(size_t index, char *ctiPath, size_t *ctiPathSize)
Asks for the CTI path with the given index.
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16