vt::vrt::collection::storage::Storable struct

Trait for collection elements to store values inside the collection.

Derived classes

struct vt::vrt::collection::Migratable

Constructors, destructors, conversion operators

Storable() defaulted
Storable(Storable const&) deleted

Public functions

template<typename SerializerT>
void serialize(SerializerT& s)
Serializer.
template<typename U>
void valInsert(std::string const& str, U&& u)
Insert a new key/value pair (defaults to not providing to LB or dumping to JSON)
template<typename U>
void valInsert(std::string const& str, U&& u, bool dump_to_json, bool provide_to_lb, bool dump_to_attributes)
Insert a new key/value pair.
template<typename U>
auto valGet(std::string const& str) -> U&
Get the value from a key.
template<typename U>
auto valGet(std::string const& str) const -> U const &
Get the const value from a key.
auto valExists(std::string const& str) const -> bool
Check if a key exists.
void valRemove(std::string const& str)
Remove a key.
auto toJson() -> nlohmann::json
Generate the json if applicable.
template<typename Callable>
void foreachLB(Callable&& c)
Traverse the keys/values in the storable for the LB.
template<typename Callable>
void collectAttributes(Callable&& c)
Traverse the map and calls Callable on each attribute.

Function documentation

template<typename SerializerT>
void vt::vrt::collection::storage::Storable::serialize(SerializerT& s)

Serializer.

Parameters
in the serializer

template<typename U>
void vt::vrt::collection::storage::Storable::valInsert(std::string const& str, U&& u)

Insert a new key/value pair (defaults to not providing to LB or dumping to JSON)

Parameters
str in the key
in the value

template<typename U>
void vt::vrt::collection::storage::Storable::valInsert(std::string const& str, U&& u, bool dump_to_json, bool provide_to_lb, bool dump_to_attributes)

Insert a new key/value pair.

Parameters
str in the key
in the value
dump_to_json in whether to include in json file
provide_to_lb in whether to provide the data to the load balancers
dump_to_attributes in whether to dump to attributes in JSON output

template<typename U>
U& vt::vrt::collection::storage::Storable::valGet(std::string const& str)

Get the value from a key.

Parameters
str in the key
Returns the associated value

template<typename U>
U const & vt::vrt::collection::storage::Storable::valGet(std::string const& str) const

Get the const value from a key.

Parameters
str in the key
Returns the associated, const value

bool vt::vrt::collection::storage::Storable::valExists(std::string const& str) const

Check if a key exists.

Parameters
str in the key
Returns whether it exists

void vt::vrt::collection::storage::Storable::valRemove(std::string const& str)

Remove a key.

Parameters
str in the key

nlohmann::json vt::vrt::collection::storage::Storable::toJson()

Generate the json if applicable.

Returns the json

template<typename Callable>
void vt::vrt::collection::storage::Storable::foreachLB(Callable&& c)

Traverse the keys/values in the storable for the LB.

Parameters
in the callable

template<typename Callable>
void vt::vrt::collection::storage::Storable::collectAttributes(Callable&& c)

Traverse the map and calls Callable on each attribute.

Parameters
in the callable