ctrlX Data Layer API for Python  3.3.0
The ctrlX Data Layer API allows access to the ctrlX Data Layer with Python
Provider Class Reference

Public Member Functions

def __init__ (self, C_DLR_PROVIDER c_provider)
 
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 
def close (self)
 
Variant get_token (self)
 
bool is_connected (self)
 
Result register_node (self, str address, ProviderNode node)
 
Result register_type (self, str address, str pathname)
 
Result register_type_variant (self, str address, Variant data)
 
Result set_timeout_node (self, ProviderNode node, int timeout_ms)
 
Result start (self)
 
Result stop (self)
 
Result unregister_node (self, str address)
 
Result unregister_type (self, str address)
 

Detailed Description

Definition at line 14 of file provider.py.

Member Function Documentation

◆ get_token()

Variant get_token (   self)

return the current token of the current request.You can call this function during your onRead, onWrite, ...

methods of your ProviderNodes. If there is no current request the method return an empty token

Returns
<Variant> current token

Definition at line 123 of file provider.py.

◆ is_connected()

bool is_connected (   self)

returns whether provider is connected

Returns
status of connection

Definition at line 116 of file provider.py.

◆ register_node()

Result register_node (   self,
str  address,
ProviderNode  node 
)

Register a node to the datalayer.

Parameters
[in]addressAddress of the node to register (wildcards allowed)
[in]nodeNode to register
Returns
<Result>, status of function call

Definition at line 74 of file provider.py.

◆ register_type()

Result register_type (   self,
str  address,
str  pathname 
)

Register a type to the datalayer.

Parameters
[in]addressAddress of the node to register (no wildcards allowed)
[in]pathnamePath to flatbuffer bfbs
Returns
<Result>, status of function call

Definition at line 54 of file provider.py.

◆ register_type_variant()

Result register_type_variant (   self,
str  address,
Variant  data 
)

Register a type to the datalayer.

Parameters
[in]addressAddress of the node to register (no wildcards allowed)
[in]dataVariant with flatbuffer type
Returns
<Result>, status of function call

Definition at line 132 of file provider.py.

◆ set_timeout_node()

Result set_timeout_node (   self,
ProviderNode  node,
int  timeout_ms 
)

Set timeout for a node for asynchron requests (default value is 1000ms)

Parameters
[in]nodeNode to set timeout for
[in]timeoutMSTimeout in milliseconds for this node
Returns
<Result>, status of function call

Definition at line 93 of file provider.py.

◆ start()

Result start (   self)

Start the provider.

Returns
<Result>, status of function call

Definition at line 102 of file provider.py.

◆ stop()

Result stop (   self)

Stop the provider.

Returns
<Result>, status of function call

Definition at line 109 of file provider.py.

Referenced by System.close().

◆ unregister_node()

Result unregister_node (   self,
str  address 
)

Unregister a node from the datalayer.

Parameters
[in]addressAddress of the node to register (wildcards allowed)
Returns
<Result>, status of function call

Definition at line 83 of file provider.py.

◆ unregister_type()

Result unregister_type (   self,
str  address 
)

Unregister a type from the datalayer.

Parameters
[in]addressAddress of the node to register (wildcards allowed)
Returns
<Result>, status of function call

Definition at line 64 of file provider.py.