Ditto 2.0.6
Public Member Functions | List of all members
ditto::MutableRga Class Reference
Inheritance diagram for ditto::MutableRga:
ditto::Rga

Public Member Functions

void set (std::size_t index, nlohmann::json value) DITTO_DEPRECATED
 Set the element at the given index. Enables indexed modifications to the Rga values. More...
 
void remove (std::size_t index) DITTO_DEPRECATED
 Removes a value at the specified index. More...
 
void insert (std::size_t index, nlohmann::json value) DITTO_DEPRECATED
 Inserts a value into the Rga at the index specified. More...
 
void push (nlohmann::json value) DITTO_DEPRECATED
 Push a value on to the end of the Rga. More...
 
nlohmann::json pop () DITTO_DEPRECATED
 Pop a value off the end of the Rga. More...
 
- Public Member Functions inherited from ditto::Rga
 Rga (std::vector< nlohmann::json > value=std::vector< nlohmann::json >()) DITTO_DEPRECATED
 Construct a new Rga object than can be used as part of a document's context. More...
 
DittoCrdtType get_type () const
 
std::vector< nlohmann::jsonget_value () const
 Return the array representation of the RGA. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ditto::Rga
size_t size () const
 
- Protected Attributes inherited from ditto::Rga
std::vector< nlohmann::jsonvalue
 

Member Function Documentation

◆ insert()

void ditto::MutableRga::insert ( std::size_t  index,
nlohmann::json  value 
)

Inserts a value into the Rga at the index specified.

Parameters
indexthe index at which to insert the provided value.
valuethe value to insert into the Rga.

◆ pop()

nlohmann::json ditto::MutableRga::pop ( )

Pop a value off the end of the Rga.

Returns
the value that was popped off the end of the Rga.

◆ push()

void ditto::MutableRga::push ( nlohmann::json  value)

Push a value on to the end of the Rga.

Parameters
indexthe index of the element to remove.

◆ remove()

void ditto::MutableRga::remove ( std::size_t  index)

Removes a value at the specified index.

Parameters
indexthe index of the element to remove.

◆ set()

void ditto::MutableRga::set ( std::size_t  index,
nlohmann::json  value 
)

Set the element at the given index. Enables indexed modifications to the Rga values.

Parameters
indexthe index of the value to overwrite. If this value is at the end of the Rga, the value will be appended to the end of the Rga.
valuethe value to set at the specified index.