JsonCpp project page | JsonCpp home page |
A simplified deque implementation used internally by Value. More...
#include <json/value.h>
Public Types | |
enum | { itemsPerPage = 8 } |
typedef Value::ArrayIndex | ArrayIndex |
typedef unsigned int | PageIndex |
Public Member Functions | |
ValueInternalArray () | |
ValueInternalArray (const ValueInternalArray &other) | |
ValueInternalArray & | operator= (const ValueInternalArray &other) |
~ValueInternalArray () | |
void | swap (ValueInternalArray &other) |
void | clear () |
void | resize (ArrayIndex newSize) |
Value & | resolveReference (ArrayIndex index) |
Value * | find (ArrayIndex index) const |
ArrayIndex | size () const |
int | compare (const ValueInternalArray &other) const |
Friends | |
class | Value |
class | ValueIteratorBase |
A simplified deque implementation used internally by Value.
It is based on a list of fixed "page", each page contains a fixed number of items. Instead of using a linked-list, a array of pointer is used for fast item look-up. Look-up for an element is as follow:
Insertion is amortized constant time (only the array containing the index of pointers need to be reallocated when items are appended).
typedef unsigned int Json::ValueInternalArray::PageIndex |
ValueInternalArray::ValueInternalArray | ( | ) |
Definition at line 245 of file json_internalarray.inl.
ValueInternalArray::ValueInternalArray | ( | const ValueInternalArray & | other | ) |
Definition at line 253 of file json_internalarray.inl.
References arrayAllocator(), itemsPerPage, JSON_ASSERT_MESSAGE, and Value.
ValueInternalArray::~ValueInternalArray | ( | ) |
Definition at line 287 of file json_internalarray.inl.
References arrayAllocator(), itemsPerPage, and Json::Value::~Value().
void ValueInternalArray::clear | ( | ) |
Definition at line 323 of file json_internalarray.inl.
References swap().
Referenced by resize().
int ValueInternalArray::compare | ( | const ValueInternalArray & | other | ) | const |
Definition at line 434 of file json_internalarray.inl.
References Json::Value::compare(), and itemsPerPage.
Value * ValueInternalArray::find | ( | ArrayIndex | index | ) | const |
Definition at line 402 of file json_internalarray.inl.
References itemsPerPage.
ValueInternalArray & ValueInternalArray::operator= | ( | const ValueInternalArray & | other | ) |
Definition at line 279 of file json_internalarray.inl.
References swap().
void ValueInternalArray::resize | ( | ArrayIndex | newSize | ) |
Definition at line 331 of file json_internalarray.inl.
References arrayAllocator(), clear(), itemsPerPage, resolveReference(), and Json::Value::~Value().
Value & ValueInternalArray::resolveReference | ( | ArrayIndex | index | ) |
Definition at line 394 of file json_internalarray.inl.
References itemsPerPage.
Referenced by resize().
ValueInternalArray::ArrayIndex ValueInternalArray::size | ( | ) | const |
Definition at line 410 of file json_internalarray.inl.
void ValueInternalArray::swap | ( | ValueInternalArray & | other | ) |
Definition at line 309 of file json_internalarray.inl.
Referenced by clear(), and operator=().
|
friend |
Definition at line 730 of file value.h.
Referenced by ValueInternalArray().
|
friend |
|
hosts this site. |
Send comments to: Json-cpp Developers |