Class mem_filesystem_resolver

Inheritance Relationships

Base Types

Class Documentation

class legion::core::filesystem::mem_filesystem_resolver : public legion::core::filesystem::filesystem_resolver, public legion::core::filesystem::memory_resolver_common_base

Public Functions

explicit mem_filesystem_resolver(std::shared_ptr<const byte_vec> target_data)

Requires the raw data to be passed for internal building.

bool prewarm() const

Makes sure that the internal fast memory representation has been built when false is returned it was unable to build it.

inline void set_disk_data(const byte_vec &target_data)

Sets the raw data of the provider.

inline void set_disk_data(byte_vec &&target_data)

Sets the raw data of the provider.

inline void set_disk_data(std::shared_ptr<const byte_vec> target_data)

Sets the raw data of the provider.

inline virtual filesystem_resolver *make() final override

Required to create new instances of the provider, similar to a surrogate constructor if required arguments must be copied over.

virtual mem_filesystem_resolver *make_higher() = 0

Same as filesystem_provider::make, override this instead of make for all mem_filesystem_resolvers.

filesystem_provider::make

Protected Functions

const byte_vec &get_data() const

Returns the fast memory representation of the provider. Created by build_memory_representation.

byte_vec &get_data()
virtual void build_memory_representation(std::shared_ptr<const byte_vec> in, std::shared_ptr<byte_vec> out) const = 0

Should build a fast memory representation of the virtual filesystem. For instance, when inflating a zip archive this should put the inflated memory into out.

Parameters
  • [in] in: The array with compressed data.

  • [out] out: The array where to put uncompressed data.

virtual void build_disk_representation(std::shared_ptr<const byte_vec> in, std::shared_ptr<byte_vec> out) const

Should build the representation on how the data is saved to disk, when the filesystem is readonly this does not apply.

Parameters
  • [in] in: The array with decompressed data.

  • [out] out: The array where to put compressed data.

virtual std::size_t size_hint (std::shared_ptr< const byte_vec > in) const LEGION_IMPURE_RETURN(0)

A hint to how big the fast memory representation is going to be.

Parameters
  • [in] in: The array with the compressed data.