Python API Reference

Python language bindings for iceoryx2.

class iceoryx2.ActiveRequest

Bases: object

The ActiveRequest represents the object that contains the payload that the Client sends to the Server.

delete()

Releases the ActiveRequest and terminates the connection.

After this call the ActiveRequest is no longer usable!

header

Returns the RequestHeader of the received RequestMut

is_connected

Returns True until the PendingResponse goes out of scope on the Client`s side indicating that the `Client no longer receives the ResponseMut.

loan_slice_uninit(number_of_elements: int) ResponseMutUninit

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

loan_uninit() ResponseMutUninit

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

origin

Returns the UniqueClientId of the Client

payload() Any

Returns a ctypes.POINTER to the requests payload.

payload_ptr

Returns a pointer to the payload of the received RequestMut.

send_copy(t: Type[ResT]) Any

Sends a copy of the provided type.

user_header() Any

Returns a ctypes.POINTER to the request header.

user_header_ptr

Returns a pointer to the user_header of the received RequestMut

class iceoryx2.Alignment

Bases: object

Contains the alignment memory can have.

static new(value)

Creates a new Alignment. If the value is zero or not a power of 2 it emits an InvalidAlignmentValue.

value()

Returns the value of the Alignment

class iceoryx2.AliveNodeView

Bases: object

Contains all details of a Node that is alive.

details

Returns optional NodeDetails that contains further information about the Node. Can only be acquired when the process has the access right to read it.

id

Returns the NodeId.

class iceoryx2.AllocationStrategy

Bases: object

Describes generically an AllocationStrategy, meaning how the memory is increased when the available memory is insufficient.

BestFit = AllocationStrategy.BestFit
PowerOfTwo = AllocationStrategy.PowerOfTwo
Static = AllocationStrategy.Static
class iceoryx2.Any(*args, **kwargs)[source]

Bases: object

Special type indicating an unconstrained type.

  • Any is compatible with every type.

  • Any assumed to have all methods.

  • All values assumed to be instances of Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks.

class iceoryx2.Attribute

Bases: object

Represents a single service attribute (key-value) pair that can be defined when the service is being created.

key

Acquires the service attribute key

static new(key, value)

Creates an attribute instance

value

Acquires the service attribute value

class iceoryx2.AttributeKey

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for AttributeKey.

static max_len()

Returns the maximum length of a AttributeKey

static new(value)

Creates a new AttributeKey when the provided value does not exceed AttributeKey.max_len(), otherwise it emits a SemanticStringError.

to_string()

Converts the AttributeKey into a String

class iceoryx2.AttributeSet

Bases: object

Represents a single service attribute (key-value) pair that can be defined when the service is being created.

static capacity()

Returns the maximum number of Attribute`s the `AttributeSet can hold.

key_values(key)

Returns all AttributeValue that belong to a specified AttributeKey.

number_of_attributes

Returns the number of Attribute`s stored inside the `AttributeSet.

values

Returns all Attribute`s stored in the `AttributeSet

class iceoryx2.AttributeSpecifier

Bases: object

Represents a single service attribute (key-value) pair that can be defined when the service is being created.

attributes

Returns the underlying AttributeSet

define(key, value)

Defines a value for a specific key. A key is allowed to have multiple values.

static new()

Creates a new empty set of `Attribute`s

class iceoryx2.AttributeValue

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for AttributeValue.

static max_len()

Returns the maximum length of a AttributeValue

static new(value)

Creates a new AttributeValue when the provided value does not exceed AttributeValue.max_len(), otherwise it emits a SemanticStringError.

to_string()

Converts the AttributeValue into a String

class iceoryx2.AttributeVerifier

Bases: object

Represents a single service attribute (key-value) pair that can be defined when the service is being created.

static new()

Creates a new empty set of `Attribute`s

require(key, value)

Requires a value for a specific key. A key is allowed to have multiple values.

require_key(key)

Requires that a specific key is defined.

required_attributes

Returns the underlying required AttributeSet

required_keys

Returns the underlying required keys

verify_requirements(rhs)

Verifies if the AttributeSet contains all required keys and key-value pairs. If it does not satisfy the requirements it returns the first

class iceoryx2.Client

Bases: object

Represents the receiving endpoint of an event based communication.

delete()

Releases the Client.

After this call the Client is no longer usable!

id

Returns the UniqueClientId of the Client

initial_max_slice_len()

Returns the maximum initial slice length configured for this Client.

loan_slice_uninit(number_of_elements: int) RequestMutUninit

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

loan_uninit() RequestMutUninit

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

send_copy(t: Type[ReqT]) PendingResponse

Sends a copy of the provided type.

unable_to_deliver_strategy

Returns the strategy the Client follows when a RequestMut cannot be delivered if the `Server`s buffer is full.

exception iceoryx2.ClientCreateError

Bases: Exception

Errors caused when creating a new client port.

exception iceoryx2.ConfigCreationError

Bases: Exception

Errors caused by creating a new config.

exception iceoryx2.ConnectionFailure

Bases: Exception

Errors caused a connection to an endpoint could not be established.

class iceoryx2.DeadNodeView

Bases: object

Contains all details of a Node that is dead.

details

Returns optional NodeDetails that contains further information about the Node. Can only be acquired when the process has the access right to read it.

id

Returns the NodeId.

remove_stale_resources()

Removes all stale resources of the dead Node. On error it emits a NodeCleanupFailure. It returns true if the stale resources could be removed, otherwise false.

class iceoryx2.Duration

Bases: object

Represents a time duration.

as_micros()

Returns the number of micro seconds stored in the Duration

as_millis()

Returns the number of milli seconds stored in the Duration

as_nanos()

Returns the number of nano seconds stored in the Duration

as_secs()

Returns the number of seconds stored in the Duration

as_secs_f64()

Returns the number of seconds stored in the Duration

static from_micros(micros)

Creates a new Duration from a given number of micro seconds

static from_millis(millis)

Creates a new Duration from a given number of milli seconds

static from_nanos(nanos)

Creates a new Duration from a given number of nano seconds

static from_secs(secs)

Creates a new Duration from a given number of seconds

static from_secs_f64(secs)

Creates a new Duration from a given number of seconds

subsec_micros()

Returns the fractional micro seconds part stored in the Duration

subsec_millis()

Returns the fractional milli seconds part stored in the Duration

subsec_nanos()

Returns the fractional nano seconds part stored in the Duration

exception iceoryx2.EventCreateError

Bases: Exception

Errors caused when creating an event service.

class iceoryx2.EventId

Bases: object

User defined identifier that can be provided in Notifier.notify() to signal a specific kind of event.

as_value

Returns the integer value of the EventId

static new(value)

Creates a new EventId from a given integer value

exception iceoryx2.EventOpenError

Bases: Exception

Errors caused when opening an event service.

exception iceoryx2.EventOpenOrCreateError

Bases: Exception

Errors caused when open or creating an event service.

class iceoryx2.FileName

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for FileName. All modification operations ensure that never an invalid file or path name can be generated. All strings have a fixed size so that the maximum path or file name length the system supports can be stored.

static max_len()

Returns the maximum length of a FileName

static new(name)

Creates a new FileName when the provided name contains a valid path to a file, otherwise it emits a SemanticStringError.

to_string()

Converts the FileName into a String

