OTX-Runtime for C++  
IRuntimeManager.h
1 #ifndef OpenTestSystem_Otx_Runtime_Api_IRuntimeManager_H
2 #define OpenTestSystem_Otx_Runtime_Api_IRuntimeManager_H
3 
4 #include "ApiDefs.h"
5 
6 #include "TraceLevels.h"
7 
8 #include "ExecutionStateChangeReason.h"
9 #include "ClampState.h"
10 #include "ExpectedState.h"
11 
12 #include <string>
13 #include <map>
14 #include <functional>
15 #include <memory>
16 
17 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace Otx {
18  class IProcedure;
20 }}}}}
22 
23 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace Project {
24  class IPlayerProject;
25  class IProject;
26 }}}}}
27 
28 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace DataTypes {
29  class Object;
30 }}}}}
31 
32 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace Custom {
37  class Ii18nImplementation;
42  class ISqlImplementation;
43 }}}}}
44 
45 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api {
46  class IRuntimeContext;
47  class DiagConnectionState;
48 }}}}
49 
53 namespace OpenTestSystem {
57  namespace Otx {
61  namespace Runtime {
65  namespace Api {
66 
67 
71  class API_EXPORTS IRuntimeManager
72  {
73  public:
74  virtual ~IRuntimeManager(){}
82  virtual bool IsProtected(const std::string& fileName) = 0;
83 
103  virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IProject> LoadPtx(const std::string& fileName) = 0;
104 
121  virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IProject> LoadPtx(const std::string& fileName, const std::string& password)= 0;
122 
142  virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject> LoadPpx(const std::string& fileName) = 0;
143 
160  virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject> LoadPpx(const std::string& fileName, const std::string& password) = 0;
161 
170  virtual std::shared_ptr<IRuntimeContext> Execute(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, unsigned long long timeout = 0) = 0;
171 
181  virtual std::shared_ptr<IRuntimeContext> Execute(const std::string & name, std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, unsigned long long timeout = 0) = 0;
182 
197  virtual std::shared_ptr<IRuntimeContext> Execute(const std::string& name, std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, ExpectedState expectedConnectionState, unsigned long long timeout = 0) = 0;
198 
205  virtual std::shared_ptr<IRuntimeContext> ExecuteAsync(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, unsigned long long timeout = 0) = 0;
206 
214  virtual std::shared_ptr<IRuntimeContext> ExecuteAsync(const std::string & name, std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, unsigned long long timeout = 0) = 0;
215 
230  virtual std::shared_ptr<IRuntimeContext> ExecuteAsync(const std::string& name, std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> procedure, ExpectedState expectedConnectionState, unsigned long long timeout = 0) = 0;
231 
236  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::IBasicScreenImplementation> implementation) = 0;
237 
242  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::ICustomScreenImplementation> implementation) = 0;
243 
248  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::IMeasureImplementation> implementation) = 0;
249 
254  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::ILoggingImplementation> implementation) = 0;
255 
260  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation> implementation) = 0;
261 
266  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::IContextVariableImplementation> implementation) = 0;
267 
272  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::IStateVariableImplementation> implementation) = 0;
273 
278  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::IExternalServiceProviderImplementation> implementation) = 0;
279 
284  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::ICommonDialogsImplementation> implementation) = 0;
285 
290  virtual void SetCustomImplementation(std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Custom::ISqlImplementation> implementation) = 0;
291 
296  virtual bool AddProcedureStartedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
297 
302  virtual bool RemoveProcedureStartedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
303 
308  virtual bool AddProcedureStoppedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
309 
314  virtual bool RemoveProcedureStoppedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
315 
320  virtual bool AddProcedureFinishedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
321 
326  virtual bool RemoveProcedureFinishedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
327 
332  virtual bool AddProcedureAbortedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
333 
338  virtual bool RemoveProcedureAbortedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
339 
344  virtual bool AddProcedureTimeoutListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
345 
350  virtual bool RemoveProcedureTimeoutListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
351 
356  virtual bool AddInOutParameterValueChangedListener(std::shared_ptr<std::function<void(const IRuntimeContext&, const IProcedureInOutParameter&)>> listener) = 0;
357 
362  virtual bool RemoveInOutParameterValueChangedListener(std::shared_ptr<std::function<void(const IRuntimeContext&, const IProcedureInOutParameter&)>> listener) = 0;
363 
401  virtual bool SetSearchPath(const std::string& path) = 0;
402 
407  virtual std::string GetSearchPath() = 0;
408 
412  virtual void StopAll() = 0;
413 
417  virtual std::shared_ptr<DiagConnectionState> GetDiagConnectionState() = 0;
418 
423  virtual bool AddProcedurePausedListener(std::shared_ptr<std::function<void(const IRuntimeContext&, ExecutionStateChangeReason)>> listener) = 0;
424 
429  virtual bool RemoveProcedurePausedListener(std::shared_ptr<std::function<void(const IRuntimeContext&, ExecutionStateChangeReason)>> listener) = 0;
430 
435  virtual bool AddProcedureContinuedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
436 
441  virtual bool RemoveProcedureContinuedListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
442 
447  virtual bool AddProcedurePendingListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
448 
453  virtual bool RemoveProcedurePendingListener(std::shared_ptr<std::function<void(const IRuntimeContext&)>> listener) = 0;
454 
459  virtual bool AddDiagConnectionStateChangedListener(std::shared_ptr<std::function<void(ClampState batteryState, ClampState ignitionState)>> listener) = 0;
460 
465  virtual bool RemoveDiagConnectionStateChangedListener(std::shared_ptr<std::function<void(ClampState batteryState, ClampState ignitionState)>> listener) = 0;
466  };
467 
468 }}}}
469 #endif
Allows users to implement their own basic Screens, consisting of ConfirmDialog, InputDialog,...
Definition: IBasicScreenImplementation.h:63
Allows users to implement their own common Dialogs, consisting of FileOpenDialog, FileSaveDialog,...
Definition: ICommonDialogsImplementation.h:20
Allows users to implement their own ContextVariables.
Definition: IContextVariableImplementation.h:29
Allows users to implement their own Screens.
Definition: ICustomScreenImplementation.h:33
Allows users to implement their own ExternalServiceProvider extension.
Definition: IExternalServiceProviderImplementation.h:47
Allows users to implement their own Logging extension.
Definition: ILoggingImplementation.h:92
Allows users to implement their own Measure extension.
Definition: IMeasureImplementation.h:23
Allows users to implement their own Sql extension.
Definition: ISqlImplementation.h:32
Allows users to implement their own StateVariables.
Definition: IStateVariableImplementation.h:32
Allows users to implement their own I18n extension.
Definition: Ii18nImplementation.h:22
Represents base of OTX DataTypes.
Definition: Object.h:17
The diagnostic connection state describes conditions how a procedure can be executed.
Definition: DiagConnectionState.h:21
Contains information of a Runner instance.
Definition: IRuntimeContext.h:30
Main class to load and execute an OTX project
Definition: IRuntimeManager.h:72
virtual bool AddProcedureStartedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure started listener.
virtual bool RemoveProcedureTimeoutListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure timeout listener.
virtual std::shared_ptr< IRuntimeContext > ExecuteAsync(const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
Executes a procedure asynchronously.
virtual std::string GetSearchPath()=0
Gets search path.
virtual std::shared_ptr< IRuntimeContext > ExecuteAsync(const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, ExpectedState expectedConnectionState, unsigned long long timeout=0)=0
Executes a procedure asynchronously at an expected connection state.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation > implementation)=0
Sets Ii18nImplementation.
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IProject > LoadPtx(const std::string &fileName, const std::string &password)=0
Loads a protected PTX file.
virtual std::shared_ptr< IRuntimeContext > Execute(const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, ExpectedState expectedConnectionState, unsigned long long timeout=0)=0
Executes a procedure synchronously at an expected connection state.
virtual bool RemoveProcedureAbortedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure aborted listener.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ISqlImplementation > implementation)=0
Sets ISqlImplementation.
virtual bool RemoveDiagConnectionStateChangedListener(std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>> listener)=0
Removes diagnostic connection state changed listener.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IMeasureImplementation > implementation)=0
Sets IMeasureImplementation.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IExternalServiceProviderImplementation > implementation)=0
Sets IExternalServiceProviderImplementation.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ILoggingImplementation > implementation)=0
Sets ILoggingImplementation.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IBasicScreenImplementation > implementation)=0
Sets BasicScreenImplementation.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IStateVariableImplementation > implementation)=0
Sets IStateVariableImplementation.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IContextVariableImplementation > implementation)=0
Sets IContextVariableImplementation.
virtual std::shared_ptr< IRuntimeContext > Execute(const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
Executes a procedure synchronously.
virtual bool RemoveProcedureFinishedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure finished listener.
virtual std::shared_ptr< DiagConnectionState > GetDiagConnectionState()=0
Get the diagnostic connection state.
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject > LoadPpx(const std::string &fileName, const std::string &password)=0
Loads a protected PPX file.
virtual bool AddProcedurePendingListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure pending listener.
virtual bool AddProcedureStoppedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure stopped listener.
virtual bool RemoveProcedureStartedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure started listener.
virtual bool RemoveProcedurePausedListener(std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>> listener)=0
Removes procedure paused listener.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICustomScreenImplementation > implementation)=0
Sets ICustomScreenImplementation.
virtual bool AddProcedureAbortedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure aborted listener.
virtual void SetCustomImplementation(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICommonDialogsImplementation > implementation)=0
Sets ICommonDialogsImplementation.
virtual bool AddInOutParameterValueChangedListener(std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>> listener)=0
Adds ProcedureInOutParameter value changed listener.
virtual bool SetSearchPath(const std::string &path)=0
Sets search path.
virtual bool AddProcedureContinuedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure continued listener.
virtual bool RemoveInOutParameterValueChangedListener(std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>> listener)=0
Removes ProcedureInOutParameter value changed listener.
virtual bool AddDiagConnectionStateChangedListener(std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>> listener)=0
Adds diagnostic connection state changed listener.
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IProject > LoadPtx(const std::string &fileName)=0
Loads a PTX file.
virtual std::shared_ptr< IRuntimeContext > Execute(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
Executes a procedure synchronously.
virtual bool IsProtected(const std::string &fileName)=0
Checks if a PTX/PPX is signed and/or encrypted.
virtual bool AddProcedurePausedListener(std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>> listener)=0
Adds procedure paused listener.
virtual bool RemoveProcedurePendingListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure pending listener.
virtual bool AddProcedureFinishedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure finished listener.
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject > LoadPpx(const std::string &fileName)=0
Loads a PPX file.
virtual std::shared_ptr< IRuntimeContext > ExecuteAsync(std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
Executes a procedure asynchronously.
virtual bool AddProcedureTimeoutListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Adds procedure timeout listener.
virtual bool RemoveProcedureStoppedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure stopped listener.
virtual bool RemoveProcedureContinuedListener(std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
Removes procedure continued listener.
virtual void StopAll()=0
Stops all synchronous and asynchronous executing procedures of this RuntimeManager.
Represents an OTX Procedure.
Definition: IProcedure.h:15
Represents InOutParameter of a Procedure. The parameter is identical to a related parameter in OTX st...
Definition: IProcedureInOutParameter.h:17
Contains Projects.
Definition: IPlayerProject.h:24
The Project is the root element of the OTX Data Structure. It mainly contains the Packages and the Pr...
Definition: IProject.h:41
Namespace for browsing at OTX data structure.
Definition: IRuntimeContext.h:12
ExecutionStateChangeReason
Reason, why a procedure execution state was changed, e.g. Paused or Running
Definition: ExecutionStateChangeReason.h:12
ClampState
Contains the state of a clamp
Definition: ClampState.h:12
ExpectedState
Contains the expected state of the diagnostic connection
Definition: ExpectedState.h:12
Namespace containing all objects related to testing inside automotive industry