JsonCpp project page JsonCpp home page

Json::ValueInternalArray Class Reference

A simplified deque implementation used internally by Value. More...

#include <json/value.h>

Collaboration diagram for Json::ValueInternalArray:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { itemsPerPage = 8 }
typedef Value::ArrayIndex ArrayIndex
typedef unsigned int PageIndex

Public Member Functions

 ValueInternalArray ()
 ValueInternalArray (const ValueInternalArray &other)
ValueInternalArrayoperator= (const ValueInternalArray &other)
 ~ValueInternalArray ()
void swap (ValueInternalArray &other)
void clear ()
void resize (ArrayIndex newSize)
ValueresolveReference (ArrayIndex index)
Valuefind (ArrayIndex index) const
ArrayIndex size () const
int compare (const ValueInternalArray &other) const

Friends

class Value
class ValueIteratorBase


Detailed Description

A simplified deque implementation used internally by Value.

For internal use only.

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).

Definition at line 762 of file value.h.


Member Typedef Documentation

Definition at line 768 of file value.h.

Definition at line 769 of file value.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
itemsPerPage 

Definition at line 767 of file value.h.


Constructor & Destructor Documentation

Json::ValueInternalArray::ValueInternalArray (  ) 

Definition at line 251 of file json_internalarray.inl.

Json::ValueInternalArray::ValueInternalArray ( const ValueInternalArray other  ) 

Json::ValueInternalArray::~ValueInternalArray (  ) 


Member Function Documentation

void Json::ValueInternalArray::clear (  ) 

Definition at line 329 of file json_internalarray.inl.

References swap().

Referenced by resize().

Here is the caller graph for this function:

int Json::ValueInternalArray::compare ( const ValueInternalArray other  )  const

Definition at line 440 of file json_internalarray.inl.

References Json::Value::compare().

Value * Json::ValueInternalArray::find ( ArrayIndex  index  )  const

Definition at line 408 of file json_internalarray.inl.

ValueInternalArray & Json::ValueInternalArray::operator= ( const ValueInternalArray other  ) 

Definition at line 285 of file json_internalarray.inl.

References swap().

void Json::ValueInternalArray::resize ( ArrayIndex  newSize  ) 

Value & Json::ValueInternalArray::resolveReference ( ArrayIndex  index  ) 

Definition at line 400 of file json_internalarray.inl.

Referenced by resize().

Here is the caller graph for this function:

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=().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class Value [friend]

Definition at line 764 of file value.h.

Referenced by ValueInternalArray().

friend class ValueIteratorBase [friend]

Definition at line 765 of file value.h.


The documentation for this class was generated from the following files:

SourceForge Logo hosts this site. Send comments to:
Json-cpp Developers