All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::da::ObjectIdSet Class Reference

This class represents a set of unique ids created in the same context. i.e. from the same data set. More...

#include <ObjectIdSet.h>

Public Member Functions

void add (ObjectId *oid)
 It adds an object id to this object id set. More...
 
void addProperty (const std::string &name, std::size_t pos, int type)
 It adds a property that will be used to generate the unique ids. More...
 
std::set< ObjectId
*, te::common::LessCmp
< ObjectId * >
>::const_iterator 
begin () const
 Returns an iterator for the object ids in container. More...
 
void clear ()
 It clears this object id set. More...
 
ObjectIdSetclone () const
 
bool contains (ObjectId *oid) const
 It returns if the object id set contains the given oid. More...
 
void difference (const ObjectIdSet *rhs)
 It performs the difference operation between this ObjectIdSet and the given ObjectIdSet. More...
 
std::set< ObjectId
*, te::common::LessCmp
< ObjectId * >
>::const_iterator 
end () const
 Returns an iterator for the object ids in container. More...
 
ExpressiongetExpression (const std::string source="") const
 It returns the expression that can be used to retrieve the data set that contains the all indentified elements. More...
 
const std::vector< std::string > & getPropertyNames () const
 It returns the property names used to generated the oids. More...
 
const std::vector< std::size_t > & getPropertyPos () const
 It returns the property positions used to generated the oids. More...
 
const std::vector< int > & getPropertyTypes () const
 It returns the property types used to generated the oids. More...
 
 ObjectIdSet ()
 Constructor. More...
 
 ObjectIdSet (const ObjectIdSet &rhs, bool copyOids=true)
 Copy Constructor. More...
 
void remove (ObjectId *oid)
 Removes the object id from set. More...
 
std::size_t size () const
 It returns the object id set size. More...
 
void symDifference (const ObjectIdSet *rhs)
 It performs the symmetric difference operation between this ObjectIdSet and the given ObjectIdSet. More...
 
void Union (ObjectIdSet *rhs)
 It performs the union operation between this ObjectIdSet and the given ObjectIdSet. More...
 
 ~ObjectIdSet ()
 Destructor. More...
 

Private Attributes

std::set< ObjectId
*, te::common::LessCmp
< ObjectId * > > 
m_oids
 The set of unique ids. More...
 
std::vector< std::string > m_pnames
 The list of property names used to generate the unique ids. More...
 
std::vector< std::size_t > m_ppos
 The list of property positions used to generate the unique ids. More...
 
std::vector< int > m_ptypes
 The list of property types used to generate the unique ids. More...
 

Detailed Description

This class represents a set of unique ids created in the same context. i.e. from the same data set.

See also
DataSet, DataSetType, ObjectId

Definition at line 53 of file ObjectIdSet.h.

Constructor & Destructor Documentation

te::da::ObjectIdSet::ObjectIdSet ( )

Constructor.

Definition at line 41 of file ObjectIdSet.cpp.

te::da::ObjectIdSet::ObjectIdSet ( const ObjectIdSet rhs,
bool  copyOids = true 
)

Copy Constructor.

Definition at line 45 of file ObjectIdSet.cpp.

References m_oids.

te::da::ObjectIdSet::~ObjectIdSet ( )

Destructor.

Definition at line 58 of file ObjectIdSet.cpp.

References te::common::FreeContents().

Member Function Documentation

void te::da::ObjectIdSet::add ( ObjectId oid)

It adds an object id to this object id set.

Parameters
Theobject id that will be added.
Note
This class will take the ownership of the given pointer.

Definition at line 71 of file ObjectIdSet.cpp.

Referenced by te::qt::widgets::Histogram::find(), te::qt::widgets::Scatter::find(), te::qt::widgets::DataSetTableModel::getObjectIdSet(), and te::qt::af::ChartDisplayDockWidget::selectionChanged().

void te::da::ObjectIdSet::addProperty ( const std::string &  name,
std::size_t  pos,
int  type 
)

It adds a property that will be used to generate the unique ids.

Parameters
nameA property name that will be used to generate the unique ids.
nameThe property position.
typeThe property data type.

Definition at line 63 of file ObjectIdSet.cpp.

Referenced by te::da::GetEmptyOIDSet(), te::qt::widgets::DataSetTableModel::getObjectIdSet(), and te::qt::af::ChartDisplayDockWidget::selectionChanged().

std::set< te::da::ObjectId *, te::common::LessCmp< te::da::ObjectId * > >::const_iterator te::da::ObjectIdSet::begin ( ) const

Returns an iterator for the object ids in container.

Returns
Iterator for the begin element of the container.
Note
When using the iterators it WILL NOT give the ownership of the pointers. This means that the caller MUST NOT delete the pointers or it will lead to an inconsistent state.

Definition at line 221 of file ObjectIdSet.cpp.