class iceoryx2.FilePath

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for FilePath. All modification operations ensure that never an invalid file or path name can be generated. All strings have a fixed size so that the maximum path or file name length the system supports can be stored.

static max_len()

Returns the maximum length of a FilePath

static new(name)

Creates a new FilePath when the provided name contains a valid path to a file, otherwise it emits a SemanticStringError.

to_string()

Converts the FilePath into a String

class iceoryx2.HeaderPublishSubscribe

Bases: object

Sample header used by MessagingPattern::PublishSubscribe

node_id

Returns the NodeId of the source node that published the Sample.

number_of_elements

Returns how many elements are stored inside the Sample’s payload.

publisher_id

Returns the UniquePublisherId of the source Publisher.

exception iceoryx2.InvalidAlignmentValue

Bases: Exception

Errors caused when the value of the alignment is not a power of two or exceeds the maximum supported value.

class iceoryx2.Listener

Bases: object

Represents the receiving endpoint of an event based communication.

blocking_wait_all()

Blocking wait for new EventId`s. Unblocks as soon as an `EventId was received and then collects all EventId`s that were received and calls the provided callback is with the `EventId as input argument. On error it emits ListenerWaitError.

blocking_wait_one()

Blocking wait for a new EventId. Sporadic wakeups can occur and if no EventId was notified it returns None. On error it emits ListenerWaitError.

deadline

Returns the deadline of the corresponding Service.

delete()

Releases the Listener.

After this call the Listener is no longer usable!

id

Returns the UniqueListenerId of the Listener

timed_wait_all(timeout)

Blocking wait for new EventId`s until the provided timeout has passed. Unblocks as soon as an `EventId was received and then collects all EventId`s that were received and calls the provided callback is with the `EventId as input argument. On error it emits ListenerWaitError.

timed_wait_one(timeout)

Blocking wait for a new EventId until either an EventId was received or the timeout has passed. If no EventId was notified it returns None. On error it emits ListenerWaitError.

try_wait_all()

Non-blocking wait for new EventId`s. Collects all `EventId`s that were received and calls the provided callback is with the `EventId as input argument. On error it emits ListenerWaitError.

try_wait_one()

Non-blocking wait for a new EventId. If no EventId was notified it returns None. On error it emits ListenerWaitError.

exception iceoryx2.ListenerCreateError

Bases: Exception

Errors caused when creating a new Listener port.

exception iceoryx2.ListenerWaitError

Bases: Exception

Errors caused when waiting on a Listener port in an event service.

exception iceoryx2.LoanError

Bases: Exception

Errors caused when loaning memory from a ports datasegment.

class iceoryx2.LogLevel

Bases: object

Describes the log level.

Debug = LogLevel.Debug
Error = LogLevel.Error
Fatal = LogLevel.Fatal
Info = LogLevel.Info
Trace = LogLevel.Trace
Warn = LogLevel.Warn
class iceoryx2.MessageTypeDetails

Bases: object

Contains all type information to the header and payload type.

header

The TypeDetail of the header of a message, the first iceoryx2 internal part.

payload

The TypeDetail of the payload of the message, the last part.

user_header

The TypeDetail of the user_header or the custom header, is located directly after the header.

class iceoryx2.MessagingPattern

Bases: object

Blackboard = MessagingPattern.Blackboard
Event = MessagingPattern.Event
PublishSubscribe = MessagingPattern.PublishSubscribe
RequestResponse = MessagingPattern.RequestResponse
class iceoryx2.Node

Bases: object

The central entry point of iceoryx2. Represents a node of the iceoryx2 system. One process can have arbitrary many nodes but usually it should be only one node per process. Can be created via the NodeBuilder.

static cleanup_dead_nodes(service_type, config)

Removes the stale system resources of all dead `Node`s. The dead `Node`s are also removed from all registered `Service`s.

If a Node cannot be cleaned up since the process has insufficient permissions then the Node is skipped.

config

Returns the Config that the Node will use to create any iceoryx2 entity.

id

Returns the unique id of the Node.

static list(service_type, config)

Returns a list of NodeState`s of all `Node`s under a provided config. On failure it emits a `NodeListFailure.

name

Returns the name of the node inside a NodeName.

service_builder(name)

Instantiates a ServiceBuilder for a service with the provided name.

signal_handling_mode

Returns the SignalHandlingMode with which the Node was created.

wait(cycle_time)

Waits for a given cycle_time. On failure it emits a NodeWaitFailure.

class iceoryx2.NodeBuilder

Bases: object

Creates a new Node.

config(config)

The Config that shall be used for the Node. If no Config is specified the config.global_config() is used.

create(service_type)

Creates a new Node for a specified ServiceType. Emits NodeCreationFailure on failure.

name(value)

The NodeName that shall be assigned to the Node. It does not have to be unique. If no NodeName is defined then the Node does not have a name.

static new()

Instantiates a new NodeBuilder

signal_handling_mode(value)

Defines the SignalHandlingMode for the Node. It affects the Node.wait() call that returns any received signal via its NodeWaitFailure

exception iceoryx2.NodeCleanupFailure

Bases: Exception

Errors caused by cleaning up the stale resources of a dead node.

exception iceoryx2.NodeCreationFailure

Bases: Exception

Errors caused by creating a new node.

class iceoryx2.NodeDetails

Bases: object

Contains details of a Node.

config

Returns a reference to the Config the Node uses.

executable

Returns the executable FileName of the `Node`s owner process.

name

Returns a reference of the NodeName.

class iceoryx2.NodeId

Bases: object

The system-wide unique id of a Node

pid

Returns the process id of the process that owns the Node.

value

Returns the underlying integer value of the NodeId.

exception iceoryx2.NodeListFailure

Bases: Exception

Errors caused when listing all nodes.

class iceoryx2.NodeName

Bases: object

Represent the name for a Node.

as_str()

Converts the NodeName into a String

static max_len()

Returns the maximum length of a NodeName

static new(name)

Creates a new NodeName. If the provided name does not contain a valid NodeName it will emit SemanticStringError, otherwise the NodeName.

class iceoryx2.NodeState

Bases: object

Describes the state of a Node.

Alive

alias of NodeState_Alive

Dead

alias of NodeState_Dead

Inaccessible

alias of NodeState_Inaccessible

Undefined

alias of NodeState_Undefined

exception iceoryx2.NodeWaitFailure

Bases: Exception

Errors caused when waiting on a node.

class iceoryx2.Notifier

Bases: object

Represents the sending endpoint of an event based communication.

deadline

Returns the deadline of the corresponding Service.

delete()

Releases the Notifier.

After this call the Notifier is no longer usable!

id

Returns the UniqueNotifierId of the Notifier

notify()

Notifies all Listener connected to the service with the default event id provided on creation. Returns on success the number of Listener`s that were notified otherwise it emits `NotifierNotifyError.

notify_with_custom_event_id(event_id)

Notifies all Listener connected to the service with a custom EventId. Returns on success the number of Listener`s that were notified otherwise it returns `NotifierNotifyError.

exception iceoryx2.NotifierCreateError

Bases: Exception

Errors caused when creating a new Notifier port.

exception iceoryx2.NotifierNotifyError

Bases: Exception

Errors caused when sending a notification via the Notifier port in an event service.

