ADTF
Loading...
Searching...
No Matches
macroresolver_intf.h
Go to the documentation of this file.
1
7#pragma once
9#include "string_intf.h"
10
11namespace adtf
12{
13namespace services
14{
15namespace macro
16{
17
19constexpr const char* const ADTF_ACTIVE_FILTERGRAPH_NAME = "ADTF_ACTIVE_FILTERGRAPH_NAME";
21constexpr const char* const ADTF_DIR = "ADTF_DIR";
23constexpr const char* const ADTF_GRAPH_DIR = "ADTF_GRAPH_DIR";
25constexpr const char* const ADTF_GRAPH_FILE_NAME = "ADTF_GRAPH_FILE_NAME";
27constexpr const char* const ADTF_GRAPH_FILE_NAME_NOEXT = "ADTF_GRAPH_FILE_NAME_NOEXT";
29constexpr const char* const ADTF_PLAYBACK_FILE_NAMES = "ADTF_PLAYBACK_FILE_NAMES";
31constexpr const char* const ADTF_PLAYBACK_FILE_NAMES_NOEXT = "ADTF_PLAYBACK_FILE_NAMES_NOEXT";
33constexpr const char* const ADTF_PLAYBACK_FILE_BASENAMES = "ADTF_PLAYBACK_FILE_BASENAMES";
35constexpr const char* const ADTF_PLAYBACK_FILE_BASENAMES_NOEXT = "ADTF_PLAYBACK_FILE_BASENAMES_NOEXT";
37constexpr const char* const ADTF_PLAYBACK_DIRS = "ADTF_PLAYBACK_DIRS";
39constexpr const char* const ADTF_REMOTE_CONTROL_URL = "ADTF_REMOTE_CONTROL_URL";
41constexpr const char* const ADTF_SESSION_DIR = "ADTF_SESSION_DIR";
43constexpr const char* const ADTF_SESSION_FILE_NAME = "ADTF_SESSION_FILE_NAME";
45constexpr const char* const ADTF_SESSION_FILE_NAME_NOEXT = "ADTF_SESSION_FILE_NAME_NOEXT";
48constexpr const char* const ADTF_SESSION_DATA_DIR = "ADTF_SESSION_DATA_DIR";
50constexpr const char* const ADTF_SYSTEM_DIR = "ADTF_SYSTEM_DIR";
52constexpr const char* const ADTF_SYSTEM_FILE_NAME = "ADTF_SYSTEM_FILE_NAME";
54constexpr const char* const ADTF_SYSTEM_FILE_NAME_NOEXT = "ADTF_SYSTEM_FILE_NAME_NOEXT";
58constexpr const char* const ADTF_RECORDER_DEFAULT_FILENAME_EXTENSION = "ADTF_RECORDER_DEFAULT_FILENAME_EXTENSION";
59
61constexpr const char* const THIS_OBJECT_NAME = "THIS_OBJECT_NAME";
63constexpr const char* const THIS_OBJECT_PARENT = "THIS_OBJECT_PARENT";
65constexpr const char* const THIS_OBJECT_FULL_NAME = "THIS_OBJECT_FULL_NAME";
66
67} // namespace macro
68
69namespace ant
70{
82{
83public:
85 ADTF_IID(IMacroResolver, "macroresolver.ant.base.adtf.iid");
86
87public:
92 {
93 MRF_None = 0x00,
95 };
96
97public:
111 virtual tResult ResolveMacros(const char* strSource, base::IString&& strResolvedString) = 0;
112
121 virtual tResult RegisterMacro(const char* strMacro, const char* strReplacement, uint32_t ui32Flags = 0) = 0;
122
129 virtual tResult UnregisterMacro(const char* strMacro) = 0;
130
134 virtual void Clear() = 0;
135};
136
147inline adtf::util::cString adtf_resolve_macros(const char* strString)
148{
150 if (_runtime)
151 {
152 _runtime->GetObject(pResolver);
153 }
154 adtf::util::cString strLocalString;
155 if (pResolver)
156 {
157 pResolver->ResolveMacros(strString, adtf_string_intf(strLocalString));
158 }
159 else
160 {
161 adtf::util::cMacroResolver oLocalResolver;
162 strLocalString = oLocalResolver.Resolve(adtf::util::cString(strString));
163 }
164 return strLocalString;
165}
166
177inline void adtf_register_macro(const char* strMacro, const char* strMacroString)
178{
180 if (_runtime)
181 {
182 _runtime->GetObject(pResolver);
183 }
184 if (pResolver)
185 {
186 pResolver->RegisterMacro(strMacro, strMacroString, IMacroResolver::tMacroResolverFlags::MRF_Overwrite);
187 }
188 else
189 {
190 adtf::util::cSystem::SetEnvVariable(strMacro, strMacroString);
191 }
192}
193
194} // namespace ant
195
196namespace thor
197{
198
203{
204public:
206 ADTF_IID(IMacroResolver, "macroresolver.thor.base.adtf.iid");
207
215 virtual void ListMacros(bool bIncludeEnvironmentVariables,
216 const ucom::nitro::ifunction<void(const char*, const char*, bool)>& fnCallback) const = 0;
217};
218
219} // namespace thor
220
221namespace vision
222{
227{
228public:
230 ADTF_IID(IMacroResolver, "macroresolver.vision.base.adtf.iid");
231
252 const base::IString& strSource,
253 const ucom::ifunction<bool(const base::IString& strMacro, base::IString&& strReplacement)>& fnOverride,
254 base::IString&& strResolvedString) = 0;
255};
256} // namespace vision
257
258namespace zebra
259{
264{
265public:
267 ADTF_IID(IMacroResolver, "macroresolver.zebra.base.adtf.iid");
268
281 virtual tResult ResolveFromStack(const char* strMacro, base::IString&& strResolvedValue) const noexcept = 0;
282};
283} // namespace zebra
284
288
289} // namespace services
290} // namespace adtf
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Definition string_intf.h:29
Definition macroresolver_intf.h:82
tMacroResolverFlags
Definition macroresolver_intf.h:92
@ MRF_Overwrite
Definition macroresolver_intf.h:94
@ MRF_None
Definition macroresolver_intf.h:93
virtual tResult ResolveMacros(const char *strSource, base::IString &&strResolvedString)=0
virtual tResult UnregisterMacro(const char *strMacro)=0
ADTF_IID(IMacroResolver, "macroresolver.ant.base.adtf.iid")
defintion of interace id
virtual tResult RegisterMacro(const char *strMacro, const char *strReplacement, uint32_t ui32Flags=0)=0
Definition macroresolver_intf.h:203
virtual void ListMacros(bool bIncludeEnvironmentVariables, const ucom::nitro::ifunction< void(const char *, const char *, bool)> &fnCallback) const =0
ADTF_IID(IMacroResolver, "macroresolver.thor.base.adtf.iid")
defintion of interace id
Definition macroresolver_intf.h:227
ADTF_IID(IMacroResolver, "macroresolver.vision.base.adtf.iid")
defintion of interace id
virtual tResult ResolveMacros(const base::IString &strSource, const ucom::ifunction< bool(const base::IString &strMacro, base::IString &&strReplacement)> &fnOverride, base::IString &&strResolvedString)=0
Definition macroresolver_intf.h:264
virtual tResult ResolveFromStack(const char *strMacro, base::IString &&strResolvedValue) const noexcept=0
ADTF_IID(IMacroResolver, "macroresolver.zebra.base.adtf.iid")
defintion of interace id
Definition object_ptr.h:384
Definition function_ptr.h:28
constexpr const char *const ADTF_SESSION_FILE_NAME
Resolves to the current .adtfsession file loaded without path (if loaded via adtfsession).
Definition macroresolver_intf.h:43
constexpr const char *const ADTF_SESSION_FILE_NAME_NOEXT
Resolves to the current .adtfsession file loaded without path and without extension (if loaded via ad...
Definition macroresolver_intf.h:45
constexpr const char *const ADTF_RECORDER_DEFAULT_FILENAME_EXTENSION
Resolves to the default filename extension provided by the used recorder processor,...
Definition macroresolver_intf.h:58
constexpr const char *const THIS_OBJECT_FULL_NAME
Resolves to the current full path name of an object (. separated). Only availiable in properties duri...
Definition macroresolver_intf.h:65
constexpr const char *const ADTF_REMOTE_CONTROL_URL
Resolves to the given RPC endpoint of the current ADTF System.
Definition macroresolver_intf.h:39
constexpr const char *const ADTF_SESSION_DATA_DIR
Resolves to the directory of the current session data (if loaded via adtfsession)....
Definition macroresolver_intf.h:48
constexpr const char *const ADTF_SYSTEM_DIR
Resolves to the directory of the current .adtfsystem file loaded (if loaded via adtfsystem).
Definition macroresolver_intf.h:50
constexpr const char *const ADTF_PLAYBACK_FILE_NAMES_NOEXT
Resolves to the filenames without the extension of the currently opened playback files,...
Definition macroresolver_intf.h:31
constexpr const char *const THIS_OBJECT_NAME
Resolves to the current current name of an object. Only availiable in properties during filter graph ...
Definition macroresolver_intf.h:61
constexpr const char *const ADTF_PLAYBACK_FILE_BASENAMES_NOEXT
Resolves to the basenames (filenames without directory components) without the extension of the curre...
Definition macroresolver_intf.h:35
constexpr const char *const ADTF_DIR
Resolves to your ADTF installation directory.
Definition macroresolver_intf.h:21
constexpr const char *const ADTF_GRAPH_FILE_NAME
Resolves to the current .adtfgraph file loaded without path (if loaded via adtfgraph).
Definition macroresolver_intf.h:25
constexpr const char *const ADTF_ACTIVE_FILTERGRAPH_NAME
Resolves to the name of the currently active filter graph.
Definition macroresolver_intf.h:19
constexpr const char *const ADTF_GRAPH_DIR
Resolves to the directory of the current .adtfgraph file loaded (if loaded via adtfgraph).
Definition macroresolver_intf.h:23
constexpr const char *const ADTF_PLAYBACK_FILE_NAMES
Resolves to the filenames of the currently opened playback files, separated by ';'.
Definition macroresolver_intf.h:29
constexpr const char *const ADTF_GRAPH_FILE_NAME_NOEXT
Resolves to the current .adtfgraph file loaded without path and without extension(if loaded via adtfg...
Definition macroresolver_intf.h:27
constexpr const char *const THIS_OBJECT_PARENT
Resolves to the current full path name of an objects parent (. separated). Only availiable in propert...
Definition macroresolver_intf.h:63
constexpr const char *const ADTF_PLAYBACK_FILE_BASENAMES
Resolves to the basenames (filenames without directory components) of the currently opened playback f...
Definition macroresolver_intf.h:33
constexpr const char *const ADTF_SYSTEM_FILE_NAME_NOEXT
Resolves to the current .adtfsystem file loaded without path and without extension (if loaded via adt...
Definition macroresolver_intf.h:54
constexpr const char *const ADTF_SESSION_DIR
Resolves to the directory of the current .adtfsession file loaded (if loaded via adtfsession).
Definition macroresolver_intf.h:41
constexpr const char *const ADTF_PLAYBACK_DIRS
Resolves to the directories that the currently opened playback files reside in, separated by ';'.
Definition macroresolver_intf.h:37
constexpr const char *const ADTF_SYSTEM_FILE_NAME
Resolves to the current .adtfsystem file loaded without path (if loaded via adtfsystem).
Definition macroresolver_intf.h:52
Namespace for all service interfaces provided since v3.0.
Definition rpc_object_server_registry_intf.h:82
void adtf_register_macro(const char *strMacro, const char *strMacroString)
Definition macroresolver_intf.h:177
adtf::util::cString adtf_resolve_macros(const char *strString)
Definition macroresolver_intf.h:147
Namespace for all service interfaces provided since v3.19.
Definition macroresolver_intf.h:197
Namespace for all service interfaces provided since v3.21.
Definition macroresolver_intf.h:222
Namespace for all service interfaces provided since v3.25.
Definition macroresolver_intf.h:259
Namespace for a summary of all service interfaces provided by ADTF.
Definition rpc_object_server_registry_intf.h:80
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Definition object_intf.h:109
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
#define adtf_string_intf(__string__)
Definition string_intf.h:465