te::da::Sequence Class Reference

It describes a sequence (a number generator). More...

#include <Sequence.h>

Public Member Functions

Sequenceclone ()
 It returns a clone of the object. More...
 
boost::int64_t getCachedValues () const
 It returns how many sequence numbers are preallocated. More...
 
DataSourceCataloggetCatalog () const
 It returns the catalog associated to the sequence. More...
 
unsigned int getId () const
 It returns the sequence identifier. More...
 
boost::int64_t getIncrement () const
 It returns the increment value. More...
 
boost::int64_t getMaxValue () const
 It returns the maximum value that the sequence can generate. More...
 
boost::int64_t getMinValue () const
 It returns the minimum value that the sequence can generate. More...
 
const std::string & getName () const
 It returns the sequence name. More...
 
te::dt::PropertygetOwner () const
 It returns the property type associated to the sequence. More...
 
boost::int64_t getStartValue () const
 It returns the initial value of the sequence. More...
 
bool isCycled () const
 It returns true if the sequence can wrap, otherwise it returns false. More...
 
Sequenceoperator= (const Sequence &rhs)
 Assignment operator. More...
 
 Sequence (DataSourceCatalog *catalog=0, unsigned int id=0)
 It constructs a new sequence. More...
 
 Sequence (const std::string &name, boost::int64_t increment=1, boost::int64_t startValue=1, DataSourceCatalog *catalog=0, unsigned int id=0)
 It creates a new sequence. More...
 
 Sequence (const Sequence &rhs)
 Copy constructor. More...
 
void setAsCycle ()
 It sets the sequence as cycled (it can wrap). More...
 
