Sparksee 6.1.0
Objects Class Reference

Object identifier set class. More...

#include <Objects.h>

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

Public Member Functions

virtual ~Objects ()
 Destructor.
Objects * Copy ()
 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 (sparksee::gdb::NoSuchElementException, sparksee::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.
Objects * Sample (Objects *exclude, int64_t samples)
 Creates a new Objects instance which is a sample of the calling one.
ObjectsIterator * Iterator ()
 Gets an ObjectsIterator.
ObjectsIterator * IteratorFromIndex (int64_t index)
 Gets an ObjectsIterator skipping index elements.
ObjectsIterator * IteratorFromElement (oid_t e)
 Gets an ObjectsIterator starting from the given element.

Static Public Member Functions

static Objects * CombineUnion (Objects *objs1, Objects *objs2)
 Creates a new Objects instance which is the union of the two given.
static Objects * CombineIntersection (Objects *objs1, Objects *objs2)
 Creates a new Objects instance which is the intersection of the two given.
static Objects * CombineDifference (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 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

◆ Add()

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.

◆ Any()

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.
Errorfor other issues.

◆ CombineDifference()

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.

References CombineDifference().

Referenced by CombineDifference().

◆ CombineIntersection()

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.

References CombineIntersection().

Referenced by CombineIntersection().

◆ CombineUnion()

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.

References CombineUnion().

Referenced by CombineUnion().

◆ Contains()

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.

References Contains().

Referenced by Contains().

◆ Copy() [1/2]

Objects * Objects::Copy ( )

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

Returns
The new Objects instance.

Referenced by Copy().

◆ Copy() [2/2]

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.

References Copy().

◆ Count()

int64_t Objects::Count ( )

Gets the number of elements into the collection.

Returns
The number of elements into the collection.

◆ Difference()

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.

References Difference().

Referenced by Difference().

◆ Equals()

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.

References Equals().

Referenced by Equals().

◆ Exists()

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.

◆ Intersection()

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.

References Intersection().

Referenced by Intersection().

◆ Iterator()

ObjectsIterator * Objects::Iterator ( )

Gets an ObjectsIterator.

Returns
ObjectsIterator instance.

References Iterator().

Referenced by Iterator().

◆ IteratorFromElement()

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.

References END_SPARKSEE_GDB_NAMESPACE, and IteratorFromElement().

Referenced by IteratorFromElement().

◆ IteratorFromIndex()

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.

References IteratorFromIndex().

Referenced by IteratorFromIndex().

◆ Remove()

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.

References Remove().

Referenced by Remove().

◆ Sample()

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.

References Sample().

Referenced by Sample().

◆ Union()

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.

References Union().

Referenced by Union().


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