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 |
Json::ValueInternalArray::ValueInternalArray | ( | ) |
Definition at line 251 of file json_internalarray.inl.
Json::ValueInternalArray::ValueInternalArray | ( | const ValueInternalArray & | other | ) |
Definition at line 259 of file json_internalarray.inl.
References Json::ValueArrayAllocator::allocateArrayPage(), Json::arrayAllocator(), itemsPerPage, JSON_ASSERT_MESSAGE, Json::ValueArrayAllocator::reallocateArrayPageIndex(), and Value.
Json::ValueInternalArray::~ValueInternalArray | ( | ) |
Definition at line 293 of file json_internalarray.inl.
References Json::arrayAllocator(), itemsPerPage, Json::ValueArrayAllocator::releaseArrayPage(), Json::ValueArrayAllocator::releaseArrayPageIndex(), and Json::Value::~Value().
void Json::ValueInternalArray::clear | ( | ) |
int Json::ValueInternalArray::compare | ( | const ValueInternalArray & | other | ) | const |
Definition at line 440 of file json_internalarray.inl.
References Json::Value::compare(), and itemsPerPage.
Value * Json::ValueInternalArray::find | ( | ArrayIndex | index | ) | const |
Definition at line 408 of file json_internalarray.inl.
References itemsPerPage.
ValueInternalArray & Json::ValueInternalArray::operator= | ( | const ValueInternalArray & | other | ) |
Definition at line 285 of file json_internalarray.inl.
References swap().
void Json::ValueInternalArray::resize | ( | ArrayIndex | newSize | ) |
Definition at line 337 of file json_internalarray.inl.
References Json::arrayAllocator(), clear(), itemsPerPage, Json::ValueArrayAllocator::releaseArrayPage(), resolveReference(), and Json::Value::~Value().
Value & Json::ValueInternalArray::resolveReference | ( | ArrayIndex | index | ) |
Definition at line 400 of file json_internalarray.inl.
References itemsPerPage.
Referenced by resize().
ValueInternalArray::ArrayIndex Json::ValueInternalArray::size | ( | ) | const |
Definition at line 416 of file json_internalarray.inl.
void Json::ValueInternalArray::swap | ( | ValueInternalArray & | other | ) |
Definition at line 315 of file json_internalarray.inl.
Referenced by clear(), and operator=().
|
friend |
Definition at line 764 of file value.h.
Referenced by ValueInternalArray().
|
friend |
|
hosts this site. |
Send comments to: Json-cpp Developers |