Sparksee  6.0.2
Objects Class Reference

Object identifier set class. More...

Inheritance diagram for Objects:
Inheritance graph
Collaboration diagram for Objects:
Collaboration graph

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const oid_t InvalidOID
 Invalid OID constant.
 

Private Member Functions

sparksee_core::Objects * GetHandler ()
 Gets the handled reference. More...
 
const sparksee_core::Objects * GetHandler () const
 Gets the handled reference. More...
 
void SetHandler (sparksee_core::Objects *h)
 Sets the handled reference. More...
 
void FreeHandler ()
 Frees (deletes) the handled reference.
 
bool_t IsNull () const
 Gets if the handler is NULL. More...
 

Friends

class Session
 
class Graph
 
class ObjectsIterator
 

Detailed Description

Object identifier set class.

It stores a collection of Sparksee object identifiers as a set. As a set, there is no order and 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.

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

Member Function Documentation

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.
oid_t Objects::Any ( )
throw (sparksee::gdb::NoSuchElementException,
sparksee::gdb::Error
)

Gets an element from the collection.

Returns
Any element from the collection.
Exceptions
NoSuchElementExceptionwhether the collection is empty.
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.
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::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.
bool_t Objects::Contains ( Objects objs)

Check if this objects contains the other one.

Parameters
objsObjects collection.
Returns
True if it contains the given object.
Objects* Objects::Copy ( )

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

Returns
The 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.
int64_t Objects::Count ( )

Gets the number of elements into the collection.

Returns
The number of elements into the collection.
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::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.
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.
ObjectsIterator* Objects::Iterator ( )

Gets an ObjectsIterator.

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

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