class iceoryx2.Path

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for Path. All modification operations ensure that never an invalid file or path name can be generated. All strings have a fixed size so that the maximum path or file name length the system supports can be stored.

static max_len()

Returns the maximum length of a Path

static new(name)

Creates a new Path when the provided name contains a valid path, otherwise it emits a SemanticStringError.

to_string()

Converts the Path into a String

class iceoryx2.PendingResponse

Bases: object

Represents an active connection to all Server that received the RequestMut. The Client can use it to receive the corresponding `Response`s.

As soon as it goes out of scope, the connections are closed and the `Server`s are informed.

delete()

Releases the PendingResponse and signals the Server that the Client is no longer interested in receiving any more `Response`s and terminates the connection.

After this call the PendingResponse is no longer usable!

has_response()

Returns True when a Server has sent a Response otherwise False.

header()

Returns a reference to the iceoryx2 internal RequestHeader of the corresponding RequestMut

is_connected()

Returns True until the ActiveRequest goes out of scope on the Server`s side indicating that the `Server will no longer send Response`s. It also returns `False when there are no Server.

number_of_server_connections()

Returns how many Server`s received the corresponding `RequestMut initially.

payload() Any

Returns a ctypes.POINTER to the requests payload.

payload_ptr()

Returns a pointer to the request payload of the corresponding RequestMut

receive()

Receives a Response from one of the Server`s that received the `RequestMut.

user_header() Any

Returns a ctypes.POINTER to the request header.

user_header_ptr()

Returns a pointer to the user defined request header of the corresponding RequestMut

class iceoryx2.PortFactoryClient

Bases: object

Factory to create a new Client port/endpoint for MessagingPattern::RequestResponse based communication.

allocation_strategy(value: AllocationStrategy) PortFactoryClient

Defines the allocation strategy that is used when the memory is exhausted.

create()

Creates a new Client or emits a ClientCreateError on failure.

initial_max_slice_len(value: int) PortFactoryClient

Sets the maximum slice length that a user can allocate.

unable_to_deliver_strategy(value)

Sets the UnableToDeliverStrategy which defines how the Client shall behave when a Server cannot receive a RequestMut since its internal buffer is full.

class iceoryx2.PortFactoryEvent

Bases: object

The factory for MessagingPattern::Event. It can acquire dynamic and static service informations and create Notifier or Listener ports.

attributes

Returns the AttributeSet defined in the Service

listener_builder()

Returns a PortFactoryListener to create a new Listener port

name

Returns the ServiceName of the service

nodes

Returns a list of all NodeState of all the Node`s which have opened the `Service.

notifier_builder()

Returns a PortFactoryNotifier to create a new Notifier port

service_id

Returns the ServiceId of the Service

static_config

Returns the StaticConfig of the Service. Contains all settings that never change during the lifetime of the service.

class iceoryx2.PortFactoryListener

Bases: object

Factory to create a new Listener port/endpoint for MessagingPattern::Event based communication.

create()

Creates the Listener port or emits a ListenerCreateError on failure.

class iceoryx2.PortFactoryNotifier

Bases: object

Factory to create a new Notifier port/endpoint for MessagingPattern::Event based communication.

create()

Creates a new Notifier port or emits a NotifierCreateError on failure.

default_event_id(value)

Sets a default EventId for the Notifier that is used in Notifier.notify()

class iceoryx2.PortFactoryPublishSubscribe

Bases: object

The factory for MessagingPattern::PublishSubscribe. It can acquire dynamic and static service informations and create Publisher or Subscriber ports.

attributes

Returns the AttributeSet defined in the Service

name

Returns the ServiceName of the service

nodes

Returns a list of all NodeState of all the Node`s which have opened the `Service.

publisher_builder()

Returns a PortFactoryPublisher to create a new Publisher port

service_id

Returns the ServiceId of the Service

static_config

Returns the StaticConfig of the Service. Contains all settings that never change during the lifetime of the service.

subscriber_builder()

Returns a PortFactorySubscriber to create a new Subscriber port

class iceoryx2.PortFactoryPublisher

Bases: object

Factory to create a new Publisher port/endpoint for MessagingPattern::PublishSubscribe based communication.

allocation_strategy(value: AllocationStrategy) PortFactoryPublisher

Defines the allocation strategy that is used when the memory is exhausted.

create()

Creates a new Publisher or emits a PublisherCreateError on failure.

initial_max_slice_len(value: int) PortFactoryPublisher

Sets the maximum slice length that a user can allocate.

max_loaned_samples(value)

Defines how many SampleMut the Publisher can loan with Publisher::loan() or Publisher::loan_uninit() in parallel.

unable_to_deliver_strategy(value)

Sets the UnableToDeliverStrategy.

class iceoryx2.PortFactoryRequestResponse

Bases: object

The factory for MessagingPattern::RequestResponse. It can acquire dynamic and static service informations and create Client or Server ports.

attributes

Returns the AttributeSet defined in the Service

client_builder()

Returns a PortFactoryClient to create a new Client port

name

Returns the ServiceName of the service

nodes

Returns a list of all NodeState of all the Node`s which have opened the `Service.

server_builder()

Returns a PortFactoryServer to create a new Server port

service_id

Returns the ServiceId of the Service

static_config

Returns the StaticConfig of the Service. Contains all settings that never change during the lifetime of the service.

class iceoryx2.PortFactoryServer

Bases: object

Factory to create a new Server port/endpoint for MessagingPattern::RequestResponse based communication.

allocation_strategy(value: AllocationStrategy) PortFactoryServer

Defines the allocation strategy that is used when the memory is exhausted.

create()

Creates a new Server or emits a ServerCreateError on failure.

initial_max_slice_len(value: int) PortFactoryServer

Sets the maximum slice length that a user can allocate.

max_loaned_responses_per_request(value)

Defines the maximum number of ResponseMut that the Server can loan in parallel per ActiveRequest.

unable_to_deliver_strategy(value)

Sets the UnableToDeliverStrategy which defines how the Server shall behave when a Client cannot receive a Response since its internal buffer is full.

class iceoryx2.PortFactorySubscriber

Bases: object

Factory to create a new Subscriber port/endpoint for MessagingPattern::PublishSubscribe based communication.

buffer_size(value)

Defines the buffer size of the Subscriber. Smallest possible value is 1.

create()

Creates a new Subscriber or emits a SubscriberCreateError on failure.

exception iceoryx2.PublishSubscribeCreateError

Bases: Exception

Errors caused when creating a publish-subscribe service.

exception iceoryx2.PublishSubscribeOpenError

Bases: Exception

Errors caused when opening a publish-subscribe service.

exception iceoryx2.PublishSubscribeOpenOrCreateError

Bases: Exception

Errors caused when open or creating a publish-subscribe service.

class iceoryx2.Publisher

Bases: object

Represents the receiving endpoint of an event based communication.

delete()

Releases the Publisher.

After this call the Publisher is no longer usable!

id

Returns the UniquePublisherId of the Publisher

initial_max_slice_len

Returns the maximum initial slice length configured for this Publisher.

loan_slice_uninit(number_of_elements: int) SampleMutUninit

Loans/allocates a SampleMutUninit from the underlying data segment of the Publisher.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

loan_uninit() SampleMutUninit

Loans/allocates a SampleMutUninit from the underlying data segment of the Publisher.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

send_copy(t: Type[T]) Any

