Class LazyLoadResource

Class Documentation

class LazyLoadResource

Looks like a std::shared_ptr, but is stored on disk when not used.

Public Functions

LazyLoadResource() = default
inline LazyLoadResource(const mrpt::serialization::CSerializable::Ptr &source, const std::string &f)
inline const std::string &externalStorage() const
inline mrpt::serialization::CSerializable::Ptr value()

Access (a copy of) the underlying smart pointer to the object

inline const mrpt::serialization::CSerializable::Ptr &value() const

Access (a const-ref to) the underlying smart pointer to the object

void load() const

Ensure data is loaded from disk, if it was automatically swapped-off

void unload() const

Unload data and save to disk now, if not already done before

bool isUnloaded() const
inline void reset()

Empty this container.

void set(const mrpt::serialization::CSerializable::Ptr &source, const std::string &f)

Sets the contents of this container, including the desired external file name

void setAsExternal(const std::string &relativeFileName)

Sets this container as externally-stored, given an external filename. The external content is not automatically loaded, for that, explicitly call load() if needed.

inline void setParentEntityID(const mola::id_t id)

Public Static Attributes

static std::string EXTERNAL_BASE_DIR