CatapultServer
v0.5.0.1 (Elephant)
|
Classes | |
class | basic_iterator |
Base of mosaic iterators. More... | |
class | basic_iterator_t |
A basic typed iterator that adds support for dereferencing. More... | |
struct | FirstLevelStorage |
struct | MosaicLocation |
struct | MosaicUnion |
struct | SecondLevelStorage |
Public Types | |
using | const_iterator = basic_iterator_t< const Mosaic > |
Mosaic const iterator. More... | |
using | iterator = basic_iterator_t< Mosaic > |
Mosaic non-const iterator. More... | |
Public Member Functions | |
const_iterator | begin () const |
Returns a const iterator to the first element of the underlying container. More... | |
const_iterator | end () const |
Returns a const iterator to the element following the last element of the underlying container. More... | |
iterator | begin () |
Returns an iterator to the first element of the underlying container. More... | |
iterator | end () |
Returns an iterator to the element following the last element of the underlying container. More... | |
bool | empty () const |
Returns true if the map is empty. More... | |
size_t | size () const |
Gets the number of mosaics in the map. More... | |
const_iterator | find (MosaicId id) const |
Finds the mosaic with id. More... | |
iterator | find (MosaicId id) |
Finds the mosaic with id. More... | |
void | insert (const Mosaic &pair) |
Inserts a mosaic pair. More... | |
void | erase (MosaicId id) |
Erases the mosaic with id. More... | |
void | optimize (MosaicId id) |
Optimizes access of the mosaic with id. More... | |
Private Types | |
enum | MosaicSource { MosaicSource::Value, MosaicSource::Array, MosaicSource::Map } |
using | Mosaic = std::pair< const MosaicId, Amount > |
using | MutableMosaic = std::pair< MosaicId, Amount > |
using | MosaicArray = std::array< MosaicUnion, Array_Size > |
using | MosaicMap = std::map< MosaicId, Amount > |
Private Member Functions | |
bool | find (MosaicId id, MosaicLocation &location) const |
void | insertIntoArray (size_t index, const Mosaic &pair) |
void | insertIntoMap (const Mosaic &pair) |
void | eraseFromArray (size_t index) |
void | compact () |
Private Member Functions inherited from catapult::utils::MoveOnly | |
constexpr | MoveOnly ()=default |
Default constructor. More... | |
~MoveOnly ()=default | |
Default destructor. More... | |
MoveOnly (const NonCopyable &)=delete | |
Disabled copy constructor. More... | |
MoveOnly (MoveOnly &&)=default | |
Default move constructor. More... | |
MoveOnly & | operator= (const MoveOnly &)=delete |
Disabled assignment operator. More... | |
MoveOnly & | operator= (MoveOnly &&)=default |
Default move assignment operator. More... | |
Private Attributes | |
FirstLevelStorage | m_storage |
MosaicId | m_optimizedMosaicId |
Static Private Attributes | |
static constexpr auto | Array_Size = 5 |
A mosaic (ordered) map that is optimized for storage of a small number of elements.
Mosaic const iterator.
Mosaic non-const iterator.
|
private |
|
private |
|
private |
|
private |
|
strongprivate |
CompactMosaicMap::iterator catapult::state::CompactMosaicMap::begin | ( | ) |
Returns an iterator to the first element of the underlying container.
CompactMosaicMap::const_iterator catapult::state::CompactMosaicMap::begin | ( | ) | const |
Returns a const iterator to the first element of the underlying container.
|
private |
bool catapult::state::CompactMosaicMap::empty | ( | ) | const |
Returns true
if the map is empty.
CompactMosaicMap::iterator catapult::state::CompactMosaicMap::end | ( | ) |
Returns an iterator to the element following the last element of the underlying container.
CompactMosaicMap::const_iterator catapult::state::CompactMosaicMap::end | ( | ) | const |
Returns a const iterator to the element following the last element of the underlying container.
void catapult::state::CompactMosaicMap::erase | ( | MosaicId | id | ) |
Erases the mosaic with id.
|
private |
CompactMosaicMap::iterator catapult::state::CompactMosaicMap::find | ( | MosaicId | id | ) |
Finds the mosaic with id.
CompactMosaicMap::const_iterator catapult::state::CompactMosaicMap::find | ( | MosaicId | id | ) | const |
Finds the mosaic with id.
|
private |
void catapult::state::CompactMosaicMap::insert | ( | const Mosaic & | pair | ) |
Inserts a mosaic pair.
|
private |
|
private |
void catapult::state::CompactMosaicMap::optimize | ( | MosaicId | id | ) |
Optimizes access of the mosaic with id.
size_t catapult::state::CompactMosaicMap::size | ( | ) | const |
Gets the number of mosaics in the map.
|
staticconstexprprivate |
|
private |
|
private |