Sends a copy of the provided type.

unable_to_deliver_strategy

Returns the strategy the Publisher follows when a SampleMut cannot be delivered since the `Subscriber`s buffer is full.

exception iceoryx2.PublisherCreateError

Bases: Exception

Errors caused when creating a publisher port.

exception iceoryx2.ReceiveError

Bases: Exception

Errors caused when receiving data.

class iceoryx2.RequestHeader

Bases: object

Request header used by MessagingPattern::RequestResponse

client_id

Returns the UniqueClientId of the Client which sent the RequestMut

number_of_elements

Returns how many elements are stored inside the requests’s payload.

class iceoryx2.RequestMut

Bases: object

The RequestMut represents the object that contains the payload that the Client sends to the Server.

delete()

Releases the RequestMut.

After this call the RequestMut is no longer usable!

header

Returns the iceoryx2 internal RequestHeader

payload() Any

Returns a ctypes.POINTER to the requests payload.

payload_ptr

Returns a pointer to the user defined request payload.

send()

Sends the RequestMut to all connected Server`s of the `Service.

user_header() Any

Returns a ctypes.POINTER to the request header.

user_header_ptr

Returns a pointer to the user defined request header.

class iceoryx2.RequestMutUninit

Bases: object

A version of the RequestMut where the payload is not initialized which allows true zero copy usage. To send a RequestMutUninit it must be first initialized and converted into RequestMut with RequestMutUninit::assume_init().

assume_init()

When the payload is manually populated by using RequestMutUninit::payload_ptr(), then this function can be used to convert it into the initialized RequestMut version.

delete()

Releases the RequestMutUninit.

After this call the RequestMutUninit is no longer usable!

header

Returns the iceoryx2 internal RequestHeader

payload() Any

Returns a ctypes.POINTER to the requests payload.

payload_ptr

Returns a pointer to the user defined request payload.

user_header() Any

Returns a ctypes.POINTER to the request header.

user_header_ptr

Returns a pointer to the user defined request header.

write_payload(t: Type[ReqT]) RequestMut

Writes the provided payload into the request.

exception iceoryx2.RequestResponseCreateError

Bases: Exception

Errors caused when creating a request-response service.

exception iceoryx2.RequestResponseOpenError

Bases: Exception

Errors caused when opening a request-response service.

exception iceoryx2.RequestResponseOpenOrCreateError

Bases: Exception

Errors caused when open or creating a request-response service.

exception iceoryx2.RequestSendError

Bases: Exception

Errors caused when sending a request.

class iceoryx2.Response

Bases: object

It stores the payload and can be received by the PendingResponse after a RequestMut was sent to a Server via the Client.

delete()

Releases the Response.

After this call the Response is no longer usable!

header

Returns the ResponseHeader

origin

Returns the UniqueServerId of the Server which sent the Response.

payload() Any

Returns a ctypes.POINTER to the responses payload.

payload_ptr

Returns a pointer to the payload of the response.

user_header() Any

Returns a ctypes.POINTER to the response header.

user_header_ptr

Returns a pointer to the user header of the response.

class iceoryx2.ResponseHeader

Bases: object

Response header used by MessagingPattern::RequestResponse

number_of_elements

Returns how many elements are stored inside the `Response`s payload.

server_id

Returns the UniqueServerId of the Server which sent the Response

class iceoryx2.ResponseMut

Bases: object

delete()

Releases the ResponseMut.

After this call the ResponseMut is no longer usable!

header

Returns a reference to the ResponseHeader.

payload() Any

Returns a ctypes.POINTER to the responses payload.

payload_ptr

Returns a pointer to the payload of the response.

send()

Sends a ResponseMut to the corresponding PendingResponse of the Client.

user_header() Any

Returns a ctypes.POINTER to the response header.

user_header_ptr

Returns a pointer to the user header of the response.

class iceoryx2.ResponseMutUninit

Bases: object

Acquired by a ActiveRequest with
  • ActiveRequest::loan_uninit()

It stores the payload of the response that will be sent to the corresponding PendingResponse of the Client.

If the ResponseMutUninit is not sent it will reelase the loaned memory when going out of scope.

assume_init()

Converts the ResponseMutUninit into ResponseMut. This shall be done after the payload was written into the ResponseMutUninit.

delete()

Releases the ResponseMutUninit.

After this call the ResponseMutUninit is no longer usable!

header

Returns a reference to the ResponseHeader.

payload() Any

Returns a ctypes.POINTER to the responses payload.

payload_ptr

Returns a pointer to the payload of the response.

user_header() Any

Returns a ctypes.POINTER to the response header.

user_header_ptr

Returns a pointer to the user header of the response.

write_payload(t: Type[ReqT]) ResponseMut

Writes the provided payload into the response.

class iceoryx2.Sample

Bases: object

It stores the payload and is acquired by the Subscriber whenever it receives new data from a Publisher via Subscriber::receive().

delete()

Releases the Sample.

After this call the Sample is no longer usable!

header

Returns the HeaderPublishSubscribe of the Sample.

payload() Any

Returns a ctypes.POINTER to the payload.

payload_ptr

Returns a pointer to the payload.

user_header() Any

Returns a ctypes.POINTER to the user header.

user_header_ptr

Returns a pointer to the user header.

class iceoryx2.SampleMut

Bases: object

Acquired by a Publisher via
  • Publisher::loan(),

  • Publisher::loan_slice()

It stores the payload that will be sent to all connected Subscriber`s. If the `SampleMut is not sent it will release the loaned memory when going out of scope.

delete()

Releases the SampleMut.

After this call the SampleMut is no longer usable!

header

Returns the HeaderPublishSubscribe of the Sample.

payload() Any

Returns a ctypes.POINTER to the payload.

payload_ptr

Returns a pointer to the payload.

send()

Send a previously loaned Publisher::loan_uninit() SampleMut to all connected `Subscriber`s of the service.

On success the number of Subscriber`s that received the data is returned, otherwise a `SendError is emitted describing the failure.

user_header() Any

Returns a ctypes.POINTER to the user header.

user_header_ptr

Returns a pointer to the user header.

class iceoryx2.SampleMutUninit

Bases: object

Acquired by a Publisher via
  • Publisher::loan_uninit()

It stores the payload that will be sent to all connected Subscriber`s. If the `SampleMut is not sent it will release the loaned memory when going out of scope.

assume_init()

Extracts the value of the uninitialized payload and labels the SampleMutUninit as initialized SampleMut

After this call the SampleMutUninit is no longer usable!

delete()

Releases the SampleMutUninit.

After this call the SampleMutUninit is no longer usable!

header

Returns the HeaderPublishSubscribe of the Sample.

payload() Any

Returns a ctypes.POINTER to the payload.

payload_ptr

Returns a pointer to the payload.

user_header() Any

Returns a ctypes.POINTER to the user header.

user_header_ptr

Returns a pointer to the user header.

write_payload(t: Type[T]) SampleMut

Writes the provided payload into the sample.

exception iceoryx2.SemanticStringError

Bases: Exception

Errors caused by creating a semantic string.

exception iceoryx2.SendError

Bases: Exception

Errors caused when sending data.

class iceoryx2.Server

Bases: object

Represents the receiving endpoint of an event based communication.

delete()

Releases the Server.

After this call the Server is no longer usable!

