DDD  1.9.0.20240425101308
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
IntDataSet Class Reference

This class is a very basic implementation of DataSet interface based on std::std::vector<int> and a unicity table. More...

#include <IntDataSet.h>

Inheritance diagram for IntDataSet:
Inheritance graph
Collaboration diagram for IntDataSet:
Collaboration graph

Public Types

typedef std::vector< int >::const_iterator const_iterator
 typedef IntDataSet::const_iterator More...
 

Public Member Functions

const_iterator begin () const
 read-only iterator interface More...
 
const_iterator end () const
 
 IntDataSet (const std::vector< int > &ddata)
 public constructor from non unique std::vector<int> More...
 
 IntDataSet (const std::vector< int >::iterator &begin, const std::vector< int >::iterator &end)
 public constructor from iterator (begin,end) More...
 
 IntDataSet ()
 public deafult constructor = empty set More...
 
virtual ~IntDataSet ()
 destructor More...
 
DataSetnewcopy () const
 returns a new instance copy of this More...
 
DataSetset_intersect (const DataSet &b) const
 returns a new instance with elements = this inter b More...
 
DataSetset_union (const DataSet &b) const
 returns a new instance with elements = this union b More...
 
DataSetset_minus (const DataSet &b) const
 returns a new instance with elements = this setminus b More...
 
bool empty () const
 returns true if this is the empty set More...
 
DataSetempty_set () const
 returns a pointer to an instance of the empty set More...
 
bool set_equal (const DataSet &b) const
 Compares two sets for equality. More...
 
bool set_less_than (const DataSet &b) const
 Compares two sets for equality. More...
 
long double set_size () const
 
virtual size_t set_hash () const
 returns a hash function, used in the SDD hash function computation More...
 
virtual void set_print (std::ostream &os) const
 returns a formatted string description of the set More...
 
void mark () const
 for memory management : if your DataSet references no GDD,GHom,GSDD,GShom, mark() should do nothing More...
 

Static Public Member Functions

static void garbage ()
 

Private Types

typedef UniqueTable< std::vector< int > > canonical_t
 
typedef canonical_t::Table::iterator canonical_it
 
typedef std::set< const std::vector< int > * > marktable_t
 
typedef marktable_t::const_iterator marktable_it
 

Private Member Functions

 IntDataSet (const std::vector< int > *ddata)
 

Private Attributes

const std::vector< int > * data
 

Static Private Attributes

static canonical_t canonical = UniqueTable<std::vector<int> > ()
 
static marktable_t marktable = marktable_t()
 
static const std::vector< int > * empty_ = canonical(std::vector<int>(0))
 

Detailed Description

This class is a very basic implementation of DataSet interface based on std::std::vector<int> and a unicity table.

Member Typedef Documentation

◆ canonical_it

typedef canonical_t::Table::iterator IntDataSet::canonical_it
private

◆ canonical_t

typedef UniqueTable<std::vector<int> > IntDataSet::canonical_t
private

◆ const_iterator

typedef std::vector<int>::const_iterator IntDataSet::const_iterator

◆ marktable_it

typedef marktable_t::const_iterator IntDataSet::marktable_it
private

◆ marktable_t

typedef std::set<const std::vector<int> *> IntDataSet::marktable_t
private

Constructor & Destructor Documentation

◆ IntDataSet() [1/4]

IntDataSet::IntDataSet ( const std::vector< int > *  ddata)
inlineprivate

◆ IntDataSet() [2/4]

IntDataSet::IntDataSet ( const std::vector< int > &  ddata)
inline

public constructor from non unique std::vector<int>

References canonical, and data.

◆ IntDataSet() [3/4]

IntDataSet::IntDataSet ( const std::vector< int >::iterator &  begin,
const std::vector< int >::iterator &  end 
)
inline

public constructor from iterator (begin,end)

References begin(), canonical, data, and end().

◆ IntDataSet() [4/4]

IntDataSet::IntDataSet ( )
inline

public deafult constructor = empty set

References data, and empty_.

Referenced by empty_set(), newcopy(), set_intersect(), set_minus(), and set_union().

◆ ~IntDataSet()

virtual IntDataSet::~IntDataSet ( )
inlinevirtual

destructor

Member Function Documentation

◆ begin()

const_iterator IntDataSet::begin ( ) const
inline

read-only iterator interface

References data.

Referenced by IntDataSet().

◆ empty()

bool IntDataSet::empty ( ) const
inlinevirtual

returns true if this is the empty set

Implements DataSet.

References data, and empty_.

◆ empty_set()

DataSet* IntDataSet::empty_set ( ) const
inlinevirtual

returns a pointer to an instance of the empty set

Implements DataSet.

References IntDataSet().

◆ end()

const_iterator IntDataSet::end ( ) const
inline

References data.

Referenced by IntDataSet().

◆ garbage()

void IntDataSet::garbage ( )
static

◆ mark()

void IntDataSet::mark ( ) const
inlinevirtual

for memory management : if your DataSet references no GDD,GHom,GSDD,GShom, mark() should do nothing

Implements DataSet.

References data, and marktable.

◆ newcopy()

DataSet* IntDataSet::newcopy ( ) const
inlinevirtual

returns a new instance copy of this

Implements DataSet.

References data, and IntDataSet().

◆ set_equal()

bool IntDataSet::set_equal ( const DataSet b) const
inlinevirtual

Compares two sets for equality.

Implements DataSet.

References data.

◆ set_hash()

virtual size_t IntDataSet::set_hash ( ) const
inlinevirtual

returns a hash function, used in the SDD hash function computation

Implements DataSet.

References data.

◆ set_intersect()

DataSet* IntDataSet::set_intersect ( const DataSet b) const
inlinevirtual

returns a new instance with elements = this inter b

Implements DataSet.

References canonical, data, and IntDataSet().

◆ set_less_than()

bool IntDataSet::set_less_than ( const DataSet b) const
inlinevirtual

Compares two sets for equality.

Implements DataSet.

References data.

◆ set_minus()

DataSet* IntDataSet::set_minus ( const DataSet b) const
inlinevirtual

returns a new instance with elements = this setminus b

Implements DataSet.

References canonical, data, and IntDataSet().

◆ set_print()

virtual void IntDataSet::set_print ( std::ostream &  os) const
inlinevirtual

returns a formatted string description of the set

Implements DataSet.

References data.

◆ set_size()

long double IntDataSet::set_size ( ) const
inlinevirtual
Returns
the size (number of elements) in a set

Implements DataSet.

References data.

◆ set_union()

DataSet* IntDataSet::set_union ( const DataSet b) const
inlinevirtual

returns a new instance with elements = this union b

Implements DataSet.

References canonical, data, and IntDataSet().

Member Data Documentation

◆ canonical

UniqueTable< std::vector< int > > IntDataSet::canonical = UniqueTable<std::vector<int> > ()
staticprivate

◆ data

const std::vector<int>* IntDataSet::data
private

◆ empty_

const std::vector< int > * IntDataSet::empty_ = canonical(std::vector<int>(0))
staticprivate

Referenced by empty(), and IntDataSet().

◆ marktable

IntDataSet::marktable_t IntDataSet::marktable = marktable_t()
staticprivate

Referenced by garbage(), and mark().


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

Please comment this page and report errors about it on the RefDocComments page.
Generated on Thu Apr 25 2024 10:15:16 for DDD by doxygen 1.9.1