void setAsNoCycle ()
 It sets the sequence as not cycled (it can't wrap). More...
 
void setCachedValues (boost::int64_t value)
 It sets how many sequence numbers are to be preallocated. More...
 
void setCatalog (DataSourceCatalog *catalog)
 It sets the catalog associated to the sequence. More...
 
void setId (unsigned int id)
 It sets the sequence identifier. More...
 
void setIncrement (boost::int64_t n)
 It sets the increment value. More...
 
void setMaxValue (boost::int64_t value)
 It sets the maximum value that the sequence can generate. More...
 
void setMinValue (boost::int64_t value)
 It sets the minimum value that the sequence can generate. More...
 
void setName (const std::string &name)
 It sets the sequence name. More...
 
void setOwner (te::dt::Property *owner)
 It causes the sequence to be associated with a specific property type. More...
 
void setStartValue (boost::int64_t value)
 It sets the sequence starting value. More...
 
 ~Sequence ()
 Destructor. More...
 

Private Attributes

boost::int64_t m_cachedValues
 It specifies how many sequence numbers are to be preallocated for faster access. More...
 
DataSourceCatalogm_catalog
 The DataSourceCatalog associated to this sequence. More...
 
bool m_cycled
 If it is true, the sequence can wrap when it reaches the maximum value in the case of an ascendent sequence or wrap when it reaches the minimum value in the case of a descendant sequence. More...
 
unsigned int m_id
 An identification number for the sequence. More...
 
boost::int64_t m_increment
 The value to be added to the current sequence value to create the new value. More...
 
boost::int64_t m_maxValue
 The maximum value that the sequence can generate. More...
 
boost::int64_t m_minValue
 The minimum value that the sequence can generate. More...
 
std::string m_name
 The sequence name. More...
 
te::dt::Propertym_ownedBy
 The sequence may be associated with a specific property type (owned by a property). More...
 
boost::int64_t m_startValue
 The sequence starting value. More...
 

Detailed Description

It describes a sequence (a number generator).

See also
DataSourceCatalog, DataSetType, Property

Definition at line 56 of file Sequence.h.

Constructor & Destructor Documentation

te::da::Sequence::Sequence ( DataSourceCatalog catalog = 0,
unsigned int  id = 0 
)

It constructs a new sequence.

A sequence may belongs to the global catalog of a given data source, and it can be associated to a given property of a specific dataset type.

Parameters
catalogThe catalog associated to the sequence.
idThe sequence identifier.
Postcondition
If catalog is provided, the sequence will belong to the given DataSourceCatalog.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::da::Sequence::Sequence ( const std::string &  name,
boost::int64_t  increment = 1,
boost::int64_t  startValue = 1,
DataSourceCatalog catalog = 0,
unsigned int  id = 0 
)

It creates a new sequence.

Parameters
nameThe sequence name.
incrementThe value to be added to the current sequence value to create the new value (default = 1).
startValueThe sequence starting value (default = 1).
catalogThe catalog associated to the sequence.
idThe sequence identifier.
Postcondition
If catalog is provided, the sequence will belong to the given DataSourceCatalog.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::da::Sequence::Sequence ( const Sequence rhs)

Copy constructor.

The new object will not have an associated catalog.

Parameters
rhsRight-hand-side instance.
te::da::Sequence::~Sequence ( )
inline

Destructor.

Definition at line 104 of file Sequence.h.

Member Function Documentation

Sequence* te::da::Sequence::clone ( )

It returns a clone of the object.

The new object will not have an associated catalog.

Returns
A clone of the object.
boost::int64_t te::da::Sequence::getCachedValues ( ) const
inline

It returns how many sequence numbers are preallocated.

Returns
How many sequence numbers are preallocated.

Definition at line 210 of file Sequence.h.

DataSourceCatalog* te::da::Sequence::getCatalog ( ) const
inline

It returns the catalog associated to the sequence.

Returns
The catalog associated to the sequence.

Definition at line 254 of file Sequence.h.

unsigned int te::da::Sequence::getId ( ) const
inline

It returns the sequence identifier.

Returns
A number that identifies the sequence.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 124 of file Sequence.h.

boost::int64_t te::da::Sequence::getIncrement ( ) const
inline

It returns the increment value.

Returns
The increment value.

Definition at line 154 of file Sequence.h.

boost::int64_t te::da::Sequence::getMaxValue ( ) const
inline

It returns the maximum value that the sequence can generate.

Returns
The maximum value that the sequence can generate.

Definition at line 182 of file Sequence.h.

boost::int64_t te::da::Sequence::getMinValue ( ) const
inline

It returns the minimum value that the sequence can generate.

Returns
The minimum value that the sequence can generate.

Definition at line 168 of file Sequence.h.

const std::string& te::da::Sequence::getName ( ) const
inline

It returns the sequence name.

Returns
The sequence name.

Definition at line 140 of file Sequence.h.

te::dt::Property* te::da::Sequence::getOwner ( ) const
inline

It returns the property type associated to the sequence.

Returns
The property type associated to the sequence.

Definition at line 237 of file Sequence.h.

boost::int64_t te::da::Sequence::getStartValue ( ) const
inline

It returns the initial value of the sequence.

Returns
the initial value of the sequence

Definition at line 196 of file Sequence.h.

bool te::da::Sequence::isCycled ( ) const
inline

It returns true if the sequence can wrap, otherwise it returns false.

Returns
True if the sequence can wrap, otherwise it returns false.

Definition at line 224 of file Sequence.h.

Sequence& te::da::Sequence::operator= ( const Sequence rhs)

Assignment operator.

The new object will not have an associated catalog.

Parameters
rhsRight-hand-side instance.
Returns
A reference to this object.
void te::da::Sequence::setAsCycle ( )
inline

It sets the sequence as cycled (it can wrap).

Definition at line 227 of file Sequence.h.

void te::da::Sequence::setAsNoCycle ( )
inline

It sets the sequence as not cycled (it can't wrap).

Definition at line 230 of file Sequence.h.

void te::da::Sequence::setCachedValues ( boost::int64_t  value)
inline

It sets how many sequence numbers are to be preallocated.

Parameters
valueHow many sequence numbers are to be preallocated.

Definition at line 217 of file Sequence.h.

void te::da::Sequence::setCatalog ( DataSourceCatalog catalog)
inline

It sets the catalog associated to the sequence.

Parameters
catalogThe data source catalog to which this sequence belongs.
Warning
Take care when calling this method. If the sequence belongs to a DataSourceCatalog remember to detach it from the catalog before calling this method.

Definition at line 264 of file Sequence.h.

void te::da::Sequence::setId ( unsigned int  id)
inline

It sets the sequence identifier.

Parameters
idA number that identifies the sequence.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 133 of file Sequence.h.

void te::da::Sequence::setIncrement ( boost::int64_t  n)
inline

It sets the increment value.

Parameters
nThe increment value.

Definition at line 161 of file Sequence.h.

void te::da::Sequence::setMaxValue ( boost::int64_t  value)
inline

It sets the maximum value that the sequence can generate.

Parameters
valueThe maximum value that the sequence can generate.

Definition at line 189 of file Sequence.h.

void te::da::Sequence::setMinValue ( boost::int64_t  value)
inline

It sets the minimum value that the sequence can generate.

Parameters
valueThe minimum value that the sequence can generate.

Definition at line 175 of file Sequence.h.

void te::da::Sequence::setName ( const std::string &  name)
inline

It sets the sequence name.

Parameters
nameThe sequence name.

Definition at line 147 of file Sequence.h.

void te::da::Sequence::setOwner ( te::dt::Property owner)
inline

It causes the sequence to be associated with a specific property type.

When the dataset type is dropped (or its whole catalog), the sequence will be automatically dropped as well.

Parameters
ownerThe property type owner of this sequence.

Definition at line 247 of file Sequence.h.

void te::da::Sequence::setStartValue ( boost::int64_t  value)
inline

It sets the sequence starting value.

Parameters
valueThe sequence starting value.

Definition at line 203 of file Sequence.h.

Member Data Documentation

boost::int64_t te::da::Sequence::m_cachedValues
private

It specifies how many sequence numbers are to be preallocated for faster access.

Definition at line 281 of file Sequence.h.

DataSourceCatalog* te::da::Sequence::m_catalog
private

The DataSourceCatalog associated to this sequence.

Definition at line 282 of file Sequence.h.

bool te::da::Sequence::m_cycled
private

If it is true, the sequence can wrap when it reaches the maximum value in the case of an ascendent sequence or wrap when it reaches the minimum value in the case of a descendant sequence.

Definition at line 285 of file Sequence.h.

unsigned int te::da::Sequence::m_id
private

An identification number for the sequence.

Definition at line 284 of file Sequence.h.

boost::int64_t te::da::Sequence::m_increment
private

The value to be added to the current sequence value to create the new value.

Definition at line 277 of file Sequence.h.

boost::int64_t te::da::Sequence::m_maxValue
private

The maximum value that the sequence can generate.

Definition at line 279 of file Sequence.h.

boost::int64_t te::da::Sequence::m_minValue
private

The minimum value that the sequence can generate.

Definition at line 278 of file Sequence.h.

std::string te::da::Sequence::m_name
private

The sequence name.

Definition at line 286 of file Sequence.h.

te::dt::Property* te::da::Sequence::m_ownedBy
private

The sequence may be associated with a specific property type (owned by a property).

Definition at line 283 of file Sequence.h.

boost::int64_t te::da::Sequence::m_startValue
private

The sequence starting value.

Definition at line 280 of file Sequence.h.


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