Skip to content

Commit

Permalink
Merge pull request #352 from elfenpiff/iox2-350-extended-dynamic-conf…
Browse files Browse the repository at this point in the history
…ig-api

[#350] Extend dynamic config API
  • Loading branch information
elfenpiff authored Aug 14, 2024
2 parents ec6f906 + b013e16 commit 959da91
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions iceoryx2/src/service/dynamic_config/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ impl DynamicConfig {
self.notifiers.len()
}

#[doc(hidden)]
pub fn __internal_listener_owners<F: FnMut(&NodeId)>(&self, mut callback: F) {
let state = unsafe { self.listeners.get_state() };

state.for_each(|_, details| {
callback(&details.node_id);
CallbackProgression::Continue
});
}

#[doc(hidden)]
pub fn __internal_notifier_owners<F: FnMut(&NodeId)>(&self, mut callback: F) {
let state = unsafe { self.notifiers.get_state() };

state.for_each(|_, details| {
callback(&details.node_id);
CallbackProgression::Continue
});
}

pub(crate) unsafe fn remove_dead_node_id<
PortCleanup: FnMut(UniquePortId) -> PortCleanupAction,
>(
Expand Down
20 changes: 20 additions & 0 deletions iceoryx2/src/service/dynamic_config/publish_subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,26 @@ impl DynamicConfig {
self.subscribers.len()
}

#[doc(hidden)]
pub fn __internal_subscriber_owners<F: FnMut(&NodeId)>(&self, mut callback: F) {
let state = unsafe { self.subscribers.get_state() };

state.for_each(|_, details| {
callback(&details.node_id);
CallbackProgression::Continue
});
}

#[doc(hidden)]
pub fn __internal_publisher_owners<F: FnMut(&NodeId)>(&self, mut callback: F) {
let state = unsafe { self.publishers.get_state() };

state.for_each(|_, details| {
callback(&details.node_id);
CallbackProgression::Continue
});
}

pub(crate) fn add_subscriber_id(&self, details: SubscriberDetails) -> Option<ContainerHandle> {
unsafe { self.subscribers.add(details).ok() }
}
Expand Down

0 comments on commit 959da91

Please sign in to comment.