ConnectionManager.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 # include <vector>
10 # include <string>
11 # include <Bentley\WString.h>
12 
13 #ifdef _EXPORT_IMODELCONNECTION_API_
14 #define IMODELIPC_API __declspec(dllexport)
15 #else
16 #define IMODELIPC_API __declspec(dllimport)
17 #endif
18 
19 #ifndef BEGIN_BENTLEY_IPC_NAMESPACE
20 #define BEGIN_BENTLEY_IPC_NAMESPACE namespace Bentley { namespace IPC {
21 #endif
22 
23 #ifndef END_BENTLEY_IPC_NAMESPACE
24 #define END_BENTLEY_IPC_NAMESPACE }}
25 #endif
26 
27 #ifndef USING_NAMESPACE_BENTLEY_IPC
28 #define USING_NAMESPACE_BENTLEY_IPC using namespace Bentley::IPC;
29 #endif
30 
32 
33 
45 typedef void (*ImodelCallback) ( wchar_t* );
47 
49 typedef std::vector< ImodelCallback > CallbackList;
50 
53  {
55  Success = 0,
58  };
59 
62  {
64  NewEngine = 0,
69 
84  };
85 
88  {
91  };
92 
93 
96 {
97 public:
98 
101  IMODELIPC_API void GetName ( Bentley::WString& name );
102 
105  IMODELIPC_API void GetDisplayName ( Bentley::WString& displayName );
106 
109  IMODELIPC_API void GetDisplayVersion ( Bentley::WString& displayVersion );
110 
113  IMODELIPC_API void GetVersion ( Bentley::WString& version );
114 
117  IMODELIPC_API void GetProgramPath ( Bentley::WString& programPath );
118 
121  IMODELIPC_API void GetProgramFullPath ( Bentley::WString& programFullPath );
122 
125  IMODELIPC_API void GetWorkspacePath ( Bentley::WString& workspacePath );
126 
127 
135  IMODELIPC_API int LoadApp ( Bentley::WString & appPath );
136 
137 
154  IMODELIPC_API int StartApp ( Bentley::WString const & KeyinString );
155 
159  IMODELIPC_API int SetCallback ( ImodelCallback callback );
160  };
161 
164 
165 
170  {
171 public:
172 
175  IMODELIPC_API static ConnectionManager* GetManagerObj ();
176 
178  IMODELIPC_API static void DeleteManagerObj ();
179 
182  IMODELIPC_API int DiscoverEngines ();
183 
187  IMODELIPC_API IModelEngine* GetEngine ( int index );
188 
201  IMODELIPC_API ConnectionStatus Connect ( IModelEngine* engine, Bentley::WString const & seedFile, bool connectGraphicalEngine = false );
202 
207  IMODELIPC_API int Disconnect ( IModelEngine* engine );
208  };
209 
IModelEngine * IModelEngineP
IModelEngine pointer.
Definition: ConnectionManager.h:163
Reason
Imodel connection Success/Error reasons.
Definition: ConnectionManager.h:61
This structure holds the connection status.
Definition: ConnectionManager.h:87
Error. New engine instance is not responding.
Definition: ConnectionManager.h:73
New instance of Engine.
Definition: ConnectionManager.h:64
Error. Connection already exist. For new connection user need to disconnect earlier connection...
Definition: ConnectionManager.h:79
void(* ImodelCallback)(wchar_t *)
User Message callback.
Definition: ConnectionManager.h:46
Error. Requested UI mode is different from running engine.
Definition: ConnectionManager.h:81
#define BEGIN_BENTLEY_IPC_NAMESPACE
Definition: ConnectionManager.h:20
Error. Running engine is not responsive.
Definition: ConnectionManager.h:75
Engine class.
Definition: ConnectionManager.h:95
Error, See the reason structure for detail error.
Definition: ConnectionManager.h:57
Status
Imodel connection status.
Definition: ConnectionManager.h:52
std::vector< ImodelCallback > CallbackList
Message callback list.
Definition: ConnectionManager.h:49
Error. Running engine is different from requested engine connect.
Definition: ConnectionManager.h:71
Graphical Engine is running.
Definition: ConnectionManager.h:66
IModel ConnectionManager.
Definition: ConnectionManager.h:169
Error starting new engine.
Definition: ConnectionManager.h:77
Status status
Definition: ConnectionManager.h:89
Successfully connected to the Engine.
Definition: ConnectionManager.h:55
#define END_BENTLEY_IPC_NAMESPACE
Definition: ConnectionManager.h:24
#define IMODELIPC_API
Definition: ConnectionManager.h:16
Non-Graphical Engine is running.
Definition: ConnectionManager.h:68
Error. Engine requested not found. Either Engine is not yet initialized or the Engine is not running ...
Definition: ConnectionManager.h:83
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Reason reason
status of connection
Definition: ConnectionManager.h:90

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.