55namespace SIMO_PUBLIC Collections {
57 [[nodiscard]] std::string_view get_name()
const noexcept;
59 [[nodiscard]]
Module* get_module_unsafe()
const;
61 [[nodiscard]]
Parameters* get_parameters_unsafe()
const;
63 [[nodiscard]] std::unique_ptr<Module> get_module()
const;
65 [[nodiscard]] std::unique_ptr<Parameters> get_parameters()
const;
68 Module* (*get_module_function)();
84 unsigned factory_list_size;
86 void check()
const noexcept;
88 [[nodiscard]]
const Factory* get_factory(
89 const std::string_view& factory_name)
const noexcept;
91 [[nodiscard]] std::vector<std::pair<std::string_view, const Factory*>>
92 get_factory_pairs()
const noexcept;
98class SIMO_PUBLIC CollectionWithLib {
100 CollectionWithLib(
const std::filesystem::path& path,
102 void* lib_handle)
noexcept;
104 CollectionWithLib(
const CollectionWithLib&) =
delete;
105 CollectionWithLib& operator=(
const CollectionWithLib&) =
delete;
107 CollectionWithLib(CollectionWithLib&& other)
noexcept;
109 CollectionWithLib& operator=(CollectionWithLib&& other)
noexcept;
111 ~CollectionWithLib();
113 [[nodiscard]]
const SimoCollection* get_collection()
const noexcept;
116 std::filesystem::path path;
118 void* lib_handle =
nullptr;
121enum struct SIMO_PUBLIC GET_COLLECTION_ERROR : std::uint8_t {
125 ALREADY_LOADED_LIBRARY,
126 NO_SIMO_COLLECTION_SECTION,
130 GET_COLLECTION_ERROR error_code;
131 std::string error_message;
135[[nodiscard]] std::expected<CollectionWithLib, GetCollectionError> SIMO_PUBLIC
136simo_get_collection(
const std::filesystem::path& path_to_collection);
140 simo_get_collection_from_folder(
const std::filesystem::path& folder_path);