has_requests

Returns true if the Server has `RequestMut`s in its buffer.

id

Returns the UniqueServerId of the Server

receive()

Receives a RequestMut that was sent by a Client and returns an ActiveRequest which can be used to respond. If no RequestMut`s were received it returns `None.

unable_to_deliver_strategy

Returns the strategy the Server follows when a ResponseMut cannot be delivered if the `Client`s buffer is full.

exception iceoryx2.ServerCreateError

Bases: Exception

Errors caused when creating a server port.

class iceoryx2.Service

Bases: object

Builder to create or open `Service`s

static details(service_name, config, messaging_pattern, service_type)

Acquires the ServiceDetails of a Service.

static does_exist(service_name, config, messaging_pattern, service_type)

Checks if a service under a given Config does exist

static list(config, service_type)

Returns a list of all services created under a given Config.

class iceoryx2.ServiceBuilder

Bases: object

Builder to create or open `Service`s

event()

Create a new builder to create a MessagingPattern::Event Service.

publish_subscribe(t: Type[T]) ServiceBuilderPublishSubscribe

Returns the ServiceBuilderPublishSusbcribe to create a new publish-subscribe service. The payload ctype must be provided as argument.

request_response(request: Type[ReqT], response: Type[ResT]) ServiceBuilderPublishSubscribe

Returns the ServiceBuilderRequestResponse to create a new request-response service.

The request/response payload ctype must be provided as argument.

class iceoryx2.ServiceBuilderEvent

Bases: object

Builder to create new MessagingPattern::Event based `Service`s

create()

Creates a new Service.

create_with_attributes(attributes)

Creates a new Service with a set of attributes.

deadline(deadline)

Enables the deadline property of the service. There must be a notification emitted by any Notifier after at least the provided deadline.

disable_deadline()

Disables the deadline property of the service. Notifier can signal notifications at any rate.

disable_notifier_created_event()

If the Service is created it disables the event that shall be emitted by every newly created Notifier.

disable_notifier_dead_event()

If the Service is created it disables the event that shall be emitted when a Notifier is identified as dead.

disable_notifier_dropped_event()

If the Service is created it disables the event that shall be emitted by every Notifier before it is dropped.

event_id_max_value(value)

If the Service is created it set the greatest supported NodeId value If an existing Service is opened it defines the value size the NodeId must at least support.

max_listeners(value)

If the Service is created it defines how many Listener shall be supported at most. If an existing Service is opened it defines how many Listener must be at least supported.

max_nodes(value)

If the Service is created it defines how many Node`s shall be able to open it in parallel. If an existing `Service is opened it defines how many `Node`s must be at least supported.

max_notifiers(value)

If the Service is created it defines how many Notifier shall be supported at most. If an existing Service is opened it defines how many Notifier must be at least supported.

notifier_created_event(value)

If the Service is created it defines the event that shall be emitted by every newly created Notifier.

notifier_dead_event(value)

If the Service is created it defines the event that shall be emitted when a Notifier is identified as dead.

notifier_dropped_event(value)

If the Service is created it defines the event that shall be emitted by every Notifier before it is dropped.

open()

Opens an existing Service. Emits an EventOpenError on failure.

open_or_create()

If the Service exists, it will be opened otherwise a new Service will be created. On failure it emits an EventOpenOrCreateError

open_or_create_with_attributes(verifier)

If the Service exists, it will be opened otherwise a new Service will be created. It defines a set of attributes. If the Service already exists all attribute requirements must be satisfied otherwise the open process will fail. If the Service does not exist the required attributes will be defined in the Service. Emits and EventOpenOrCreateError on failure.

open_with_attributes(verifier)

Opens an existing Service with attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. Emits an EventOpenError on failure.

class iceoryx2.ServiceBuilderPublishSubscribe

Bases: object

Builder to create new MessagingPattern::PublishSubscribe based `Service`s

create()

Creates a new Service. On failure it emits PublishSubscribeCreateError.

create_with_attributes(attributes)

Creates a new Service with a set of attributes. On failure it emits PublishSubscribeCreateError.

enable_safe_overflow(value)

If the Service is created, defines the overflow behavior of the service. If an existing Service is opened it requires the service to have the defined overflow behavior.

history_size(value)

If the Service is created it defines the maximum history size a Subscriber can request on connection. If an existing Service is opened it defines the minimum required.

max_nodes(value)

If the Service is created it defines how many Node`s shall be able to open it in parallel. If an existing `Service is opened it defines how many `Node`s must be at least supported.

max_publishers(value)

If the Service is created it defines how many Publisher shall be supported at most. If an existing Service is opened it defines how many Publisher must be at least supported.

max_subscribers(value)

If the Service is created it defines how many Subscriber shall be supported at most. If an existing Service is opened it defines how many Subscriber must be at least supported.

open()

Opens an existing Service. On failure it emits PublishSubscribeOpenError.

open_or_create()

If the Service exists, it will be opened otherwise a new Service will be created. On failure it emits PublishSubscribeOpenOrCreateError

open_or_create_with_attributes(verifier)

If the Service exists, it will be opened otherwise a new Service will be created. It defines a set of attributes. If the Service already exists all attribute requirements must be satisfied otherwise the open process will fail. If the Service does not exist the required attributes will be defined in the Service. On failure it emits PublishSubscribeOpenOrCreateError

open_with_attributes(verifier)

Opens an existing Service with attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. On failure it emits PublishSubscribeOpenError.

payload_alignment(value)

Overrides and increases the alignment of the payload - useful when the payload is used in SIMD operations. To be able to connect to a Service the payload alignment must be identical in all participants since the communication is always strongly typed.

subscriber_max_borrowed_samples(value)

If the Service is created it defines how many Sample`s a `Subscriber can borrow at most in parallel. If an existing Service is opened it defines the minimum required.

subscriber_max_buffer_size(value)

If the Service is created it defines how many Sample a Subscriber can store in its internal buffer. If an existing Service is opened it defines the minimum required.

user_header(t: Type[T]) ServiceBuilderPublishSubscribe

Sets the user header type for the service.

class iceoryx2.ServiceBuilderRequestResponse

Bases: object

Builder to create new MessagingPattern::RequestResponse based `Service`s

create()

Creates a new Service. On failure RequestResponseCreateError will be emitted.

create_with_attributes(attributes)

Creates a new Service with a set of attributes. On failure RequestResponseCreateError will be emitted.

enable_fire_and_forget_requests(value)

If the Service is created, defines the fire-and-forget behavior of the service for requests.

enable_safe_overflow_for_requests(value)

If the Service is created, defines the overflow behavior of the service for requests. If an existing Service is opened it requires the service to have the defined overflow behavior.

enable_safe_overflow_for_responses(value)

If the Service is created, defines the overflow behavior of the service for responses. If an existing Service is opened it requires the service to have the defined overflow behavior.

max_active_requests_per_client(value)

Defines how many active requests a Server can hold in parallel per Client. The objects are used to send answers to a request that was received earlier from a Client.

max_borrowed_responses_per_pending_response(value)

If the Service is created it defines how many Response`s shall be able to be borrowed in parallel per `PendingResponse. If an existing Service is opened it defines how many borrows must be at least supported.

max_clients(value)

If the Service is created it defines how many Client`s shall be supported at most. If an existing `Service is opened it defines how many `Client`s must be at least supported.

