Jive reference manual
List of all members | Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends
jem::xutil::SnoopDictionary Class Reference

#include <jem/xutil/SnoopDictionary.h>

Inheritance diagram for jem::xutil::SnoopDictionary:
Inheritance graph

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< Objectclone () 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< StringlistObjects (const Filter &filter, const String &sep=".") const
 
Array< StringlistTouchedObjects (const String &sep=".") const
 
Array< StringlistUntouchedObjects (const String &sep=".") const
 
- Public Member Functions inherited from jem::util::Dictionary
virtual ClassgetClass () const
 Returns the Class instance representing the runtime class of this object. More...
 
Ref< DictionaryEnumeratorenumerate () const
 Returns an enumerator over this dictionary. More...
 
virtual Ref< DictionaryEnumeratorgetDictEnumerator () const =0
 Returns an enumerator over this dictionary. More...
 
virtual Ref< EnumeratorgetEnumerator () const
 Returns an enumerator over this dictionary. More...
 
virtual Ref< Objectget (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< Enumeratorenumerate () 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< Objectclone () 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 ClassmakeClass ()
 
static ClassgetType ()
 
- Static Public Member Functions inherited from jem::util::ObjectCollection
static ClassmakeClass ()
 
static ClassgetType ()
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 Returns the Class instance representing the Object class. More...
 

Constructor & Destructor Documentation

jem::xutil::SnoopDictionary::SnoopDictionary ( )
jem::xutil::SnoopDictionary::SnoopDictionary ( const Ref< Dict > &  dict)
explicit
virtual jem::xutil::SnoopDictionary::~SnoopDictionary ( )
protectedvirtual

Member Function Documentation

virtual void jem::xutil::SnoopDictionary::readFrom ( io::ObjectInput in)
virtual

Implements jem::io::Serializable.

virtual void jem::xutil::SnoopDictionary::writeTo ( io::ObjectOutput out) const
virtual

Implements jem::io::Serializable.

virtual Ref<Object> jem::xutil::SnoopDictionary::clone ( ) const
virtual

Implements jem::Clonable.

virtual Ref<DictEnum> jem::xutil::SnoopDictionary::getDictEnum ( ) const
virtual
virtual bool jem::xutil::SnoopDictionary::contains ( const String key) const
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:

Ref<Object> dummy;
return find ( dummy, key );
Parameters
key- a key string.
Returns
true if this dictionary contains the key key, and false otherwise.

Reimplemented from jem::util::Dictionary.

virtual bool jem::xutil::SnoopDictionary::find ( Ref< Object > &  value,
const String key 
) const
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.

Parameters
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.
Returns
true if this dictionary contains the key key, and false otherwise.

Implements jem::util::Dictionary.

virtual void jem::xutil::SnoopDictionary::insert ( const String key,
const Ref< Object > &  value 
)
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.

Parameters
key- a key string.
value- the object associated with the key key.

Implements jem::util::Dictionary.

virtual void jem::xutil::SnoopDictionary::erase ( const String key)
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.

Parameters
key- the key to be deleted.

Implements jem::util::Dictionary.

virtual void jem::xutil::SnoopDictionary::clear ( )
virtual

Deletes all objects from this collection.

This function may not be called if an enumerator points to this collection.

Postcondition
this->size() == 0

Implements jem::util::ObjectCollection.

virtual void jem::xutil::SnoopDictionary::reserve ( idx_t  count)
virtual
virtual void jem::xutil::SnoopDictionary::trimToSize ( )
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.

See also
reserve(), capacity()

Reimplemented from jem::util::ObjectCollection.

virtual idx_t jem::xutil::SnoopDictionary::capacity ( ) const
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().

Returns
The capacity of this collection.

Reimplemented from jem::util::ObjectCollection.

virtual idx_t jem::xutil::SnoopDictionary::size ( ) const
virtual

Returns the number of objects in this collection.

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
Array<String> jem::xutil::SnoopDictionary::listTouchedObjects ( const String sep = ".") const
Array<String> jem::xutil::SnoopDictionary::listUntouchedObjects ( const String sep = ".") const

Friends And Related Function Documentation

friend class Map_
friend

Member Data Documentation

const int jem::xutil::SnoopDictionary::MAX_DEPTH
static