.. _program_listing_file_include_depthai_pipeline_AssetManager.hpp: Program Listing for File AssetManager.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``include/depthai/pipeline/AssetManager.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include "depthai-shared/pipeline/Assets.hpp" #include "depthai/utility/Path.hpp" namespace dai { struct Asset { Asset() = default; explicit Asset(std::string k) : key(std::move(k)) {} const std::string key; std::vector data; std::uint32_t alignment = 1; std::string getRelativeUri(); }; class AssetsMutable : public Assets { public: void set(std::string, std::uint32_t offset, std::uint32_t size, std::uint32_t alignment); }; // Subclass which has its own storage class AssetManager /*: public Assets*/ { std::map> assetMap; public: void addExisting(std::vector> assets); std::shared_ptr set(Asset asset); std::shared_ptr set(const std::string& key, Asset asset); std::shared_ptr set(const std::string& key, const dai::Path& path, int alignment = 64); std::shared_ptr set(const std::string& key, const std::vector& data, int alignment = 64); std::shared_ptr set(const std::string& key, std::vector&& data, int alignment = 64); std::shared_ptr get(const std::string& key) const; std::shared_ptr get(const std::string& key); std::vector> getAll() const; std::vector> getAll(); std::size_t size() const; void remove(const std::string& key); void serialize(AssetsMutable& assets, std::vector& assetStorage, std::string prefix = "") const; }; } // namespace dai