max_loaned_requests(value)

If the Service is created it defines how many RequestMut a Client can loan in parallel.

max_nodes(value)

If the Service is created it defines how many Node`s shall be able to open it in parallel. If an existing `Service is opened it defines how many `Node`s must be at least supported.

max_response_buffer_size(value)

If the Service is created it defines how many responses fit in the Clients`s buffer. If an existing `Service is opened it defines the minimum required.

max_servers(value)

If the Service is created it defines how many Server`s shall be supported at most. If an existing `Service is opened it defines how many `Server`s must be at least supported.

open()

Opens an existing Service. On failure RequestResponseOpenError will be emitted.

open_or_create()

If the Service exists, it will be opened otherwise a new Service will be created. On failure RequestResponseOpenOrCreateError will be emitted.

open_or_create_with_attributes(verifier)

If the Service exists, it will be opened otherwise a new Service will be created. It defines a set of attributes.

If the Service already exists all attribute requirements must be satisfied, and service payload type must be the same, otherwise the open process will fail. If the Service does not exist the required attributes will be defined in the Service. On failure RequestResponseOpenOrCreateError will be emitted.

open_with_attributes(verifier)

Opens an existing Service with attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. On failure RequestResponseOpenError will be emitted.

request_header(request: Type[ReqT]) ServiceBuilderPublishSubscribe

Sets the request header type for the service.

request_payload_alignment(value)

Overrides and increases the alignment of the request payload - useful when the payload is used in SIMD operations. To be able to connect to a Service the payload alignment must be identical in all participants since the communication is always strongly typed.

response_header(response: Type[ResT]) ServiceBuilderPublishSubscribe

Sets the response header type for the service.

response_payload_alignment(value)

Overrides and increases the alignment of the response payload - useful when the payload is used in SIMD operations. To be able to connect to a Service the payload alignment must be identical in all participants since the communication is always strongly typed.

class iceoryx2.ServiceDetails

Bases: object

Represents all the Service information that one can acquire with Service::list().

attributes()

Returns the attributes of the Service

messaging_pattern()

Returns the Service`s underlying `MessagingPattern.

name()

Returns the ServiceName

nodes()

A list of all Node`s that are registered at the `Service

service_id()

Returns the unique ServiceId of the Service

exception iceoryx2.ServiceDetailsError

Bases: Exception

Errors caused when acquiring the details of a service.

class iceoryx2.ServiceId

Bases: object

The unique id of a Service

as_str

Returns a String containing the ServiceId value

static max_number_of_characters()

Returns the maximum string length of a ServiceId

class iceoryx2.ServiceName

Bases: object

Relocatable (inter-process shared memory compatible) SemanticString implementation for ServiceName. All modification operations ensure that never an invalid file or path name can be generated. All strings have a fixed size so that the maximum path or file name length the system supports can be stored.

static max_len()

Returns the maximum length of a ServiceName

static new(name)

Creates a new ServiceName when the provided name contains a valid path to a file, otherwise it emits a SemanticStringError.

to_string()

Converts the ServiceName into a String

class iceoryx2.ServiceType

Bases: object

Defines the type of the Service and what kind of resources and operating system mechanisms it shall use.

Ipc = ServiceType.Ipc
Local = ServiceType.Local
class iceoryx2.SignalHandlingMode

Bases: object

Defines how signals are handled by constructs that might register a custom SignalHandler

Disabled = SignalHandlingMode.Disabled
HandleTerminationRequests = SignalHandlingMode.HandleTerminationRequests
class iceoryx2.Slice(data_ptr: int, number_of_elements: int, t: Type[T])[source]

Bases: Generic[T]

A class representing a slice of contiguous elements of type T.

A Slice provides a view into a contiguous sequence of elements without owning the memory. It allows for efficient access and iteration over a portion of a contiguous data structure.

T - The type of elements in the slice. Can be const-qualified for read-only slices.

as_ptr() int[source]

Returns a pointer to the first element of the Slice.

len() int[source]

Returns the length / number of elements contained in the Slice.

class iceoryx2.StaticConfigEvent

Bases: object

The static configuration of an MessagingPattern::Event based service. Contains all parameters that do not change during the lifetime of a Service.

deadline

Returns the deadline of the service. If no new notification is signaled from any Notifier after the given deadline, it is rated as an error and all Listener`s that are attached to a `WaitSet are woken up and notified about the missed

event_id_max_value

Returns the largest EventId that is supported by the service

max_listeners

Returns the maximum supported amount of Listener ports

max_nodes

Returns the maximum supported amount of Node`s that can open the `Service in parallel.

max_notifiers

Returns the maximum supported amount of Notifier ports

notifier_created_event

Returns the emitted EventId when a new notifier is created.

notifier_dead_event

Returns the emitted EventId when a notifier is identified as dead.

notifier_dropped_event

Returns the emitted EventId when a notifier is dropped.

class iceoryx2.StaticConfigPublishSubscribe

Bases: object

The static configuration of an MessagingPattern::PublishSubscribe based Service. Contains all parameters that do not change during the lifetime of a Service.

has_safe_overflow

Returns true if the Service safely overflows, otherwise false. Safe overflow means that the Publisher will recycle the oldest Sample from the Subscriber when its buffer is full.

history_size

Returns the maximum history size that can be requested on connect.

max_nodes

Returns the maximum supported amount of Node`s that can open the `Service in parallel.

max_publishers

Returns the maximum supported amount of Publisher ports

max_subscribers

Returns the maximum supported amount of Subscriber ports

message_type_details

Returns the type details of the Service.

subscriber_max_borrowed_samples

Returns how many Sample a Subscriber port can borrow in parallel at most.

subscriber_max_buffer_size

Returns the maximum supported buffer size for Subscriber port

class iceoryx2.StaticConfigRequestResponse

Bases: object

The static configuration of an MessagingPattern::RequestResponse based service. Contains all parameters that do not change during the lifetime of a Service.

does_support_fire_and_forget_requests

Returns true if fire and forget RequestMut`s can be sent from the `Client, otherwise false.

has_safe_overflow_for_requests

Returns true if the request buffer of the Service safely overflows, otherwise false. Safe overflow means that the Client will recycle the oldest requests from the Server when its buffer is full.

has_safe_overflow_for_responses

Returns true if the response buffer of the Service safely overflows, otherwise false. Safe overflow means that the Server will recycle the oldest responses from the Client when its buffer is full.

max_active_requests_per_client

Returns the maximum of active requests a Server can hold in parallel per Client.

max_borrowed_responses_per_pending_response

Returns the maximum number of borrowed Response`s a `Client can hold in parallel per PendingResponse

max_clients

Returns the maximum number of supported Client ports for the Service.

max_loaned_requests

Returns the maximum number of RequestMut a Client can loan in parallel.

max_nodes

Returns the maximum number of supported Node`s for the `Service.

max_response_buffer_size

Returns the maximum buffer size for responses for a PendingResponse.

max_servers

Returns the maximum number of supported Server ports for the Service.

request_message_type_details

Returns the request type details of the Service.

response_message_type_details

Returns the response type details of the Service.

class iceoryx2.Subscriber

Bases: object

Represents the receiving endpoint of an event based communication.

buffer_size

Returns the internal buffer size of the Subscriber.

