iceoryx2¶
Python language bindings for iceoryx2.
- class iceoryx2.ActiveRequest¶
Bases:
objectThe
ActiveRequestrepresents the object that contains the payload that theClientsends to theServer.- delete()¶
Releases the
ActiveRequestand terminates the connection.After this call the
ActiveRequestis no longer usable!
- has_disconnect_hint¶
Returns
Trueif theClientwants to gracefully disconnect. This allows theServerto send its last response and then drop theActiveRequestto signal theClientthat no moreResponseMutwill be sent.
- header¶
Returns the
RequestHeaderof the receivedRequestMut
- is_connected¶
Returns
Trueuntil thePendingResponsegoes out of scope on theClient’s side indicating that theClientno longer receives theResponseMut.
- loan_flatbuffer() ResponseMutUninit¶
Loans/allocates a
ResponseMutUninitfrom the underlying data segment of theServerwith an integrated flatbuffer builder.
- 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
LoanErrordescribing 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
LoanErrordescribing the failure.
- origin¶
Returns the
UniqueClientIdof theClient
- payload() Any¶
Returns the payload of the request.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the payload of the received
RequestMutas anint.ActiveRequest.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- user_header() Any¶
Returns a
ctypes.POINTERto the request header.
- user_header_ptr¶
Returns the address of the user_header of the received
RequestMutas anint.ActiveRequest.user_headerprovides typed access.
- class iceoryx2.Alignment¶
Bases:
objectContains 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 anInvalidAlignmentValue.
- class iceoryx2.AliveNodeView¶
Bases:
objectContains all details of a
Nodethat is alive.- details¶
Returns optional
NodeDetailsthat contains further information about theNode. Can only be acquired when the process has the access right to read it.
- id¶
Returns the
UniqueNodeId.
- exception iceoryx2.AllocationGrowError¶
Bases:
ExceptionErrors caused when growing a payload memory.
- class iceoryx2.AllocationStrategy¶
Bases:
objectDescribes 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.Attribute¶
Bases:
objectRepresents 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:
objectRelocatable (inter-process shared memory compatible)
SemanticStringimplementation forAttributeKey.- static max_len()¶
Returns the maximum length of a
AttributeKey
- static new(value)¶
Creates a new
AttributeKeywhen the providedvaluedoes not exceedAttributeKey.max_len(), otherwise it emits aSemanticStringError.
- to_string()¶
Converts the
AttributeKeyinto astr
- class iceoryx2.AttributeSet¶
Bases:
objectRepresents a single service attribute (key-value) pair that can be defined when the service is being created.
- static capacity()¶
Returns the maximum
Attributecount theAttributeSetcan hold.
- key_values(key)¶
Returns all
AttributeValuethat belong to a specifiedAttributeKey.
- number_of_attributes¶
Returns the
Attributecount of theAttributeSet.
- values¶
Returns every
Attributestored in theAttributeSet
- class iceoryx2.AttributeSpecifier¶
Bases:
objectRepresents 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.
- class iceoryx2.AttributeValue¶
Bases:
objectRelocatable (inter-process shared memory compatible)
SemanticStringimplementation forAttributeValue.- static max_len()¶
Returns the maximum length of a
AttributeValue
- static new(value)¶
Creates a new
AttributeValuewhen the providedvaluedoes not exceedAttributeValue.max_len(), otherwise it emits aSemanticStringError.
- to_string()¶
Converts the
AttributeValueinto astr
- class iceoryx2.AttributeVerifier¶
Bases:
objectRepresents a single service attribute (key-value) pair that can be defined when the service is being created.
- 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
AttributeSetcontains all required keys and key-value pairs.
- class iceoryx2.BackpressureStrategy¶
Bases:
objectDefines the strategy a sender shall pursue when the buffer of the receiver is full and the service does not overflow.
- DiscardData = BackpressureStrategy.DiscardData¶
- RetryUntilDelivered = BackpressureStrategy.RetryUntilDelivered¶
- exception iceoryx2.BlackboardCreateError¶
Bases:
ExceptionErrors caused when creating a blackboard service.
- class iceoryx2.BlackboardKey(data: bytes)[source]¶
Bases:
objectA wrapper class for the keys returned by
PortFactoryBlackboard.list_keys().
- exception iceoryx2.BlackboardOpenError¶
Bases:
ExceptionErrors caused when opening a blackboard service.
- class iceoryx2.BlackboardValue(data: bytes, generation_counter: c_ulong)[source]¶
Bases:
objectA wrapper class for the value returned by
EntryHandle.get().
- class iceoryx2.Client¶
Bases:
objectRepresents the receiving endpoint of an event based communication.
- backpressure_strategy¶
Returns the strategy the
Clientfollows when aRequestMutcannot be delivered if theServer’s buffer is full.
- id¶
Returns the
UniqueClientIdof theClient
- loan_flatbuffer() RequestMutUninit¶
Loans/allocates a
RequestMutUninitfrom the underlying data segment of theClientwith an integrated flatbuffer builder.
- 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
LoanErrordescribing 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
LoanErrordescribing the failure.
- send_copy(t: Type[ReqT]) PendingResponse¶
Sends a copy of the provided type.
- exception iceoryx2.ClientCreateError¶
Bases:
ExceptionErrors caused when creating a new client port.
- exception iceoryx2.ConnectionFailure¶
Bases:
ExceptionErrors caused a connection to an endpoint could not be established.
- class iceoryx2.DeadNodeView¶
Bases:
objectContains all details of a
Nodethat is dead.- blocking_remove_stale_resources(timeout)¶
Removes all stale resources of a dead
Node. If another instance is already removing the deadNodeit waits until the other instance has cleaned up the deadNodecompletely. If the other cleanup instance crashes, it will take over the ownership and continue the cleanup. If the process does not have the permission to cleanup all resources it aborts with an error.If the provided timeout is expired it will return.
- details¶
Returns optional
NodeDetailsthat contains further information about theNode. Can only be acquired when the process has the access right to read it.
- id¶
Returns the
UniqueNodeId.
- try_remove_stale_resources()¶
Removes all stale resources of the dead
Node. On error it emits aNodeCleanupFailure. It returns true if the stale resources could be removed, otherwise false.
- class iceoryx2.DynamicConfigBlackboard¶
Bases:
objectThe dynamic configuration of a
MessagingPattern.Blackboardservice. Port counts reflect the current state of the service when accessed. The view keeps the service open while it is referenced. Explicitly deleting the blackboard factory invalidates the view; subsequent count queries raiseRuntimeError.- number_of_readers¶
Returns the number of readers currently connected to the service.
- number_of_writers¶
Returns the number of writers currently connected to the service.
- class iceoryx2.DynamicConfigEvent¶
Bases:
objectThe dynamic configuration of a
MessagingPattern.Eventservice. Port counts reflect the current state of the service when accessed. The view keeps the service open while it is referenced.- number_of_listeners¶
Returns the number of listeners currently connected to the service.
- number_of_notifiers¶
Returns the number of notifiers currently connected to the service.
- class iceoryx2.DynamicConfigPublishSubscribe¶
Bases:
objectThe dynamic configuration of a
MessagingPattern.PublishSubscribeservice. Port counts reflect the current state of the service when accessed. The view keeps the service open while it is referenced.- number_of_publishers¶
Returns the number of publishers currently connected to the service.
- number_of_subscribers¶
Returns the number of subscribers currently connected to the service.
- class iceoryx2.DynamicConfigRequestResponse¶
Bases:
objectThe dynamic configuration of a
MessagingPattern.RequestResponseservice. Port counts reflect the current state of the service when accessed. The view keeps the service open while it is referenced.- number_of_clients¶
Returns the number of clients currently connected to the service.
- number_of_servers¶
Returns the number of servers currently connected to the service.
- class iceoryx2.EntryHandle¶
Bases:
object- entry_id¶
Returns an ID corresponding to the entry which can be used in an event based communication setup.
- get() BlackboardValue¶
Returns a copy of the value as bytes wrapped in a
BlackboardValue.Use decode_as() to reinterpret the raw bytes as a ctypes type.
- is_up_to_date(value: BlackboardValue) bool¶
Checks if
valueis up-to-date.
- exception iceoryx2.EntryHandleError¶
Bases:
ExceptionErrors caused when an EntryHandle is created with Reader::entry().
- class iceoryx2.EntryHandleMut¶
Bases:
object- delete()¶
Releases the
EntryHandleMut.After this call the
EntryHandleMutis no longer usable!
- entry_id¶
Returns an ID corresponding to the entry which can be used in an event based communication setup.
- loan_uninit()¶
Consumes the
EntryHandleMutand loans an uninitialized entry value that can be used to update without copy.
- exception iceoryx2.EntryHandleMutError¶
Bases:
ExceptionErrors caused when an EntryHandleMut is created with Writer::entry().
- class iceoryx2.EntryValueUninit¶
Bases:
object- assume_init_and_update() EntryHandleMut¶
Makes the new value accessible.
Consumes the EntryValueUninit, makes the new value accessible and returns the original EntryHandleMut.
- discard()¶
Discards the
EntryValueUninitand returns the originalEntryHandleMut.
- update_with_copy(value: Type[V]) EntryHandleMut¶
Updates the entry value.
Consumes the EntryValueUninit, writes values to the entry value and returns the original EntryHandleMut.
- value_mut() Any¶
Returns a
ctypes.POINTERto the value of the blackboard entry.It can be used to update the value without copy. After writing, assume_init_and_update() must be called.
- class iceoryx2.EventActivation¶
Bases:
objectUser defined identifier that can be provided in
Notifier.notify()to signal a specific kind of event.
- class iceoryx2.EventId¶
Bases:
objectUser defined identifier that can be provided in
Notifier.notify()to signal a specific kind of event.
- exception iceoryx2.EventOpenOrCreateError¶
Bases:
ExceptionErrors caused when open or creating an event service.
- class iceoryx2.FileDescriptor¶
Bases:
objectRepresents a FileDescriptor in a POSIX system. Contains always a value greater or equal zero, a valid file descriptor. It takes the ownership of the provided file descriptor and calls
posix::closeon destruction.- native_handle¶
Returns the underlying value of the FileDescriptor
# Safety
the user shall not store the value in a variable otherwise lifetime issues may be encountered
do not manually close the file descriptor with a sys call
- static non_owning_new(value)¶
Creates a FileDescriptor which does not hold the ownership of the file descriptor and will not call
posix::closeon destruction.
- class iceoryx2.FileName¶
Bases:
objectRelocatable (inter-process shared memory compatible)
SemanticStringimplementation forFileName. 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 new(name)¶
Creates a new
FileNamewhen the providednamecontains a valid path to a file, otherwise it emits aSemanticStringError.
- class iceoryx2.FilePath¶
Bases:
objectRelocatable (inter-process shared memory compatible)
SemanticStringimplementation forFilePath. 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 new(name)¶
Creates a new
FilePathwhen the providednamecontains a valid path to a file, otherwise it emits aSemanticStringError.
- class iceoryx2.Flatbuffer[source]¶
Bases:
Generic[T]A class representing flatbuffer serializable T.
- class iceoryx2.HeaderPublishSubscribe¶
Bases:
objectSample header used by
MessagingPattern.PublishSubscribe- node_id¶
Returns the
UniqueNodeIdof the source node that published theSample.
- payload_offset¶
Returns the payload offset.
- publisher_id¶
Returns the
UniquePublisherIdof the sourcePublisher.
- exception iceoryx2.InvalidAlignmentValue¶
Bases:
ExceptionErrors caused when the value of the alignment is not a power of two or exceeds the maximum supported value.
- class iceoryx2.Listener¶
Bases:
objectRepresents the receiving endpoint of an event based communication.
- blocking_wait()¶
Blocking wait for new events. Unblocks as soon as an event was received and then collects every
EventActivationthat was received and returns them. On error it emitsListenerWaitError.
- id¶
Returns the
UniqueListenerIdof theListener
- timed_wait(timeout)¶
Blocking wait for new events until the provided timeout has passed. Unblocks as soon as an event was received and then collects every
EventActivationthat was received and returns them. On error it emitsListenerWaitError.
- try_wait()¶
Non-blocking wait for new events. Collects every
EventActivationthat was received and returns them. On error it emitsListenerWaitError.
- exception iceoryx2.ListenerCreateError¶
Bases:
ExceptionErrors caused when creating a new Listener port.
- exception iceoryx2.ListenerWaitError¶
Bases:
ExceptionErrors caused when waiting on a Listener port in an event service.
- exception iceoryx2.LoanError¶
Bases:
ExceptionErrors caused when loaning memory from a ports datasegment.
- class iceoryx2.LogLevel¶
Bases:
objectDescribes 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:
objectContains all type information to the header and payload type.
- header¶
The
TypeDetailof the header of a message, the first iceoryx2 internal part.
- payload¶
The
TypeDetailof the payload of the message, the last part.
- user_header¶
The
TypeDetailof 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:
objectThe 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.- blocking_cleanup_dead_nodes(timeout)¶
Removes the stale system resources of every dead
Node. A deadNodeis also removed from every registeredService.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped. If it is currently being cleaned up by another process then the cleaner will wait until the timeout as either passed or the cleaned was finished.The timeout is applied to every individual dead
Nodethe function needs to wait on.
- config¶
Returns the
config.Configthat theNodewill use to create any iceoryx2 entity.
- force_remove_service(name, messaging_pattern)¶
Removes a
Serviceby force. This shall be used if the resources could not be removed in a previous run and now it is no longer possible to open the service.# Safety
No other process shall continue to use the service.
- static list(service_type, config)¶
Returns the
NodeStateof everyNodeunder a provided config. On failure it emits aNodeListFailure.
- service_builder(name)¶
Instantiates a
ServiceBuilderfor a service with the provided name.
- signal_handling_mode¶
Returns the
SignalHandlingModewith which theNodewas created.
- try_cleanup_dead_nodes()¶
Removes the stale system resources of every dead
Node. A deadNodeis also removed from every registeredService.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped.
- wait(cycle_time)¶
Waits for a given
cycle_time. On failure it emits aNodeWaitFailure.
- class iceoryx2.NodeBuilder¶
Bases:
objectCreates a new
Node.- config(config)¶
The
config.Configthat shall be used for theNode. If noconfig.Configis specified theconfig.global_configis used.
- create(service_type)¶
Creates a new
Nodefor a specifiedServiceType. EmitsNodeCreationFailureon failure.
- name(value)¶
The
NodeNamethat shall be assigned to theNode. It does not have to be unique. If noNodeNameis defined then theNodedoes not have a name.
- static new()¶
Instantiates a new
NodeBuilder
- signal_handling_mode(value)¶
Defines the
SignalHandlingModefor theNode. It affects theNode.wait()call that returns any received signal via itsNodeWaitFailure
- exception iceoryx2.NodeCleanupFailure¶
Bases:
ExceptionErrors caused by cleaning up the stale resources of a dead node.
- class iceoryx2.NodeDetails¶
Bases:
objectContains details of a
Node.- config¶
Returns a reference to the
config.ConfigtheNodeuses.
- class iceoryx2.NodeName¶
Bases:
objectRepresent the name for a
Node.- static new(name)¶
Creates a new
NodeName. If the provided name does not contain a validNodeNameit will emitSemanticStringError, otherwise theNodeName.
- class iceoryx2.NodeState¶
Bases:
objectDescribes the state of a
Node.- class Dead(_0)¶
Bases:
NodeStateThe
Node’s process died without cleaning up theNode’s resources. Another process has now the responsibility to cleanup all the stale resources.
- class iceoryx2.Notifier¶
Bases:
objectRepresents the sending endpoint of an event based communication.
- id¶
Returns the
UniqueNotifierIdof theNotifier
- notify()¶
Notifies all
Listenerconnected to the service with the default event id provided on creation. Returns on success the number ofListenerports that were notified otherwise it emitsNotifierNotifyError.
- notify_with_custom_event_id(event_id)¶
Notifies all
Listenerconnected to the service with a customEventId. Returns on success the number ofListenerports that were notified otherwise it returnsNotifierNotifyError.
- exception iceoryx2.NotifierCreateError¶
Bases:
ExceptionErrors caused when creating a new Notifier port.
- exception iceoryx2.NotifierNotifyError¶
Bases:
ExceptionErrors caused when sending a notification via the Notifier port in an event service.
- class iceoryx2.Path¶
Bases:
objectRelocatable (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 new(name)¶
Creates a new
Pathwhen the providednamecontains a valid path, otherwise it emits aSemanticStringError.
- class iceoryx2.PendingResponse¶
Bases:
objectRepresents an active connection to all
Serverthat received theRequestMut. TheClientcan use it to receive every correspondingResponse.As soon as it goes out of scope, the connections are closed and every
Serveris informed.- delete()¶
Releases the
PendingResponseand signals theServerthat theClientis no longer interested in receiving anotherResponseand terminates the connection.After this call the
PendingResponseis no longer usable!
- header¶
Returns a reference to the iceoryx2 internal
RequestHeaderof the correspondingRequestMut
- is_connected¶
Returns
Trueuntil theActiveRequestgoes out of scope on theServer’s side indicating that theServerwill no longer send aResponse. It also returnsFalsewhen there are noServer.
- number_of_server_connections¶
Returns how many
Serverports received the correspondingRequestMutinitially.
- payload() Any¶
Returns the payload of the request.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the request payload of the corresponding
RequestMutas anint.PendingResponse.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- receive()¶
Receives a
Responsefrom aServerthat received theRequestMut.
- set_disconnect_hint()¶
Marks the connection state that the
Clientwants to gracefully disconnect. When theServerreads this, it can send the lastResponseand drop the correspondingActiveRequestto terminate the connection ensuring that noResponseis lost on theClientside.
- user_header() Any¶
Returns a
ctypes.POINTERto the request header.
- user_header_ptr¶
Returns the address of the user defined request header of the corresponding
RequestMutas anint.PendingResponse.user_headerprovides typed access.
- class iceoryx2.PortFactoryBlackboard¶
Bases:
objectThe factory for
MessagingPattern.Blackboard. It can acquire dynamic and static service information and createReaderorWriterports.- attributes¶
Returns the
AttributeSetdefined in theService.
- blocking_cleanup_dead_nodes(timeout)¶
Removes the stale system resources of every dead
Nodeconnected to this service.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped. If it is currently being cleaned up by another process then the cleaner will wait until the timeout as either passed or the cleaned was finished.The timeout is applied to every individual dead
Nodethe function needs to wait on.
- delete()¶
Releases the
PortFactoryBlackboard.After this call the
PortFactoryBlackboardis no longer usable!
- dynamic_config¶
Returns the dynamic configuration, including the current port counts.
- list_keys()¶
Returns a list containing copies of the blackboard keys as bytes.
The keys are wrapped in a
BlackboardKey. Use decode_as() to reinterpret the raw bytes as a ctypes type.
- name¶
Returns the
ServiceNameof the service.
- reader_builder()¶
Returns a
PortFactoryReaderto create a newReaderport
- service_hash¶
Returns the
ServiceHashof theService.
- static_config¶
Returns the StaticConfig of the
Service. Contains all settings that never change during the lifetime of the service.
- try_cleanup_dead_nodes()¶
Removes the stale system resources of every dead
Nodeconnected to this service.If a
Nodecannot be cleaned up since the process has insufficient permissions or it is currently being cleaned up by another process then theNodeis skipped.
- writer_builder()¶
Returns a
PortFactoryWriterto create a newWriterport
- class iceoryx2.PortFactoryClient¶
Bases:
objectFactory to create a new
Clientport/endpoint forMessagingPattern.RequestResponsebased communication.- allocation_strategy(value: AllocationStrategy) PortFactoryClient¶
Defines the allocation strategy that is used when the memory is exhausted.
- backpressure_strategy(value)¶
Sets the
BackpressureStrategywhich defines how theClientshall behave when aServercannot receive aRequestMutsince its internal buffer is full.
- create()¶
Creates a new
Clientor emits aClientCreateErroron failure.
- initial_max_slice_len(value: int) PortFactoryClient¶
Sets the maximum slice length that a user can allocate.
- initial_reserved_memory(value: int) PortFactoryClient¶
Sets the maximum initial reserved memory that the underlying allocator reserves for the flatbuffer builder.
- max_active_requests(value)¶
Defines the maximal active requests the
Clientcan send. Smallest possible value is1.
- name(value)¶
The
PortNamethat shall be assigned to theClient. It does not have to be unique. If noPortNameis defined then theClientdoes not have a name.
- override_request_preallocation(value)¶
Reduces the preallocated
RequestMutcount. The return value is clamped between1and the worst case preallocatedRequestMutcount required to guarantee that theClientalways has aRequestMutto loan and send.# Important
If the user reduces the preallocated
RequestMutcount, iceoryx2 can no longer guarantee, that theClientcan always loan aRequestMutto send.
- class iceoryx2.PortFactoryEvent¶
Bases:
objectThe factory for
MessagingPattern.Event. It can acquire dynamic and static service information and createNotifierorListenerports.- attributes¶
Returns the
AttributeSetdefined in theService
- blocking_cleanup_dead_nodes(timeout)¶
Removes the stale system resources of every dead
Nodeconnected to this service.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped. If it is currently being cleaned up by another process then the cleaner will wait until the timeout as either passed or the cleaned was finished.The timeout is applied to every individual dead
Nodethe function needs to wait on.
- dynamic_config¶
Returns the dynamic configuration, including the current port counts.
- listener_builder()¶
Returns a
PortFactoryListenerto create a newListenerport
- name¶
Returns the
ServiceNameof the service
- notifier_builder()¶
Returns a
PortFactoryNotifierto create a newNotifierport
- service_hash¶
Returns the
ServiceHashof theService
- class iceoryx2.PortFactoryListener¶
Bases:
objectFactory to create a new
Listenerport/endpoint forMessagingPattern.Eventbased communication.- create()¶
Creates the
Listenerport or emits aListenerCreateErroron failure.
- class iceoryx2.PortFactoryNotifier¶
Bases:
objectFactory to create a new
Notifierport/endpoint forMessagingPattern.Eventbased communication.- create()¶
Creates a new
Notifierport or emits aNotifierCreateErroron failure.
- default_event_id(value)¶
Sets a default
EventIdfor theNotifierthat is used inNotifier.notify()
- class iceoryx2.PortFactoryPublishSubscribe¶
Bases:
objectThe factory for
MessagingPattern.PublishSubscribe. It can acquire dynamic and static service information and createPublisherorSubscriberports.- attributes¶
Returns the
AttributeSetdefined in theService
- blocking_cleanup_dead_nodes(timeout)¶
Removes the stale system resources of every dead
Nodeconnected to this service.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped. If it is currently being cleaned up by another process then the cleaner will wait until the timeout as either passed or the cleaned was finished.The timeout is applied to every individual dead
Nodethe function needs to wait on.
- dynamic_config¶
Returns the dynamic configuration, including the current port counts.
- name¶
Returns the
ServiceNameof the service
- publisher_builder()¶
Returns a
PortFactoryPublisherto create a newPublisherport
- service_hash¶
Returns the
ServiceHashof theService
- static_config¶
Returns the StaticConfig of the
Service. Contains all settings that never change during the lifetime of the service.
- subscriber_builder()¶
Returns a
PortFactorySubscriberto create a newSubscriberport
- class iceoryx2.PortFactoryPublisher¶
Bases:
objectFactory to create a new
Publisherport/endpoint forMessagingPattern.PublishSubscribebased communication.- allocation_strategy(value: AllocationStrategy) PortFactoryPublisher¶
Defines the allocation strategy that is used when the memory is exhausted.
- backpressure_strategy(value)¶
Sets the
BackpressureStrategy.
- create()¶
Creates a new
Publisheror emits aPublisherCreateErroron failure.
- initial_max_slice_len(value: int) PortFactoryPublisher¶
Sets the maximum slice length that a user can allocate.
- initial_reserved_memory(value: int) PortFactoryPublisher¶
Sets the maximum initial reserved memory that the underlying allocator reserves for the flatbuffer builder.
- max_loaned_samples(value)¶
Defines how many
SampleMutthePublishercan loan withPublisher.loan_uninitorPublisher.loan_slice_uninitin parallel.
- name(value)¶
The
PortNamethat shall be assigned to thePublisher. It does not have to be unique. If noPortNameis defined then thePublisherdoes not have a name.
- override_sample_preallocation(value)¶
Reduces the preallocated
SampleMutcount. The return value is clamped between1and the worst case preallocatedSampleMutcount required to guarantee that thePublisheralways has aSampleMutto loan and send.# Important
If the user reduces the preallocated
SampleMutcount, iceoryx2 can no longer guarantee, that thePublishercan always loan aSampleMutto send.
- class iceoryx2.PortFactoryReader¶
Bases:
objectFactory to create a new
Readerport/endpoint forMessagingPattern.Blackboardbased communication.- create()¶
Creates a new
Readeror emits aReaderCreateErroron failure.
- class iceoryx2.PortFactoryRequestResponse¶
Bases:
objectThe factory for
MessagingPattern.RequestResponse. It can acquire dynamic and static service information and createClientorServerports.- attributes¶
Returns the
AttributeSetdefined in theService
- blocking_cleanup_dead_nodes(timeout)¶
Removes the stale system resources of every dead
Nodeconnected to this service.If a
Nodecannot be cleaned up since the process has insufficient permissions then theNodeis skipped. If it is currently being cleaned up by another process then the cleaner will wait until the timeout as either passed or the cleaned was finished.The timeout is applied to every individual dead
Nodethe function needs to wait on.
- client_builder()¶
Returns a
PortFactoryClientto create a newClientport
- dynamic_config¶
Returns the dynamic configuration, including the current port counts.
- name¶
Returns the
ServiceNameof the service
- server_builder()¶
Returns a
PortFactoryServerto create a newServerport
- service_hash¶
Returns the
ServiceHashof theService
- class iceoryx2.PortFactoryServer¶
Bases:
objectFactory to create a new
Serverport/endpoint forMessagingPattern.RequestResponsebased communication.- allocation_strategy(value: AllocationStrategy) PortFactoryServer¶
Defines the allocation strategy that is used when the memory is exhausted.
- backpressure_strategy(value)¶
Sets the
BackpressureStrategywhich defines how theServershall behave when aClientcannot receive aResponsesince its internal buffer is full.
- create()¶
Creates a new
Serveror emits aServerCreateErroron failure.
- initial_max_slice_len(value: int) PortFactoryServer¶
Sets the maximum slice length that a user can allocate.
- initial_reserved_memory(value: int) PortFactoryServer¶
Sets the maximum initial reserved memory that the underlying allocator reserves for the flatbuffer builder.
- max_loaned_responses_per_request(value)¶
Defines the maximum number of
ResponseMutthat theServercan loan in parallel perActiveRequest.
- name(value)¶
The
PortNamethat shall be assigned to theServer. It does not have to be unique. If noPortNameis defined then theServerdoes not have a name.
- override_response_preallocation(value)¶
Reduces the preallocated
ResponseMutcount. The return value is clamped between1and the worst case preallocatedResponseMutcount required to guarantee that theServeralways has aResponseMutto loan and send.# Important
If the user reduces the preallocated
ResponseMutcount, iceoryx2 can no longer guarantee, that theServercan always loan aResponseMutto send.
- class iceoryx2.PortFactorySubscriber¶
Bases:
objectFactory to create a new
Subscriberport/endpoint forMessagingPattern.PublishSubscribebased communication.- buffer_size(value)¶
Defines the buffer size of the
Subscriber. Smallest possible value is1.
- create()¶
Creates a new
Subscriberor emits aSubscriberCreateErroron failure.
- history_request(value)¶
Defines the amount of requested history samples. By default the value defined with the service’s
history_sizeis used
- name(value)¶
The
PortNamethat shall be assigned to theSubscriber. It does not have to be unique. If noPortNameis defined then theSubscriberdoes not have a name.
- class iceoryx2.PortFactoryWriter¶
Bases:
objectFactory to create a new
Writerport/endpoint forMessagingPattern.Blackboardbased communication.- create()¶
Creates a new
Writeror returns aWriterCreateErroron failure.
- class iceoryx2.PortName¶
Bases:
objectRepresent the name for a port.
- static new(name)¶
Creates a new
PortName. If the provided name does not contain a validPortNameit will emitSemanticStringError, otherwise thePortName.
- exception iceoryx2.PublishSubscribeCreateError¶
Bases:
ExceptionErrors caused when creating a publish-subscribe service.
- exception iceoryx2.PublishSubscribeOpenError¶
Bases:
ExceptionErrors caused when opening a publish-subscribe service.
- exception iceoryx2.PublishSubscribeOpenOrCreateError¶
Bases:
ExceptionErrors caused when open or creating a publish-subscribe service.
- class iceoryx2.Publisher¶
Bases:
objectRepresents the receiving endpoint of an event based communication.
- backpressure_strategy¶
Returns the strategy the
Publisherfollows when aSampleMutcannot be delivered since theSubscriber’s buffer is full.
- id¶
Returns the
UniquePublisherIdof thePublisher
- loan_flatbuffer() SampleMutUninit¶
Loans/allocates a
SampleMutUninitfrom the underlying data segment of thePublisherwith an integrated flatbuffer builder.
- loan_slice_uninit(number_of_elements: int) SampleMutUninit¶
Loans/allocates a
SampleMutUninitfrom the underlying data segment of thePublisher.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
LoanErrordescribing the failure.
- loan_uninit() SampleMutUninit¶
Loans/allocates a
SampleMutUninitfrom the underlying data segment of thePublisher.The user has to initialize the payload before it can be sent. On failure it returns
LoanErrordescribing the failure.
- update_connections()¶
Explicitly updates the connection to every
Subscriber. This is required to be called whenever a newSubscriberconnected to the service. It is done implicitly wheneverSampleMut.sendorPublisher.send_copyis called. When aSubscriberis connected that requires a history this call will deliver it.
- exception iceoryx2.PublisherCreateError¶
Bases:
ExceptionErrors caused when creating a publisher port.
- class iceoryx2.Reader¶
Bases:
objectRepresents the reading endpoint of a blackboard based communication.
- entry(key: Type[K], value: Type[V]) EntryHandle¶
Creates an EntryHandle for direct read access to the value.
On failure it returns
EntryHandleErrordescribing the failure.
- id¶
Returns the
UniqueReaderIdof theReader
- class iceoryx2.RequestHeader¶
Bases:
objectRequest header used by
MessagingPattern.RequestResponse- client_id¶
Returns the
UniqueClientIdof theClientwhich sent theRequestMut
- number_of_elements¶
Returns how many elements are stored inside the requests’s payload.
- payload_offset¶
Returns the payload offset.
- class iceoryx2.RequestMut¶
Bases:
objectThe
RequestMutrepresents the object that contains the payload that theClientsends to theServer.- delete()¶
Releases the
RequestMut.After this call the
RequestMutis no longer usable!
- header¶
Returns the iceoryx2 internal
RequestHeader
- payload() Any¶
Returns the payload of the request.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the user defined request payload as an
int.RequestMut.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- send()¶
Sends the
RequestMutto every connectedServerof theService.
- user_header() Any¶
Returns a
ctypes.POINTERto the request header.
- user_header_ptr¶
Returns the address of the user defined request header as an
int.RequestMut.user_headerprovides typed access.
- class iceoryx2.RequestMutUninit¶
Bases:
objectA version of the
RequestMutwhere the payload is not initialized which allows true zero copy usage. To send aRequestMutUninitit must be first initialized and converted intoRequestMutwithRequestMutUninit.assume_init.- assume_init(root=None) RequestMut¶
Extracts the value of the uninitialized payload and labels the
RequestMutUninitas initializedRequestMut.After this call the
RequestMutUninitis no longer usable!
- delete()¶
Releases the
RequestMutUninit.After this call the
RequestMutUninitis no longer usable!
- flatbuffer_builder() Builder¶
Returns the flatbuffer builder to produce the data that shall be sent.
- header¶
Returns the iceoryx2 internal
RequestHeader
- payload() Any¶
Returns the payload of the request.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_ptr¶
Returns the address of the user defined request payload as an
int.RequestMutUninit.payloadprovides typed access.
- user_header() Any¶
Returns a
ctypes.POINTERto the request header.
- user_header_ptr¶
Returns the address of the user defined request header as an
int.RequestMutUninit.user_headerprovides typed access.
- write_payload(t: Type[ReqT]) RequestMut¶
Writes the provided payload into the request.
- exception iceoryx2.RequestResponseCreateError¶
Bases:
ExceptionErrors caused when creating a request-response service.
- exception iceoryx2.RequestResponseOpenError¶
Bases:
ExceptionErrors caused when opening a request-response service.
- exception iceoryx2.RequestResponseOpenOrCreateError¶
Bases:
ExceptionErrors caused when open or creating a request-response service.
- class iceoryx2.Response¶
Bases:
objectIt stores the payload and can be received by the
PendingResponseafter aRequestMutwas sent to aServervia theClient.- header¶
Returns the
ResponseHeader
- origin¶
Returns the
UniqueServerIdof theServerwhich sent theResponse.
- payload() Any¶
Returns the payload of the response.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the payload of the response as an
int.Response.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- user_header() Any¶
Returns a
ctypes.POINTERto the response header.
- user_header_ptr¶
Returns the address of the user header of the response as an
int.Response.user_headerprovides typed access.
- class iceoryx2.ResponseHeader¶
Bases:
objectResponse header used by
MessagingPattern.RequestResponse- payload_offset¶
Returns the payload offset.
- server_id¶
Returns the
UniqueServerIdof theServerwhich sent theResponse
- class iceoryx2.ResponseMut¶
Bases:
object- delete()¶
Releases the
ResponseMut.After this call the
ResponseMutis no longer usable!
- header¶
Returns a reference to the
ResponseHeader.
- payload() Any¶
Returns the payload of the response.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the payload of the response as an
int.ResponseMut.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- send()¶
Sends a
ResponseMutto the correspondingPendingResponseof theClient.
- user_header() Any¶
Returns a
ctypes.POINTERto the response header.
- user_header_ptr¶
Returns the address of the user header of the response as an
int.ResponseMut.user_headerprovides typed access.
- class iceoryx2.ResponseMutUninit¶
Bases:
object- Acquired by an
ActiveRequestwith
It stores the uninitialized payload of the response. It must be initialized and converted into a
ResponseMutwithResponseMutUninit.write_payloadorResponseMutUninit.assume_initbefore it can be sent. Otherwise the loaned memory is released when going out of scope.- assume_init(root=None) ResponseMut¶
Extracts the value of the uninitialized payload and labels the
ResponseMutUninitas initializedResponseMut.After this call the
ResponseMutUninitis no longer usable!
- delete()¶
Releases the
ResponseMutUninit.After this call the
ResponseMutUninitis no longer usable!
- flatbuffer_builder() Builder¶
Returns the flatbuffer builder to produce the data that shall be sent.
- header¶
Returns a reference to the
ResponseHeader.
- payload() Any¶
Returns the payload of the response.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_ptr¶
Returns the address of the payload of the response as an
int.ResponseMutUninit.payloadprovides typed access.
- user_header() Any¶
Returns a
ctypes.POINTERto the response header.
- user_header_ptr¶
Returns the address of the user header of the response as an
int.ResponseMutUninit.user_headerprovides typed access.
- write_payload(t: Type[ReqT]) ResponseMut¶
Writes the provided payload into the response.
- Acquired by an
- class iceoryx2.Sample¶
Bases:
objectIt stores the payload and is acquired by the
Subscriberwhenever it receives new data from aPublisherviaSubscriber.receive.- header¶
Returns the
HeaderPublishSubscribeof theSample.
- payload() Any¶
Returns the payload.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the payload as an
int.Sample.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- user_header() Any¶
Returns a
ctypes.POINTERto the user header.
- user_header_ptr¶
Returns the address of the user header as an
int.Sample.user_headerprovides typed access.
- class iceoryx2.SampleMut¶
Bases:
object- Acquired by initializing a
SampleMutUninitvia
It stores the payload that will be sent to every connected
Subscriber. If theSampleMutis not sent it will release the loaned memory when going out of scope.- header¶
Returns the
HeaderPublishSubscribeof theSample.
- payload() Any¶
Returns the payload.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_bytes() Slice[c_ubyte]¶
Returns the serialized flatbuffer data as bytes.
Only available when the payload type is a
Flatbuffer.
- payload_ptr¶
Returns the address of the payload as an
int.SampleMut.payloadprovides typed access.
- payload_root() Any¶
Returns the root of the flatbuffer.
Only available when the payload type is a
Flatbuffer.
- send()¶
Send a previously loaned
Publisher.loan_uninitSampleMutto every connectedSubscriberof the service.On success the number of
Subscriberports that received the data is returned, otherwise aSendErroris emitted describing the failure.
- user_header() Any¶
Returns a
ctypes.POINTERto the user header.
- user_header_ptr¶
Returns the address of the user header as an
int.SampleMut.user_headerprovides typed access.
- Acquired by initializing a
- class iceoryx2.SampleMutUninit¶
Bases:
object- Acquired by a
Publishervia
It stores the uninitialized payload. It must be initialized and converted into a
SampleMutwithSampleMutUninit.write_payloadorSampleMutUninit.assume_initbefore it can be sent. Otherwise the loaned memory is released when going out of scope.- assume_init(root=None) SampleMut¶
Extracts the value of the uninitialized payload and labels the
SampleMutUninitas initializedSampleMut.After this call the
SampleMutUninitis no longer usable.
- delete()¶
Releases the
SampleMutUninit.After this call the
SampleMutUninitis no longer usable!
- flatbuffer_builder() Builder¶
Returns the flatbuffer builder to produce the data that shall be sent.
- header¶
Returns the
HeaderPublishSubscribeof theSample.
- payload() Any¶
Returns the payload.
It is a
Slicewhen the payload type is aSlice, otherwise actypes.POINTERto the payload type.
- payload_ptr¶
Returns the address of the payload as an
int.SampleMutUninit.payloadprovides typed access.
- user_header() Any¶
Returns a
ctypes.POINTERto the user header.
- user_header_ptr¶
Returns the address of the user header as an
int.SampleMutUninit.user_headerprovides typed access.
- Acquired by a
- exception iceoryx2.SemanticStringError¶
Bases:
ExceptionErrors caused by creating a semantic string.
- class iceoryx2.Server¶
Bases:
objectRepresents the receiving endpoint of an event based communication.
- backpressure_strategy¶
Returns the strategy the
Serverfollows when aResponseMutcannot be delivered if theClient’s buffer is full.
- has_requests¶
Returns true if the
Serverhas aRequestMutin its buffer.
- id¶
Returns the
UniqueServerIdof theServer
- receive()¶
Receives a
RequestMutthat was sent by aClientand returns anActiveRequestwhich can be used to respond. If noRequestMutwas received it returnsNone.
- class iceoryx2.Service¶
Bases:
objectBuilder to create or open a
Service- static details(service_name, config, messaging_pattern, service_type)¶
Acquires the
ServiceDetailsof aService.
- static does_exist(service_name, config, messaging_pattern, service_type)¶
Checks if a service under a given
config.Configdoes exist
- static list(config, service_type)¶
Returns a list of all services created under a given
config.Config.
- class iceoryx2.ServiceBuilder¶
Bases:
objectBuilder to create or open a
Service- blackboard_creator(key: Type[K]) ServiceBuilderBlackboardCreator¶
Returns the
ServiceBuilderBlackboardCreatorto create a new blackboard service.The key ctype must be provided as argument. If the key is of type ctypes.Structure, it must implement __eq__.
- blackboard_opener(key: Type[K]) ServiceBuilderBlackboardOpener¶
Returns the
ServiceBuilderBlackboardOpenerto open a blackboard service.The key ctype must be provided as argument.
- event()¶
Create a new builder to create a
MessagingPattern.EventService.
- publish_subscribe(t: Type[T]) ServiceBuilderPublishSubscribe¶
Returns the
ServiceBuilderPublishSubscribeto 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
ServiceBuilderRequestResponseto create a new request-response service.The request/response payload ctype must be provided as argument.
- class iceoryx2.ServiceBuilderBlackboardCreator¶
Bases:
objectBuilder to create a new
MessagingPattern.BlackboardbasedService- add(key: Type[K], value: Type[V]) ServiceBuilderBlackboardCreator¶
Adds a key-value pair to the blackboard.
- class iceoryx2.ServiceBuilderBlackboardOpener¶
Bases:
objectBuilder to open a new
MessagingPattern.BlackboardbasedService
- class iceoryx2.ServiceBuilderEvent¶
Bases:
objectBuilder to create a new
MessagingPattern.EventbasedService- deadline(deadline)¶
Enables the deadline property of the service. There must be a notification emitted by any
Notifierafter at least the provideddeadline.
- disable_deadline()¶
Disables the deadline property of the service.
Notifiercan signal notifications at any rate.
- disable_notifier_created_event()¶
If the
Serviceis created it disables the event that shall be emitted by every newly createdNotifier.
- disable_notifier_dead_event()¶
If the
Serviceis created it disables the event that shall be emitted when aNotifieris identified as dead.
- disable_notifier_dropped_event()¶
If the
Serviceis created it disables the event that shall be emitted by everyNotifierbefore it is dropped.
- event_id_max_value(value)¶
If the
Serviceis created it set the greatest supportedEventIdvalue If an existingServiceis opened it defines the value size theEventIdmust at least support.
- max_listeners(value)¶
If the
Serviceis created it defines how manyListenershall be supported at most. If an existingServiceis opened it defines how manyListenermust be at least supported.
- max_nodes(value)¶
If the
Serviceis created it defines how manyNodeinstances shall be able to open it in parallel. If an existingServiceis opened it defines how manyNodeinstances must be at least supported.
- max_notifiers(value)¶
If the
Serviceis created it defines how manyNotifiershall be supported at most. If an existingServiceis opened it defines how manyNotifiermust be at least supported.
- notifier_created_event(value)¶
If the
Serviceis created it defines the event that shall be emitted by every newly createdNotifier.
- notifier_dead_event(value)¶
If the
Serviceis created it defines the event that shall be emitted when aNotifieris identified as dead.
- notifier_dropped_event(value)¶
If the
Serviceis created it defines the event that shall be emitted by everyNotifierbefore it is dropped.
- open()¶
Opens an existing
Service. Emits anEventOpenErroron failure.
- open_or_create()¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. On failure it emits anEventOpenOrCreateError
- open_or_create_with_attributes(verifier)¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. It defines a set of attributes. If theServicealready exists all attribute requirements must be satisfied otherwise the open process will fail. If theServicedoes not exist the required attributes will be defined in theService. Emits andEventOpenOrCreateErroron failure.
- open_with_attributes(verifier)¶
Opens an existing
Servicewith attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. Emits anEventOpenErroron failure.
- class iceoryx2.ServiceBuilderPublishSubscribe¶
Bases:
objectBuilder to create a new
MessagingPattern.PublishSubscribebasedService- create()¶
Creates a new
Service. On failure it emitsPublishSubscribeCreateError.
- create_with_attributes(attributes)¶
Creates a new
Servicewith a set of attributes. On failure it emitsPublishSubscribeCreateError.
- enable_safe_overflow(value)¶
If the
Serviceis created, defines the overflow behavior of the service. If an existingServiceis opened it requires the service to have the defined overflow behavior.
- flatbuffer_schema_path(value: FilePath) PortFactoryPublisher¶
Sets the path to the flatbuffer schema file.
If this is not explicitly defined, iceoryx2 will try to find the best fitting schema file in the configured flatbuffer schema paths defined in the config.
- history_size(value)¶
If the
Serviceis created it defines the maximum history size aSubscribercan request on connection. If an existingServiceis opened it defines the minimum required.
- max_nodes(value)¶
If the
Serviceis created it defines how manyNodeinstances shall be able to open it in parallel. If an existingServiceis opened it defines how manyNodeinstances must be at least supported.
- max_publishers(value)¶
If the
Serviceis created it defines how manyPublishershall be supported at most. If an existingServiceis opened it defines how manyPublishermust be at least supported.
- max_subscribers(value)¶
If the
Serviceis created it defines how manySubscribershall be supported at most. If an existingServiceis opened it defines how manySubscribermust be at least supported.
- open()¶
Opens an existing
Service. On failure it emitsPublishSubscribeOpenError.
- open_or_create()¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. On failure it emitsPublishSubscribeOpenOrCreateError
- open_or_create_with_attributes(verifier)¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. It defines a set of attributes. If theServicealready exists all attribute requirements must be satisfied otherwise the open process will fail. If theServicedoes not exist the required attributes will be defined in theService. On failure it emitsPublishSubscribeOpenOrCreateError
- open_with_attributes(verifier)¶
Opens an existing
Servicewith attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. On failure it emitsPublishSubscribeOpenError.
- 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
Servicethe payload alignment must be identical in all participants since the communication is always strongly typed.
- subscriber_max_borrowed_samples(value)¶
If the
Serviceis created it defines theSamplecount aSubscribercan borrow at most in parallel. If an existingServiceis opened it defines the minimum required.
- subscriber_max_buffer_size(value)¶
If the
Serviceis created it defines how manySampleaSubscribercan store in its internal buffer. If an existingServiceis opened it defines the minimum required.
- user_header(t: Type[T]) ServiceBuilderPublishSubscribe¶
Sets the user header type for the service.
- class iceoryx2.ServiceBuilderRequestResponse¶
Bases:
objectBuilder to create a new
MessagingPattern.RequestResponsebasedService- create()¶
Creates a new
Service. On failureRequestResponseCreateErrorwill be emitted.
- create_with_attributes(attributes)¶
Creates a new
Servicewith a set of attributes. On failureRequestResponseCreateErrorwill be emitted.
- enable_fire_and_forget_requests(value)¶
If the
Serviceis created, defines the fire-and-forget behavior of the service for requests.
- enable_safe_overflow_for_requests(value)¶
If the
Serviceis created, defines the overflow behavior of the service for requests. If an existingServiceis opened it requires the service to have the defined overflow behavior.
- enable_safe_overflow_for_responses(value)¶
If the
Serviceis created, defines the overflow behavior of the service for responses. If an existingServiceis opened it requires the service to have the defined overflow behavior.
- max_active_requests_per_client(value)¶
Defines how many active requests a
Servercan hold in parallel perClient. The objects are used to send answers to a request that was received earlier from aClient.
- max_borrowed_responses_per_pending_response(value)¶
If the
Serviceis created it defines theResponsecount that shall be able to be borrowed in parallel perPendingResponse. If an existingServiceis opened it defines how many borrows must be at least supported.
- max_clients(value)¶
If the
Serviceis created it defines how manyClientports shall be supported at most. If an existingServiceis opened it defines how manyClientports must be at least supported.
- max_loaned_requests(value)¶
If the
Serviceis created it defines how manyRequestMutaClientcan loan in parallel.
- max_nodes(value)¶
If the
Serviceis created it defines how manyNodeinstances shall be able to open it in parallel. If an existingServiceis opened it defines how manyNodeinstances must be at least supported.
- max_response_buffer_size(value)¶
If the
Serviceis created it defines how many responses fit in theClient’s buffer. If an existingServiceis opened it defines the minimum required.
- max_servers(value)¶
If the
Serviceis created it defines how manyServerports shall be supported at most. If an existingServiceis opened it defines how manyServerports must be at least supported.
- open()¶
Opens an existing
Service. On failureRequestResponseOpenErrorwill be emitted.
- open_or_create()¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. On failureRequestResponseOpenOrCreateErrorwill be emitted.
- open_or_create_with_attributes(verifier)¶
If the
Serviceexists, it will be opened otherwise a newServicewill be created. It defines a set of attributes.If the
Servicealready exists all attribute requirements must be satisfied, and service payload type must be the same, otherwise the open process will fail. If theServicedoes not exist the required attributes will be defined in theService. On failureRequestResponseOpenOrCreateErrorwill be emitted.
- open_with_attributes(verifier)¶
Opens an existing
Servicewith attribute requirements. If the defined attribute requirements are not satisfied the open process will fail. On failureRequestResponseOpenErrorwill be emitted.
- request_flatbuffer_schema_path(value: FilePath) ServiceBuilderRequestResponse¶
Sets the path to the flatbuffer schema file.
If this is not explicitly defined, iceoryx2 will try to find the best fitting schema file in the configured filebuffer schema paths defined in the config.
- 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
Servicethe payload alignment must be identical in all participants since the communication is always strongly typed.
- response_flatbuffer_schema_path(value: FilePath) ServiceBuilderRequestResponse¶
Sets the path to the flatbuffer schema file.
If this is not explicitly defined, iceoryx2 will try to find the best fitting schema file in the configured filebuffer schema paths defined in the config.
- response_header(response: Type[ResT]) ServiceBuilderPublishSubscribe¶
Sets the response header type for the service.
- class iceoryx2.ServiceDetails¶
Bases:
objectRepresents all the
Serviceinformation that one can acquire withService.list.- messaging_pattern()¶
Returns the
Service’s underlyingMessagingPattern.
- name()¶
Returns the
ServiceName
- service_hash()¶
Returns the unique
ServiceHashof theService
- exception iceoryx2.ServiceDetailsError¶
Bases:
ExceptionErrors caused when acquiring the details of a service.
- class iceoryx2.ServiceHash¶
Bases:
objectThe unique id of a
Service- as_str¶
Returns a String containing the
ServiceHashvalue
- static max_number_of_characters()¶
Returns the maximum string length of a
ServiceHash
- class iceoryx2.ServiceName¶
Bases:
objectRelocatable (inter-process shared memory compatible)
SemanticStringimplementation forServiceName. 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
ServiceNamewhen the providednamecontains a valid path to a file, otherwise it emits aSemanticStringError.
- to_string()¶
Converts the
ServiceNameinto astr
- exception iceoryx2.ServiceRemoveError¶
Bases:
ExceptionErrors caused when a Service is removed with Node::force_remove_service().
- class iceoryx2.ServiceType¶
Bases:
objectDefines the type of the
Serviceand what kind of resources and operating system mechanisms it shall use.- Ipc = ServiceType.Ipc¶
- Local = ServiceType.Local¶
- class iceoryx2.SignalHandlingMode¶
Bases:
objectDefines 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], owner: Any = None)[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_memory_view() memoryview[source]¶
Returns a
memoryviewover the elements of theSlice, without copying.
- class iceoryx2.StaticConfigBlackboard¶
Bases:
objectThe static configuration of an
MessagingPattern.BlackboardbasedService. Contains all parameters that do not change during the lifetime of aService.
- class iceoryx2.StaticConfigEvent¶
Bases:
objectThe static configuration of an
MessagingPattern.Eventbased service. Contains all parameters that do not change during the lifetime of aService.- deadline¶
Returns the deadline of the service. If no new notification is signaled from any
Notifierafter the given deadline, it is rated as an error and everyListenerthat is attached to aWaitSetis woken up and notified about the missed
- class iceoryx2.StaticConfigPublishSubscribe¶
Bases:
objectThe static configuration of an
MessagingPattern.PublishSubscribebasedService. Contains all parameters that do not change during the lifetime of aService.- has_safe_overflow¶
Returns true if the
Servicesafely overflows, otherwise false. Safe overflow means that thePublisherwill recycle the oldestSamplefrom theSubscriberwhen 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
Nodeinstances that can open theServicein parallel.
- max_subscribers¶
Returns the maximum supported amount of
Subscriberports
- subscriber_max_borrowed_samples¶
Returns how many
SampleaSubscriberport can borrow in parallel at most.
- subscriber_max_buffer_size¶
Returns the maximum supported buffer size for
Subscriberport
- class iceoryx2.StaticConfigRequestResponse¶
Bases:
objectThe static configuration of an
MessagingPattern.RequestResponsebased service. Contains all parameters that do not change during the lifetime of aService.- does_support_fire_and_forget_requests¶
Returns true if a fire and forget
RequestMutcan be sent from theClient, otherwise false.
- has_safe_overflow_for_requests¶
Returns true if the request buffer of the
Servicesafely overflows, otherwise false. Safe overflow means that theClientwill recycle the oldest requests from theServerwhen its buffer is full.
- has_safe_overflow_for_responses¶
Returns true if the response buffer of the
Servicesafely overflows, otherwise false. Safe overflow means that theServerwill recycle the oldest responses from theClientwhen its buffer is full.
- max_active_requests_per_client¶
Returns the maximum of active requests a
Servercan hold in parallel perClient.
- max_borrowed_responses_per_pending_response¶
Returns the maximum borrowed
Responsecount aClientcan hold in parallel perPendingResponse
- max_loaned_requests¶
Returns the maximum number of
RequestMutaClientcan loan in parallel.
- max_response_buffer_size¶
Returns the maximum buffer size for responses for a
PendingResponse.
- class iceoryx2.Subscriber¶
Bases:
objectRepresents the receiving endpoint of a publish-subscribe based communication.
- buffer_size¶
Returns the internal buffer size of the
Subscriber.
- delete()¶
Releases the
Subscriber.After this call the
Subscriberis no longer usable!
- has_samples()¶
Returns true if the
Subscriberhas samples in the buffer that can be received withSubscriber.receive. EmitsConnectionFailureon error.
- id¶
Returns the
UniqueSubscriberIdof theSubscriber
- name¶
Returns the
PortNameof theSubscriber
- receive()¶
Receives a
SamplefromPublisher. If no sample could be receivedNoneis returned. If a failure occursReceiveErroris returned.
- exception iceoryx2.SubscriberCreateError¶
Bases:
ExceptionErrors caused when creating a subscriber port.
- class iceoryx2.TypeDetail¶
Bases:
objectContains all type details required to connect to a
Service- alignment(alignment)¶
Sets the alignment of the type
- static new()¶
Creates a new
TypeDetailfor the unit type. Meaning size == 0, alignment == 1
- size(size)¶
Sets the size of the type
- type_variant(value)¶
Defines the
TypeVariantof the defined type.TypeVariant.FixedSizeif the type has always the same size like anctypes.c_uint64orTypeVariant.Dynamicwhen it is a dynamic array or vector
- class iceoryx2.TypeName¶
Bases:
objectRepresents the string name of a type. The name shall uniquely identify the type in the communication system.
- static new(name)¶
Creates a new
TypeName. If the providednameexceeds the maximum supported length it emits anSemanticStringError.
- class iceoryx2.TypeVariant¶
Bases:
objectDefines if the type is a slice with a runtime-size (
TypeVariant.Dynamic) or if its a type that satisfiesSized(TypeVariant.FixedSize).- Dynamic = TypeVariant.Dynamic¶
- FixedSize = TypeVariant.FixedSize¶
- class iceoryx2.UniqueClientId¶
Bases:
objectThe system-wide unique id of a
Client.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueListenerId¶
Bases:
objectThe system-wide unique id of a
Listener.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueNodeId¶
Bases:
objectThe system-wide unique id of a
Node- value¶
Returns the underlying integer value of the
UniqueNodeId.
- class iceoryx2.UniqueNotifierId¶
Bases:
objectThe system-wide unique id of a
Notifier.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniquePublisherId¶
Bases:
objectThe system-wide unique id of a
Publisher.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueReaderId¶
Bases:
objectThe system-wide unique id of a
Reader.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueServerId¶
Bases:
objectThe system-wide unique id of a
Server.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueSubscriberId¶
Bases:
objectThe system-wide unique id of a
Subscriber.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.UniqueWriterId¶
Bases:
objectThe system-wide unique id of a
Writer.- value¶
Returns the underlying raw value of the ID
- class iceoryx2.WaitSet¶
Bases:
objectThe
WaitSetimplements a reactor pattern and allows to wait on multiple events in one single callWaitSet.wait_and_processuntil a interrupt or termination signal was received.The
Listenercan be attached as well as sockets or anything else that is aFileDescriptor.Can be created via the
WaitSetBuilder.- attach_deadline(attachment, deadline)¶
Attaches a
Listeneras deadline to theWaitSet. Whenever the event is received or the deadline is hit, the user is informed inWaitSet.wait_and_process. The object cannot be attached twice and theWaitSet.capacityis limited by the underlying implementation. Whenever the object emits an event the deadline is reset by theWaitSet.
- attach_deadline_fd(attachment, deadline)¶
Attaches a
FileDescriptoras deadline to theWaitSet. Whenever the event is received or the deadline is hit, the user is informed inWaitSet.wait_and_process. The object cannot be attached twice and theWaitSet.capacityis limited by the underlying implementation. Whenever the object emits an event the deadline is reset by theWaitSet.
- attach_interval(interval)¶
Attaches a tick event to the
WaitSet. Whenever the timeout is reached theWaitSetinforms the user inWaitSet.wait_and_process.
- attach_notification(attachment)¶
Attaches a
Listeneras notification to theWaitSet. Whenever an event is received on the object theWaitSetinforms the user inWaitSet.wait_and_processto handle the event. The object cannot be attached twice and theWaitSet.capacityis limited by the underlying implementation.
- attach_notification_fd(attachment)¶
Attaches a
FileDescriptoras notification to theWaitSet. Whenever an event is received on the object theWaitSetinforms the user inWaitSet.wait_and_processto handle the event. The object cannot be attached twice and theWaitSet.capacityis limited by the underlying implementation.
- len¶
Returns the number of attachments.
- signal_handling_mode¶
Returns the
SignalHandlingModewith which theWaitSetwas created.
- wait_and_process()¶
Waits until an event arrives on the
WaitSet, then collects the events correspondingWaitSetAttachmentIdin a vector and returns it.If an interrupt- (
signal.SIGINT) or a termination-signal (signal.SIGTERM) was received, it will exit the loop and inform the user withWaitSetRunResult.InterruptorWaitSetRunResult.TerminationRequest.Important: The
WaitSetonly reports that an attachment is ready; it does not consume the notification or data that caused the wake-up. If the callback returns without consuming any pending input, the attachment remains ready and theWaitSetwakes up again immediately. Repeating this can cause a busy loop and high CPU usage.For a
Listener, consume pending notifications withListener.try_wait. For a socket or another file-descriptor-based attachment, consume the pending data using its corresponding read or receive API.
- wait_and_process_with_timeout(timeout)¶
Waits until an event arrives on the
WaitSetor the provided timeout has passed, then collects the events correspondingWaitSetAttachmentIdin a vector and returns it.If an interrupt- (
signal.SIGINT) or a termination-signal (signal.SIGTERM) was received, it will exit the loop and inform the user withWaitSetRunResult.InterruptorWaitSetRunResult.TerminationRequest.Important: The
WaitSetonly reports that an attachment is ready; it does not consume the notification or data that caused the wake-up. If the callback returns without consuming any pending input, the attachment remains ready and theWaitSetwakes up again immediately. Repeating this can cause a busy loop and high CPU usage.For a
Listener, consume pending notifications withListener.try_wait. For a socket or another file-descriptor-based attachment, consume the pending data using its corresponding read or receive API.
- exception iceoryx2.WaitSetAttachmentError¶
Bases:
ExceptionErrors caused when attaching something to the waitset.
- class iceoryx2.WaitSetAttachmentId¶
Bases:
objectRepresents an attachment to the
WaitSet- static from_guard(guard)¶
Creates an
WaitSetAttachmentIdfrom aWaitSetGuardthat was returned viaWaitSet.attach_interval,WaitSet.attach_notificationorWaitSet.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
WaitSetGuardwas missed.
- class iceoryx2.WaitSetBuilder¶
Bases:
objectCreates a new
WaitSet.- static new()¶
Instantiates a new
WaitSetBuilder
- signal_handling_mode(value)¶
Defines the
SignalHandlingModefor theWaitSet. It affects theWaitSet.wait_and_processandWaitSet.wait_and_process_with_timeoutcalls that returns any receivedSignalvia itsWaitSetRunResultreturn value.
- class iceoryx2.WaitSetGuard¶
Bases:
objectIs 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 theWaitSetGuardis no longer usable.
- exception iceoryx2.WaitSetRunError¶
Bases:
ExceptionErrors caused by calling WaitSet::wait_and_process().
- class iceoryx2.WaitSetRunResult¶
Bases:
objectStates why the
WaitSet.wait_and_processmethod returned.- AllEventsHandled = WaitSetRunResult.AllEventsHandled¶
- Interrupt = WaitSetRunResult.Interrupt¶
- StopRequest = WaitSetRunResult.StopRequest¶
- TerminationRequest = WaitSetRunResult.TerminationRequest¶
- class iceoryx2.Writer¶
Bases:
objectRepresents the writing endpoint of a blackboard based communication.
- entry(key: Type[K], value: Type[V]) EntryHandleMut¶
Creates an EntryHandleMut for direct write access to the value.
There can be only one EntryHandleMut per value. On failure it returns
EntryHandleMutErrordescribing the failure.
- id¶
Returns the
UniqueWriterIdof theWriter
- iceoryx2.get_type_name(t: Type[T]) Any[source]¶
Generates a human readable type name from a given type.
- iceoryx2.set_log_level(value)¶
Sets the current log level. This is ignored for external frameworks like
logortracing. Here you have to use the log-level settings of that framework.# Important
When using external frameworks, the log level should be set explicitly, as only messages matching that level will be forwarded. You may also need to configure the framework’s own log level settings.
- 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
# Important
When using external frameworks, the log level should be set explicitly, as only messages matching that level will be forwarded. You may also need to configure the framework’s own log level settings.
- 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# Important
When using external frameworks, the log level should be set explicitly, as only messages matching that level will be forwarded. You may also need to configure the framework’s own log level settings.