Referenced by te::qt::af::MapDisplay::drawLayerSelection(), GetOidsAsString(), te::qt::widgets::ScatterChart::highlight(), te::qt::widgets::HistogramChart::highlight(), te::qt::widgets::DataSetTableView::highlightOIds(), te::qt::widgets::DataSetTableView::highlightRow(), te::qt::widgets::Promoter::promote(), te::ogr::Transactor::remove(), and te::qt::af::ChartDisplayDockWidget::selectionChanged().

void te::da::ObjectIdSet::clear ( )

It clears this object id set.

Definition at line 119 of file ObjectIdSet.cpp.

References te::common::FreeContents().

Referenced by te::qt::af::ChartDisplayDockWidget::selectionChanged().

bool te::da::ObjectIdSet::contains ( ObjectId oid) const

It returns if the object id set contains the given oid.

Parameters
oidThe object id that will be searched.
Returns
True if the object id set contains the given oid. False, otherwise.
Note
The ObjectIdSet will NOT take the ownership of the given pointer.

Definition at line 145 of file ObjectIdSet.cpp.

Referenced by ToHighlight().

void te::da::ObjectIdSet::difference ( const ObjectIdSet rhs)

It performs the difference operation between this ObjectIdSet and the given ObjectIdSet.

Parameters
rhsA valid ObjectIdSet that will be used on difference operation. Do not pass NULL!
Note
The ObjectIdSet will NOT take the ownership of the given pointer.

Definition at line 175 of file ObjectIdSet.cpp.

References m_oids.

std::set< te::da::ObjectId *, te::common::LessCmp< te::da::ObjectId * > >::const_iterator te::da::ObjectIdSet::end ( ) const
te::da::Expression * te::da::ObjectIdSet::getExpression ( const std::string  source = "") const

It returns the expression that can be used to retrieve the data set that contains the all indentified elements.

Returns
The expression that can be used to retrieve the data set that contains the all indentified elements.
Note
The caller will take the ownership of the given pointer.

Definition at line 77 of file ObjectIdSet.cpp.

References te::da::Function::add(), and te::dt::STRING_TYPE.

Referenced by te::da::BuildSelect(), te::map::QueryLayer::getData(), and te::da::DataSourceTransactor::getDataSet().

const std::vector< std::string > & te::da::ObjectIdSet::getPropertyNames ( ) const

It returns the property names used to generated the oids.

Returns
The property names used to generated the oids.

Definition at line 130 of file ObjectIdSet.cpp.

Referenced by te::da::BuildSelect(), te::qt::widgets::DataSetTableModel::getObjectIdSet(), and ToHighlight().

const std::vector< std::size_t > & te::da::ObjectIdSet::getPropertyPos ( ) const

It returns the property positions used to generated the oids.

Returns
The property positions used to generated the oids.

Definition at line 135 of file ObjectIdSet.cpp.

Referenced by IsPrimaryKey().

const std::vector< int > & te::da::ObjectIdSet::getPropertyTypes ( ) const

It returns the property types used to generated the oids.

Returns
The property types used to generated the oids.

Definition at line 140 of file ObjectIdSet.cpp.

void te::da::ObjectIdSet::remove ( ObjectId oid)

Removes the object id from set.

Parameters
oidObject id to be removed.
Note
This WILL NOT take the ownership of oid.

Definition at line 151 of file ObjectIdSet.cpp.

Referenced by te::qt::af::ChartDisplayDockWidget::selectionChanged().

void te::da::ObjectIdSet::symDifference ( const ObjectIdSet rhs)

It performs the symmetric difference operation between this ObjectIdSet and the given ObjectIdSet.

Parameters
rhsA valid ObjectIdSet that will be used on difference operation. Do not pass NULL!
Note
The ObjectIdSet will NOT take the ownership of the given pointer.

Definition at line 200 of file ObjectIdSet.cpp.

References m_oids.

Referenced by te::qt::widgets::Selection::executeSelection().

void te::da::ObjectIdSet::Union ( ObjectIdSet rhs)

It performs the union operation between this ObjectIdSet and the given ObjectIdSet.

Parameters
rhsA valid ObjectIdSet that will be used on union operation. Do not pass NULL!
Note
The ObjectIdSet will take the ownership of the given pointer.
The given pointer will be invalidated at end of union operation.

Definition at line 159 of file ObjectIdSet.cpp.

References m_oids.

Referenced by te::da::SpatialQueryProcessor::getOIDSet().

Member Data Documentation

std::set<ObjectId*, te::common::LessCmp<ObjectId*> > te::da::ObjectIdSet::m_oids
private

The set of unique ids.

Definition at line 199 of file ObjectIdSet.h.

Referenced by difference(), ObjectIdSet(), symDifference(), and Union().

std::vector<std::string> te::da::ObjectIdSet::m_pnames
private

The list of property names used to generate the unique ids.

Definition at line 196 of file ObjectIdSet.h.

std::vector<std::size_t> te::da::ObjectIdSet::m_ppos
private

The list of property positions used to generate the unique ids.

Definition at line 197 of file ObjectIdSet.h.

std::vector<int> te::da::ObjectIdSet::m_ptypes
private

The list of property types used to generate the unique ids.

Definition at line 198 of file ObjectIdSet.h.


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