delete()

Releases the Subscriber.

After this call the Subscriber is no longer usable!

has_samples()

Returns true if the Subscriber has samples in the buffer that can be received with Subscriber::receive. Emits ConnectionFailure on error.

id

Returns the UniqueSubscriberId of the Subscriber

receive()

Receives a Sample from Publisher. If no sample could be received None is returned. If a failure occurs ReceiveError is returned.

exception iceoryx2.SubscriberCreateError

Bases: Exception

Errors caused when creating a subscriber port.

class iceoryx2.TypeDetail

Bases: object

Contains all type details required to connect to a Service

alignment(alignment)

Sets the alignment of the type

static new()

Creates a new TypeDetail for the unit type. Meaning size == 0, alignment == 1

size(size)

Sets the size of the type

type_name(name)

Sets the unique TypeName of the type

type_variant(value)

Defines the TypeVariant of the defined type. TypeVariant::FixedSize if the type has always the same size like an uint64_t or TypeVariant::Dynamic when it is a dynamic array or vector

class iceoryx2.TypeName

Bases: object

Represents the string name of a type. The name shall uniquely identify the type in the communication system.

static max_len()

The maximum supported length of a TypeName

static new(name)

Creates a new TypeName. If the provided name exceeds the maximum supported length it emits an SemanticStringError.

to_string()

Returns the underlying String of the TypeName

class iceoryx2.TypeVar

Bases: object

Type variable.

The preferred way to construct a type variable is via the dedicated syntax for generic functions, classes, and type aliases:

class Sequence[T]:  # T is a TypeVar
    ...

This syntax can also be used to create bound and constrained type variables:

# S is a TypeVar bound to str
class StrSequence[S: str]:
    ...

# A is a TypeVar constrained to str or bytes
class StrOrBytesSequence[A: (str, bytes)]:
    ...

However, if desired, reusable type variables can also be constructed manually, like so:

T = TypeVar('T')  # Can be anything
S = TypeVar('S', bound=str)  # Can be any subtype of str
A = TypeVar('A', str, bytes)  # Must be exactly str or bytes

Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function and type alias definitions.

The variance of type variables is inferred by type checkers when they are created through the type parameter syntax and when infer_variance=True is passed. Manually created type variables may be explicitly marked covariant or contravariant by passing covariant=True or contravariant=True. By default, manually created type variables are invariant. See PEP 484 and PEP 695 for more details.

class iceoryx2.TypeVariant

Bases: object

Defines if the type is a slice with a runtime-size (TypeVariant::Dynamic) or if its a type that satisfies Sized (TypeVariant::FixedSize).

Dynamic = TypeVariant.Dynamic
FixedSize = TypeVariant.FixedSize
class iceoryx2.UnableToDeliverStrategy

Bases: object

Defines the strategy a sender shall pursue when the buffer of the receiver is full and the service does not overflow.

Block = UnableToDeliverStrategy.Block
DiscardSample = UnableToDeliverStrategy.DiscardSample
class iceoryx2.UniqueClientId

Bases: object

The system-wide unique id of a Client.

value

Returns the underlying raw value of the ID

class iceoryx2.UniqueListenerId

Bases: object

The system-wide unique id of a Listener.

value

Returns the underlying raw value of the ID

class iceoryx2.UniqueNotifierId

Bases: object

The system-wide unique id of a Notifier.

value

Returns the underlying raw value of the ID

class iceoryx2.UniquePublisherId

Bases: object

The system-wide unique id of a Publisher.

value

Returns the underlying raw value of the ID

class iceoryx2.UniqueServerId

Bases: object

The system-wide unique id of a Server.

value

Returns the underlying raw value of the ID

class iceoryx2.UniqueSubscriberId

Bases: object

The system-wide unique id of a Subscriber.

value

Returns the underlying raw value of the ID

class iceoryx2.WaitSet

Bases: object

The WaitSet implements a reactor pattern and allows to wait on multiple events in one single call WaitSet::wait_and_process() until a interrupt or termination signal was received.

The Listener can be attached as well as sockets or anything else that is a FileDescriptor.

Can be created via the WaitSetBuilder.

attach_deadline(attachment, deadline)

Attaches a Listener as deadline to the WaitSet. Whenever the event is received or the deadline is hit, the user is informed in WaitSet::wait_and_process(). The object cannot be attached twice and the WaitSet::capacity() is limited by the underlying implementation. Whenever the object emits an event the deadline is reset by the WaitSet.

attach_deadline_fd(attachment, deadline)

Attaches a FileDescriptor as deadline to the WaitSet. Whenever the event is received or the deadline is hit, the user is informed in WaitSet::wait_and_process(). The object cannot be attached twice and the WaitSet::capacity() is limited by the underlying implementation. Whenever the object emits an event the deadline is reset by the WaitSet.

attach_interval(interval)

Attaches a tick event to the WaitSet. Whenever the timeout is reached the WaitSet informs the user in WaitSet::wait_and_process().

attach_notification(attachment)

Attaches a Listener as notification to the WaitSet. Whenever an event is received on the object the WaitSet informs the user in WaitSet::wait_and_process() to handle the event. The object cannot be attached twice and the WaitSet::capacity() is limited by the underlying implementation.

attach_notification_fd(attachment)

Attaches a FileDescriptor as notification to the WaitSet. Whenever an event is received on the object the WaitSet informs the user in WaitSet::wait_and_process() to handle the event. The object cannot be attached twice and the WaitSet::capacity() is limited by the underlying implementation.

capacity

Returns the capacity of the WaitSet

is_empty

Returns true if the WaitSet has no attachments, otherwise false.

len

Returns the number of attachments.

signal_handling_mode

Returns the SignalHandlingMode with which the WaitSet was created.

wait_and_process()

Waits until an event arrives on the WaitSet, then collects the events corresponding WaitSetAttachmentId in a vector and returns it.

If an interrupt- (SIGINT) or a termination-signal (SIGTERM) was received, it will exit the loop and inform the user with [WaitSetRunResult::Interrupt] or [WaitSetRunResult::TerminationRequest].

wait_and_process_with_timeout(timeout)

Waits until an event arrives on the WaitSet or the provided timeout has passed, then collects the events corresponding WaitSetAttachmentId in a vector and returns it.

If an interrupt- (SIGINT) or a termination-signal (SIGTERM) was received, it will exit the loop and inform the user with [WaitSetRunResult::Interrupt] or [WaitSetRunResult::TerminationRequest].

exception iceoryx2.WaitSetAttachmentError

Bases: Exception

Errors caused when attaching something to the waitset.

class iceoryx2.WaitSetAttachmentId

Bases: object

Represents an attachment to the WaitSet

static from_guard(guard)

Creates an WaitSetAttachmentId from a WaitSetGuard that was returned via WaitSet::attach_interval(), WaitSet::attach_notification() or WaitSet::attach_deadline().

has_event_from(other)

Returns true if an event was emitted from a notification or deadline attachment corresponding to WaitSetGuard.

has_missed_deadline(other)

Returns true if the deadline for the attachment corresponding to WaitSetGuard was missed.

class iceoryx2.WaitSetBuilder

Bases: object

Creates a new WaitSet.

create(service_type)

Creates the WaitSet.

static new()

Instantiates a new WaitSetBuilder

signal_handling_mode(value)

