Objects Class Reference
[GDB]

Object identifier set class. More...

Inheritance diagram for Objects:

Inheritance graph
Collaboration diagram for Objects:

Collaboration graph

List of all members.

Public Member Functions

virtual ~Objects ()
 Destructor.
ObjectsCopy ()
 Creates a new Objects instance as a copy of the given one.
int64_t Count ()
 Gets the number of elements into the collection.
bool_t Add (oid_t e)
 Adds an element into the collection.
bool_t Exists (oid_t e)
 Gets if the given element exists into the collection.
oid_t Any () throw (dex::gdb::NoSuchElementException, dex::gdb::Error)
 Gets an element from the collection.
bool_t Remove (oid_t e)
 Removes an element from the collection.
void Clear ()
 Clears the collection removing all its elements.
int64_t Union (Objects *objs)
 Performs the union operation.
int64_t Intersection (Objects *objs)
 Performs the intersection operation.
int64_t Difference (Objects *objs)
 Performs the difference operation.
bool_t Equals (Objects *objs)
 Checks if the given Objects contains the same information.
bool_t Contains (Objects *objs)
 Check if this objects contains the other one.
int64_t Copy (Objects *objs)
 Performs the copy operation.
ObjectsSample (Objects *exclude, int64_t samples)
 Creates a new Objects instance which is a sample of the calling one.
ObjectsIteratorIterator ()
 Gets an ObjectsIterator.
ObjectsIteratorIteratorFromIndex (int64_t index)
 Gets an ObjectsIterator skipping index elements.
ObjectsIteratorIteratorFromElement (oid_t e)
 Gets an ObjectsIterator starting from the given element.

Static Public Member Functions

static ObjectsCombineUnion (Objects *objs1, Objects *objs2)
 Creates a new Objects instance which is the union of the two given.
static ObjectsCombineIntersection (Objects *objs1, Objects *objs2)
 Creates a new Objects instance which is the intersection of the two given.
static ObjectsCombineDifference (Objects *objs1, Objects *objs2)
 Creates a new Objects instance which is the difference of the two given.

Static Public Attributes

static const oid_t InvalidOID
 Invalid OID constant.

Friends

class Session
class Graph
class ObjectsIterator


Detailed Description

Object identifier set class.

It stores a collection of Dex object identifiers as a set. As a set, there is no duplicated elements.

This class should be used just to store large collections. Otherwise, it is strongly recommended to use common classes from the language API.

This class is not thread-safe.

ObjectsIterator must be used to traverse all the elements into the set.

When the Objects instance is closed, it closes all existing and non-closed ObjectsIterator instances too.

Object identifiers cannot be added or removed from an Objects instance while iterators are still traversing the collection. Any objects modifying method will invalidate it's open iterators.

Also, in case Objects has been retrieved from the Graph, this collection cannot be updated through its Graph. For example, if we retrieve all the objects belonging to a given node or edge type, we cannot add or drop nodes or edges of this type while traversing the retrieved collection.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

Objects* Objects::Copy (  ) 

Creates a new Objects instance as a copy of the given one.

Returns:
The new Objects instance.

int64_t Objects::Count (  ) 

Gets the number of elements into the collection.

Returns:
The number of elements into the collection.

bool_t Objects::Add ( oid_t  e  ) 

Adds an element into the collection.

Parameters:
e [in] Element to be added.
Returns:
TRUE if the element is added, FALSE if the element was already into the collection.

bool_t Objects::Exists ( oid_t  e  ) 

Gets if the given element exists into the collection.

Parameters:
e [in] Element.
Returns:
TRUE if the element exists into the collection, FALSE otherwise.

oid_t Objects::Any (  )  throw (dex::gdb::NoSuchElementException, dex::gdb::Error)

Gets an element from the collection.

Returns:
Any element from the collection.
Exceptions:
NoSuchElementException whether the collection is empty.

bool_t Objects::Remove ( oid_t  e  ) 

Removes an element from the collection.

Parameters:
e [in] Element to be removed.
Returns:
TRUE if the element is removed, FALSE if the element was not into the collection.

int64_t Objects::Union ( Objects objs  ) 

Performs the union operation.

This adds all existing elements of the given Objects instance to the Objects calling instance

Parameters:
objs [in] Objects instance.
Returns:
Number of elements into the collection once the operation has been executed.

int64_t Objects::Intersection ( Objects objs  ) 

Performs the intersection operation.

Updates the Objects calling instance setting those existing elements at both two collections and removing all others.

Parameters:
objs [in] Objects instance.
Returns:
Number of elements into the collection once the operation has been executed.

int64_t Objects::Difference ( Objects objs  ) 

Performs the difference operation.

This updates the Objects calling instance removing those existing elements at the given Objects instance.

Parameters:
objs [in] Objects instance.
Returns:
Number of elements into the collection once the operation has been executed.

bool_t Objects::Equals ( Objects objs  ) 

Checks if the given Objects contains the same information.

Parameters:
objs [in] Objects instance.
Returns:
True if the objects are equal or false otherwise.

bool_t Objects::Contains ( Objects objs  ) 

Check if this objects contains the other one.

Parameters:
objs Objects collection.
Returns:
True if it contains the given object.

static Objects* Objects::CombineUnion ( Objects objs1,
Objects objs2 
) [static]

Creates a new Objects instance which is the union of the two given.

Two given Objects belong to the same Session.

Parameters:
objs1 [in] Objects instance.
objs2 [in] Objects instance.
Returns:
New Objects instance.

static Objects* Objects::CombineIntersection ( Objects objs1,
Objects objs2 
) [static]

Creates a new Objects instance which is the intersection of the two given.

Two given Objects belong to the same Session.

Parameters:
objs1 [in] Objects instance.
objs2 [in] Objects instance.
Returns:
New Objects instance.

static Objects* Objects::CombineDifference ( Objects objs1,
Objects objs2 
) [static]

Creates a new Objects instance which is the difference of the two given.

Two given Objects belong to the same Session.

Parameters:
objs1 [in] Objects instance.
objs2 [in] Objects instance.
Returns:
New Objects instance.

int64_t Objects::Copy ( Objects objs  ) 

Performs the copy operation.

This updates the Objects calling instance and copies the given Objects instance.

Parameters:
objs [in] Objects instance.
Returns:
Number of elements into the collection once the operation has been executed.

Objects* Objects::Sample ( Objects exclude,
int64_t  samples 
)

Creates a new Objects instance which is a sample of the calling one.

Parameters:
exclude [in] If not NULL, elements into this collection will be excluded from the resulting one.
samples [in] Number of elements into the resulting collection.
Returns:
Sample collection.

ObjectsIterator* Objects::Iterator (  ) 

Gets an ObjectsIterator.

Returns:
ObjectsIterator instance.

ObjectsIterator* Objects::IteratorFromIndex ( int64_t  index  ) 

Gets an ObjectsIterator skipping index elements.

Objects collection has no order, so this method is implementation-dependent.

Parameters:
index [in] The number of elements to skip from the beginning. It must be in the range [0..Size).
Returns:
ObjectsIterator instance.

ObjectsIterator* Objects::IteratorFromElement ( oid_t  e  ) 

Gets an ObjectsIterator starting from the given element.

Objects collection has no order, so this method is implementation-dependent.

Parameters:
e [in] The first element to traverse in the resulting ObjectsIterator instance.
Returns:
ObjectsIterator instance.


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

Generated on Mon Oct 15 14:40:41 2012 for Dex by  doxygen 1.5.6