diff --git a/mission_rust/src/fsrc/datasets/mod.rs b/mission_rust/src/fsrc/datasets/mod.rs index bc04710..e9e652b 100644 --- a/mission_rust/src/fsrc/datasets/mod.rs +++ b/mission_rust/src/fsrc/datasets/mod.rs @@ -1,4 +1,4 @@ -use super::mutex; +use super::{mutex, objectmanager}; use super::objectmanager::SystemObjectIF; #[derive(Copy, Clone, PartialEq)] @@ -101,7 +101,9 @@ impl ReferencedDataset { } } - pub fn initialize(&mut self, owner: &dyn SystemObjectIF) -> Result<(), ()> { + //Note, passing the object_manager is per design, so that this call can only be used during init (when storing the address is valid) + pub fn initialize(&mut self, object_manager: &dyn objectmanager::ObjectManager, owner_of_the_set: objectmanager::ObjectId) -> Result<(), ()> { + let owner = object_manager.get_object(owner_of_the_set)?; let temp: T = T::default(); //TODO find nicer solution whithout local instance and trait bound to Default let type_id = temp.get_type_id(); let other_set: &dyn DataSetIF; diff --git a/mission_rust/src/lib.rs b/mission_rust/src/lib.rs index fa07f9b..462e633 100644 --- a/mission_rust/src/lib.rs +++ b/mission_rust/src/lib.rs @@ -163,7 +163,7 @@ impl SystemObjectIF for HandlerSender { }; self.other_handler_queue = other_handler.get_command_queue(); - self.other_data.initialize(other_handler)?; + self.other_data.initialize(object_manager, self.other_handler)?; Ok(()) } }