Defines the SignalHandlingMode for the WaitSet. It affects the WaitSet::wait_and_process() and WaitSet::wait_and_process_once() calls that returns any received Signal via its WaitSetRunResult return value.

exception iceoryx2.WaitSetCreateError

Bases: Exception

Errors caused by creating a new waitset.

class iceoryx2.WaitSetGuard

Bases: object

Is returned when something is attached to the WaitSet. As soon as it goes out of scope, the attachment is detached.

delete()

Drops the WaitSetGuard. After this call the WaitSetGuard is no longer usable.

exception iceoryx2.WaitSetRunError

Bases: Exception

Errors caused by calling WaitSet::wait_and_process().

class iceoryx2.WaitSetRunResult

Bases: object

States why the WaitSet::wait_and_process() method returned.

AllEventsHandled = WaitSetRunResult.AllEventsHandled
Interrupt = WaitSetRunResult.Interrupt
StopRequest = WaitSetRunResult.StopRequest
TerminationRequest = WaitSetRunResult.TerminationRequest
iceoryx2.allocation_strategy(self: PortFactoryPublisher, value: AllocationStrategy) PortFactoryPublisher[source]

Defines the allocation strategy that is used when the memory is exhausted.

iceoryx2.allocation_strategy_request(self: PortFactoryClient, value: AllocationStrategy) PortFactoryClient[source]

Defines the allocation strategy that is used when the memory is exhausted.

iceoryx2.allocation_strategy_response(self: PortFactoryServer, value: AllocationStrategy) PortFactoryServer[source]

Defines the allocation strategy that is used when the memory is exhausted.

iceoryx2.get_args(tp)[source]

Get type arguments with all substitutions performed.

For unions, basic simplifications used by Union constructor are performed.

Examples:

>>> T = TypeVar('T')
>>> assert get_args(Dict[str, int]) == (str, int)
>>> assert get_args(int) == ()
>>> assert get_args(Union[int, Union[T, int], str][int]) == (int, str)
>>> assert get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
>>> assert get_args(Callable[[], T][int]) == ([], int)
iceoryx2.get_origin(tp)[source]

Get the unsubscripted version of a type.

This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar, Annotated, and others. Return None for unsupported types.

Examples:

>>> P = ParamSpec('P')
>>> assert get_origin(Literal[42]) is Literal
>>> assert get_origin(int) is None
>>> assert get_origin(ClassVar[int]) is ClassVar
>>> assert get_origin(Generic) is Generic
>>> assert get_origin(Generic[T]) is Generic
>>> assert get_origin(Union[T, int]) is Union
>>> assert get_origin(List[Tuple[T, T]][int]) is list
>>> assert get_origin(P.args) is P
iceoryx2.get_type_name(t: Type[T]) Any[source]

Generates a human readable type name from a given type.

iceoryx2.initial_max_slice_len(self: PortFactoryPublisher, value: int) PortFactoryPublisher[source]

Sets the maximum slice length that a user can allocate.

iceoryx2.initial_max_slice_len_request(self: PortFactoryClient, value: int) PortFactoryClient[source]

Sets the maximum slice length that a user can allocate.

iceoryx2.initial_max_slice_len_response(self: PortFactoryServer, value: int) PortFactoryServer[source]

Sets the maximum slice length that a user can allocate.

iceoryx2.loan_slice_uninit(self: Publisher, number_of_elements: int) SampleMutUninit[source]

Loans/allocates a SampleMutUninit from the underlying data segment of the Publisher.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

iceoryx2.loan_slice_uninit_request(self: Client, number_of_elements: int) RequestMutUninit[source]

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

iceoryx2.loan_slice_uninit_response(self: ActiveRequest, number_of_elements: int) ResponseMutUninit[source]

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. Fails when it is called for data types which are not a slice. On failure it returns LoanError describing the failure.

iceoryx2.loan_uninit(self: Publisher) SampleMutUninit[source]

Loans/allocates a SampleMutUninit from the underlying data segment of the Publisher.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

iceoryx2.loan_uninit_request(self: Client) RequestMutUninit[source]

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

iceoryx2.loan_uninit_response(self: ActiveRequest) ResponseMutUninit[source]

Loans/allocates memory from the underlying data segment.

The user has to initialize the payload before it can be sent. On failure it returns LoanError describing the failure.

iceoryx2.payload(self: Any) Any[source]

Returns a ctypes.POINTER to the payload.

iceoryx2.publish_subscribe(self: ServiceBuilder, t: Type[T]) ServiceBuilderPublishSubscribe[source]

Returns the ServiceBuilderPublishSusbcribe to create a new publish-subscribe service. The payload ctype must be provided as argument.

iceoryx2.request_header(self: Any) Any[source]

Returns a ctypes.POINTER to the request header.

iceoryx2.request_payload(self: Any) Any[source]

Returns a ctypes.POINTER to the requests payload.

iceoryx2.request_response(self: ServiceBuilder, request: Type[ReqT], response: Type[ResT]) ServiceBuilderPublishSubscribe[source]

Returns the ServiceBuilderRequestResponse to create a new request-response service.

The request/response payload ctype must be provided as argument.

iceoryx2.response_header(self: Any) Any[source]

Returns a ctypes.POINTER to the response header.

iceoryx2.response_payload(self: Any) Any[source]

Returns a ctypes.POINTER to the responses payload.

iceoryx2.send_copy(self: Publisher, t: Type[T]) Any[source]

Sends a copy of the provided type.

iceoryx2.send_request_copy(self: Client, t: Type[ReqT]) PendingResponse[source]

Sends a copy of the provided type.

iceoryx2.send_response_copy(self: ActiveRequest, t: Type[ResT]) Any[source]

Sends a copy of the provided type.

iceoryx2.set_log_level(value)

Sets the current log level. This is ignored for external frameworks like log or tracing. Here you have to use the log-level settings of that framework.

iceoryx2.set_log_level_from_env_or(value)

Sets the log level by reading environment variable “IOX2_LOG_LEVEL”, and if the environment variable doesn’t exit it sets it with a user-defined logging level

iceoryx2.set_log_level_from_env_or_default()

Sets the log level by reading environment variable “IOX2_LOG_LEVEL” or default it with LogLevel::INFO

iceoryx2.set_request_header(self: ServiceBuilderPublishSubscribe, request: Type[ReqT]) ServiceBuilderPublishSubscribe[source]

Sets the request header type for the service.

iceoryx2.set_response_header(self: ServiceBuilderPublishSubscribe, response: Type[ResT]) ServiceBuilderPublishSubscribe[source]

Sets the response header type for the service.

iceoryx2.set_user_header(self: ServiceBuilderPublishSubscribe, t: Type[T]) ServiceBuilderPublishSubscribe[source]

Sets the user header type for the service.

iceoryx2.user_header(self: Any) Any[source]

Returns a ctypes.POINTER to the user header.

iceoryx2.write_payload(self: SampleMutUninit, t: Type[T]) SampleMut[source]

Writes the provided payload into the sample.

iceoryx2.write_request_payload(self: RequestMutUninit, t: Type[ReqT]) RequestMut[source]

Writes the provided payload into the request.

iceoryx2.write_response_payload(self: ResponseMutUninit, t: Type[ReqT]) ResponseMut[source]

Writes the provided payload into the response.