Jive reference manual
|
#include <jem/xutil/SnoopDictionary.h>
Classes | |
class | Filter |
class | StdFilter |
Public Member Functions | |
SnoopDictionary () | |
SnoopDictionary (const Ref< Dict > &dict) | |
virtual void | readFrom (io::ObjectInput &in) |
virtual void | writeTo (io::ObjectOutput &out) const |
virtual Ref< Object > | clone () const |
virtual Ref< DictEnum > | getDictEnum () const |
virtual bool | contains (const String &key) const |
Checks whether this dictionary contains a specific key. More... | |
virtual bool | find (Ref< Object > &value, const String &key) const |
Searches for an object associated with a specific key. More... | |
virtual void | insert (const String &key, const Ref< Object > &value) |
Inserts a key/value pair into this dictionary. More... | |
virtual void | erase (const String &key) |
Deletes a key/value pair from this dictionary. More... | |
virtual void | clear () |
Deletes all objects from this collection. More... | |
virtual void | reserve (idx_t count) |
virtual void | trimToSize () |
Deallocates non-used memory. More... | |
virtual idx_t | capacity () const |
Returns the capacity of this collection. More... | |
virtual idx_t | size () const |
Returns the number of objects in this collection. More... | |
void | sync () |
void | resetCounts () |
void | resetCounts (const Filter &filter) |
void | resetCounts (const String &key) |
void | resetReadCount (const String &key) |
void | resetWriteCount (const String &key) |
int | getReadCount (const String &key) const |
int | getWriteCount (const String &key) const |
Array< String > | listObjects (const Filter &filter, const String &sep=".") const |
Array< String > | listTouchedObjects (const String &sep=".") const |
Array< String > | listUntouchedObjects (const String &sep=".") const |
Public Member Functions inherited from jem::util::Dictionary | |
virtual Class * | getClass () const |
Returns the Class instance representing the runtime class of this object. More... | |
Ref< DictionaryEnumerator > | enumerate () const |
Returns an enumerator over this dictionary. More... | |
virtual Ref< DictionaryEnumerator > | getDictEnumerator () const =0 |
Returns an enumerator over this dictionary. More... | |
virtual Ref< Enumerator > | getEnumerator () const |
Returns an enumerator over this dictionary. More... | |
virtual Ref< Object > | get (const String &key) const |
Returns the object associated with a specific key. More... | |
virtual bool | add (const Ref< Object > &obj) |
Adds a key/value pair to this dictionary. More... | |
Public Member Functions inherited from jem::util::ObjectCollection | |
Ref< Enumerator > | enumerate () const |
Returns an enumerator over this collection. More... | |
virtual void | reserve (int n) |
Pre-allocates data structures for storing additional objects. More... | |
Public Member Functions inherited from jem::Object | |
virtual String | toString () const |
Returns a short textual description of this object. More... | |
virtual long | hashValue () const |
Returns a hash value for this object. More... | |
virtual bool | equals (const Ref< Object > &obj) const |
Tests whether two objects are equal. More... | |
Ref< Object > | clone () const |
Returns a copy of this object. More... | |
Static Public Attributes | |
static const int | MAX_DEPTH |
Protected Member Functions | |
virtual | ~SnoopDictionary () |
Protected Member Functions inherited from jem::util::Dictionary | |
virtual | ~Dictionary () |
void | readFrom_ (io::ObjectInput &in) |
Reads the contents of this dictionary from an object input stream. More... | |
void | writeTo_ (io::ObjectOutput &out) const |
Writes the contents of this dictionary to an object output stream. More... | |
void | clone_ (const Dictionary &rhs) |
Makes a deep copy of another dictionary. More... | |
Protected Member Functions inherited from jem::util::ObjectCollection | |
virtual | ~ObjectCollection () |
void | clone_ (const ObjectCollection &rhs) |
Makes a deep copy of another collection. More... | |
void | readFrom_ (io::ObjectInput &in) |
Reads the contents of this collection from an object input stream. More... | |
void | writeTo_ (io::ObjectOutput &out) const |
Writes the contents of this collection to an object output stream. More... | |
Protected Member Functions inherited from jem::Collectable | |
Collectable () | |
Creates an empty Collectable . More... | |
~Collectable () | |
Frees resources. More... | |
Protected Member Functions inherited from jem::util::Enumerable | |
virtual | ~Enumerable () |
Protected Member Functions inherited from jem::Interface | |
virtual | ~Interface () |
Empty destructor. More... | |
Protected Member Functions inherited from jem::Clonable | |
virtual | ~Clonable () |
virtual void | emitVTable_ () |
Protected Member Functions inherited from jem::io::Serializable | |
virtual | ~Serializable () |
virtual void | emitVtableFunc_ () |
Friends | |
class | Map_ |
Additional Inherited Members | |
Static Public Member Functions inherited from jem::util::Dictionary | |
static Class * | makeClass () |
static Class * | getType () |
Static Public Member Functions inherited from jem::util::ObjectCollection | |
static Class * | makeClass () |
static Class * | getType () |
Static Public Member Functions inherited from jem::Object | |
static Class * | getType () |
Returns the Class instance representing the Object class. More... | |
jem::xutil::SnoopDictionary::SnoopDictionary | ( | ) |
|
explicit |
|
protectedvirtual |
|
virtual |
Implements jem::io::Serializable.
|
virtual |
Implements jem::io::Serializable.
Implements jem::Clonable.
|
virtual |
|
virtual |
Returns true
if this dictionary contains the key key, and false
otherwise.
The implementation of this function provided by the Dictionary
class is equivalent with:
key | - a key string. |
true
if this dictionary contains the key key, and false
otherwise. Reimplemented from jem::util::Dictionary.
|
virtual |
Searches for the object that is associated with the key key. If the object is found, then its address is stored in the output parameter value and true
is returned. Otherwise, false
is returned and the output parameter value is not modified.
This function may not be called if an enumerator points to this dictionary.
value | - a reference in which the address of the object to be found is stored. |
key | - the key associated with the object to be found. |
true
if this dictionary contains the key key, and false
otherwise. Implements jem::util::Dictionary.
|
virtual |
Inserts a key/value pair in this dictionary. If this dictionary already contains the key key, then its associated value is replaced by the parameter value.
This function may not be called if an enumerator points to this dictionary.
key | - a key string. |
value | - the object associated with the key key. |
Implements jem::util::Dictionary.
|
virtual |
Deletes the key key and its associated value from this dictionary. If this dictionary does not contain the specified key, then this function has no effect.
This function may not be called if an enumerator points to this dictionary.
key | - the key to be deleted. |
Implements jem::util::Dictionary.
|
virtual |
Deletes all objects from this collection.
This function may not be called if an enumerator points to this collection.
this->size() == 0
Implements jem::util::ObjectCollection.
|
virtual |
|
virtual |
Notifies this collection that it should deallocate non-used memory. Call this function after you have added all objects to this collection.
For efficiency reasons, an ObjectCollection
may allocate extra memory each time that an object is added and no more free space is left in its internal data structures. This means that the ObjectCollection
may use more memory than is actually needed to store all objects. This member function informs the ObjectCollection
that no more new objects will be added and that it should shrink its data structures as much as possible.
This function may not be called if an enumerator points to this collection.
reserve()
, capacity()
Reimplemented from jem::util::ObjectCollection.
|
virtual |
Returns the number of objects that this collection can contain without having to expand its internal data structures. This number is called the capacity of this collection.
The implementation of this function provided by the ObjectCollection
class simply returns size()
.
Reimplemented from jem::util::ObjectCollection.
|
virtual |
Returns the number of objects in this collection.
Implements jem::util::ObjectCollection.
void jem::xutil::SnoopDictionary::sync | ( | ) |
void jem::xutil::SnoopDictionary::resetCounts | ( | ) |
void jem::xutil::SnoopDictionary::resetCounts | ( | const Filter & | filter | ) |
void jem::xutil::SnoopDictionary::resetCounts | ( | const String & | key | ) |
void jem::xutil::SnoopDictionary::resetReadCount | ( | const String & | key | ) |
void jem::xutil::SnoopDictionary::resetWriteCount | ( | const String & | key | ) |
int jem::xutil::SnoopDictionary::getReadCount | ( | const String & | key | ) | const |
int jem::xutil::SnoopDictionary::getWriteCount | ( | const String & | key | ) | const |
Array<String> jem::xutil::SnoopDictionary::listObjects | ( | const Filter & | filter, |
const String & | sep = "." |
||
) | const |
|
friend |
|
static |