winIDEA SDK
|
This class contains information for connection to winIDEA.
Its methods return reference to self, so we can use it like this:
CConnectionConfig config = new CConnectionConfig(); config.udpDiscoveryPort(5534).instanceId("main");
All parameters are optional. Set only what is required, default values are used for unspecified parameters.
Python example: advanced_winidea_launching.py
#include <ConnectionMgr.h>
Public Member Functions | |
SPConnectionConfig | cmd_line (const std::string &rstr_cmd_line) |
Command line parameters for winIDEA. | |
SPConnectionConfig | cmdLineParams (const std::string &rstr_cmd_line) |
SPConnectionConfig | discoveryTime (uint32_t timeout_ms) |
This method sets the timeout for winIDEA pre-launch discovery. | |
SPConnectionConfig | exe_dir (const std::string &rstr_exe_dir) |
Sets directory, where winIDEA.exe is located. | |
IConnect::EExeType | get_exe_type () const |
Returns executable type (gui or command) | |
IConnect::ELaunchFlags | get_start () const |
Returns winIDEA start policy. | |
const std::string & | getCmdLineParams () const |
Returns command line parameters. | |
uint32_t | getDiscoveryTime () const |
Returns specified discovery wait time in ms. | |
const std::string & | getInstanceId () const |
Returns instanceId. | |
uint32_t | getProcessId () const |
Returns process id. | |
uint16_t | getTCPPort () const |
Returns TCP port. | |
int | getUdpDiscoveryPort () const |
Returns UDP discovery port. | |
IConnect::ELaunchFlags | getVisibility () const |
Returns winIDEA window visibility after startup. | |
IConnect::ELaunchFlags | getWaitTime () const |
Returns startup wait time. | |
const std::string & | getWorkspace () const |
Returns workspace path. | |
SPConnectionConfig | headless (bool b_headless) |
Determines whether winIDEA is started in headless mode. | |
SPConnectionConfig | host (const std::string &rstr_host, uint16_t w_TCP_port=0) |
Sets PC host and port of winIDEA to connect to. | |
SPConnectionConfig | instanceId (const std::string &rstr_instance_ID) |
Sets winIDEA instance ID. | |
bool | isUseIPCDiscovery () const |
Returns true, if IPC discovery should be used. | |
SPConnectionConfig | start (IConnect::ELaunchFlags eStart) |
Determines how to potentially start a new winIDEA instance. | |
SPConnectionConfig | start_always () |
Always start a new winIDEA instance. | |
SPConnectionConfig | start_existing () |
Connect to an existing winIDEA instance. | |
SPConnectionConfig | start_if_required () |
Start a new winIDEA instance if no existing is matching the connection criteria. | |
SPConnectionConfig | udpDiscoveryPort (uint16_t w_UDP_discovery_port) |
Sets UDP discovery port. | |
SPConnectionConfig | useIPCDiscovery (bool b_use_IPC_discovery) |
Locally running winIDEA instances will be discovered using local IPC discovery. | |
SPConnectionConfig | visibility (IConnect::ELaunchFlags e_visibility) |
Determines how the newly launched instance will start. | |
SPConnectionConfig | waitTime (IConnect::ELaunchFlags e_wait_time) |
Determines how long the isystem.connect should wait for newly launched instance to respond. | |
SPConnectionConfig | workspace (const std::string &rstrWorkspace) |
Sets winIDEA workspace. | |
SPConnectionConfig isys::CConnectionConfig::cmd_line | ( | const std::string & | rstr_cmd_line | ) |
Command line parameters for winIDEA.
This value is used to
(it is not used to search for an existing instance)
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cc = cc.cmd_line('-DEMO') >>> cmgr.connect(cc)
SPConnectionConfig isys::CConnectionConfig::cmdLineParams | ( | const std::string & | rstr_cmd_line | ) |
SPConnectionConfig isys::CConnectionConfig::discoveryTime | ( | uint32_t | timeout_ms | ) |
This method sets the timeout for winIDEA pre-launch discovery.
It is used when launch flag startIfRequired
is specified. The timout is used for the first enumeration, which tries to find out if requested winIDEA is already running. If it is not running, winIDEA is started, and then the second timeout set with waitTime()
is used to wait for the started winIDEA to be actually up and running, which takes more time than discovery of already running winIDEAs. Default value of 1s should be good for most cases, so this setting rarely needs adjustment.
timeout_ms | timeout in ms |
SPConnectionConfig isys::CConnectionConfig::exe_dir | ( | const std::string & | rstr_exe_dir | ) |
Sets directory, where winIDEA.exe
is located.
This value is used to start a new winIDEA instance. It is not used to search for an existing instance. Set it, when you want to start specific version of winIDEA.
IConnect::ELaunchFlags isys::CConnectionConfig::get_start | ( | ) | const |
Returns winIDEA start policy.
>>> cc = ic.CConnectionConfig() >>> cc = cc.start(ic.IConnect.lfStartExisting) >>> cc.get_start() & ic.IConnect.lfStartMask 3
const std::string & isys::CConnectionConfig::getCmdLineParams | ( | ) | const |
Returns command line parameters.
>>> cc = ic.CConnectionConfig() >>> cc = cc.cmd_line('-DEMO').getCmdLineParams() '-DEMO'
const std::string & isys::CConnectionConfig::getInstanceId | ( | ) | const |
Returns instanceId.
>>> cc = ic.CConnectionConfig() >>> cc.instanceId('sdk_demo_winideaID').getInstanceId() 'sdk_demo_winideaID'
uint32_t isys::CConnectionConfig::getProcessId | ( | ) | const |
Returns process id.
The id is set after call to findExistingInstance(), startNewInstance(), or findOrStartInstance(). It is valid only when different from 0.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc) >>> cc.getProcessId() != 0 True
uint16_t isys::CConnectionConfig::getTCPPort | ( | ) | const |
Returns TCP port.
The port is set after call to findExistingInstance(), startNewInstance(), or findOrStartInstance(). It is valid only when different from 0.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc) >>> cc.getTCPPort() != 0 True
int isys::CConnectionConfig::getUdpDiscoveryPort | ( | ) | const |
Returns UDP discovery port.
>>> cc = ic.CConnectionConfig() >>> cc.udpDiscoveryPort(5315).getUdpDiscoveryPort() 5315
IConnect::ELaunchFlags isys::CConnectionConfig::getVisibility | ( | ) | const |
Returns winIDEA window visibility after startup.
>>> cc = ic.CConnectionConfig() >>> cc = cc.visibility(ic.IConnect.lfShowHidden) >>> cc.getVisibility() & ic.IConnect.lfShowMask 768
IConnect::ELaunchFlags isys::CConnectionConfig::getWaitTime | ( | ) | const |
Returns startup wait time.
>>> cc = ic.CConnectionConfig() >>> cc = cc.waitTime(ic.IConnect.lfWait1s) >>> cc.getWaitTime() & ic.IConnect.lfWaitMask 64
const std::string & isys::CConnectionConfig::getWorkspace | ( | ) | const |
Returns workspace path.
>>> cc = ic.CConnectionConfig() >>> cc.workspace('path/to/the/workspace').getWorkspace() 'path/to/the/workspace'
SPConnectionConfig isys::CConnectionConfig::headless | ( | bool | b_headless | ) |
Determines whether winIDEA is started in headless mode.
No UI elements are available in this mode.
This value is used to
(it is not used to search for an existing instance)
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.headless(True))
SPConnectionConfig isys::CConnectionConfig::host | ( | const std::string & | rstr_host, |
uint16_t | w_TCP_port = 0 ) |
Sets PC host and port of winIDEA to connect to.
rstr_host | host name or IP address. If empty string is given, the local host is used to look for winIDEA. |
w_TCP_port | specifies the port to connect to. If it is not specified or specified with value 0, then discovery (enumeration) is performed and connection is made to:
|
Example:
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cc = cc.host('', 5315)
SPConnectionConfig isys::CConnectionConfig::instanceId | ( | const std::string & | rstr_instance_ID | ) |
Sets winIDEA instance ID.
This value is used to
Instance ID should not be provided in combination with launch flag flStartAlways to prevent launch of multiple instances with the same Id, will throw when launch is called.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cc = cc.instanceId('sdk_example_winIDEA_instanceID') >>> cmgr.connect(cc)
bool isys::CConnectionConfig::isUseIPCDiscovery | ( | ) | const |
Returns true, if IPC discovery should be used.
>>> cc = ic.CConnectionCongif() >>> cc.useIPCDiscovery(False).isUseIPCDiscovery() False
SPConnectionConfig isys::CConnectionConfig::start | ( | IConnect::ELaunchFlags | eStart | ) |
Determines how to potentially start a new winIDEA instance.
Only one of lfStart
flags from IConnect::ELaunchFlags may be specified. If lfStartAlways is provided, instance ID must not be specified (exception is thrown) to prevent launch of multiple instances with the same ID.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.start(ic.IConnect.lfStartExisting)) >>> cc.get_start() & ic.IConnect.lfStartMask 3
SPConnectionConfig isys::CConnectionConfig::start_always | ( | ) |
Always start a new winIDEA instance.
If this method is called, instance ID must not be specified (exception is thrown) to prevent launch of multiple instances with the same ID.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.start_always()) >>> cmgr.isConnected() True
SPConnectionConfig isys::CConnectionConfig::start_existing | ( | ) |
Connect to an existing winIDEA instance.
Never start new.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.start_if_required()) >>> cmgr.isConnected() True >>> cmgr.disconnect_keep() >>> cmgr.connect(cc.start_existing()) >>> cmgr.isConnected() True
SPConnectionConfig isys::CConnectionConfig::start_if_required | ( | ) |
Start a new winIDEA instance if no existing is matching the connection criteria.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.start_if_required()) >>> cmgr.isConnected() True
SPConnectionConfig isys::CConnectionConfig::udpDiscoveryPort | ( | uint16_t | w_UDP_discovery_port | ) |
Sets UDP discovery port.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cc.udpDiscoveryPort(5315).getUdpDiscoveryPort() 5315
SPConnectionConfig isys::CConnectionConfig::useIPCDiscovery | ( | bool | b_use_IPC_discovery | ) |
Locally running winIDEA instances will be discovered using local IPC discovery.
Change this setting only when instructed by TASKING support team.
>>> cc = ic.CConnectionCongif() >>> cc.useIPCDiscovery(False).isUseIPCDiscovery() False
SPConnectionConfig isys::CConnectionConfig::visibility | ( | IConnect::ELaunchFlags | e_visibility | ) |
Determines how the newly launched instance will start.
Only one of lfShowXXX
flags from IConnect::ELaunchFlags may be specified. Note: even if winIDEA is started hidden, UI elements are accessible via SDK
This value is used to
(it is not used to search for an existing instance)
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cmgr.connect(cc.visibility(ic.IConnect.lfShowHidden)) >>> cc.getVisibility() & ic.IConnect.lfShowMask 768
SPConnectionConfig isys::CConnectionConfig::waitTime | ( | IConnect::ELaunchFlags | e_wait_time | ) |
Determines how long the isystem.connect
should wait for newly launched instance to respond.
Only one of lfWaitXXX
flags from IConnect::ELaunchFlags may be specified.
>>> cmgr = ic.ConnectionMgr() >>> cc = ic.CConnectionConfig() >>> cc = cc.waitTime(ic.IConnect.lfWait1s) >>> cc.getWaitTime() & ic.IConnect.lfWaitMask 64 >>> cmgr.connect(cc)
SPConnectionConfig isys::CConnectionConfig::workspace | ( | const std::string & | rstrWorkspace | ) |
Sets winIDEA workspace.
This value is used to