* @brief Abstract of framework runtime, providing some functions for modules * */
| 31 | * |
| 32 | */ |
| 33 | class CoreRef { |
| 34 | public: |
| 35 | CoreRef() = default; |
| 36 | explicit CoreRef(const aimrt_core_base_t* base_ptr) |
| 37 | : base_ptr_(base_ptr) {} |
| 38 | ~CoreRef() = default; |
| 39 | |
| 40 | explicit operator bool() const { return (base_ptr_ != nullptr); } |
| 41 | |
| 42 | const aimrt_core_base_t* NativeHandle() const { return base_ptr_; } |
| 43 | |
| 44 | ModuleInfo Info() const { |
| 45 | AIMRT_ASSERT(base_ptr_, "Reference is null."); |
| 46 | aimrt_module_info_t module_info = base_ptr_->info(base_ptr_->impl); |
| 47 | return ModuleInfo{ |
| 48 | .name = util::ToStdStringView(module_info.name), |
| 49 | .major_version = module_info.major_version, |
| 50 | .minor_version = module_info.minor_version, |
| 51 | .patch_version = module_info.patch_version, |
| 52 | .build_version = module_info.build_version, |
| 53 | .author = util::ToStdStringView(module_info.author), |
| 54 | .description = util::ToStdStringView(module_info.description)}; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @brief Get configurator handle |
| 59 | * |
| 60 | * @return ConfiguratorRef |
| 61 | */ |
| 62 | configurator::ConfiguratorRef GetConfigurator() const { |
| 63 | AIMRT_ASSERT(base_ptr_, "Reference is null."); |
| 64 | return configurator::ConfiguratorRef(base_ptr_->configurator(base_ptr_->impl)); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @brief Get allocator handle |
| 69 | * |
| 70 | * @return allocator::AllocatorRef |
| 71 | */ |
| 72 | allocator::AllocatorRef GetAllocator() const { |
| 73 | AIMRT_ASSERT(base_ptr_, "Reference is null."); |
| 74 | return allocator::AllocatorRef(base_ptr_->allocator_handle(base_ptr_->impl)); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * @brief Get executor manager handle |
| 79 | * |
| 80 | * @return ExecutorManagerRef |
| 81 | */ |
| 82 | executor::ExecutorManagerRef GetExecutorManager() const { |
| 83 | AIMRT_ASSERT(base_ptr_, "Reference is null."); |
| 84 | return executor::ExecutorManagerRef(base_ptr_->executor_manager(base_ptr_->impl)); |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * @brief Get logger handle |
| 89 | * |
| 90 | * @return logger::LoggerRef |
no outgoing calls
no test coverage detected