Class VersionedString

Nested Relationships

Nested Types

Class Documentation

class VersionedString

Public Functions

VersionedString(std::string initial_value)

Construct a versioned string

Parameters:

initial_value[in] The initial value of this versioned string

void update(std::string new_value)

Update the value of this versioned string

Parameters:

new_value[in] The new value for this versioned string

View view() const

Get a view of the current version of the string.

class Reader

Public Functions

Reader()

Construct a Reader.

std::shared_ptr<const std::string> read(const View &view)

Read from the View.

If this Reader has never seen this View before, then this function will return a reference to the string that the View contains. Otherwise, if this Reader has seen this View before, then this function will return a nullptr.

Parameters:

view[in] The view that the Reader should look at

class View

A snapshot view of a VersionedString. This is thread-safe to read even while the VersionedString is being modified. Each VersionedString::Reader instance will only view this object once; after the first viewing it will return a nullptr.

The contents of this View can only be retrieved by a VersionedString::Reader