22 #include "../../../common/STLUtils.h"
23 #include "../../../common/Translator.h"
24 #include "../../../dataaccess/dataset/DataSet.h"
25 #include "../../../dataaccess/dataset/ObjectId.h"
26 #include "../../../dataaccess/dataset/ObjectIdSet.h"
27 #include "../../../datatype/SimpleData.h"
28 #include "../../../dataaccess/utils/Utils.h"
29 #include "../Exception.h"
30 #include "../Config.h"
44 int aux = lhs.compare(rhs);
56 if(lhs.getValue() > rhs.getValue())
58 else if(lhs.getValue() < rhs.getValue())
105 std::vector<std::string> res;
106 std::vector<size_t>::const_iterator it;
108 for(it=colsPositions.begin(); it!=colsPositions.end(); ++it)
117 std::vector<T>().swap(vec);
122 for(
size_t i=pos; i<posVec.size(); i++)
126 for(
size_t i=0; i<posVec.size(); i++)
130 throw te::qt::widgets::Exception(
TE_TR(
"Position not found."));
139 cleanPreproccessKeys();
144 for(
size_t i=0; i<m_logicalRows.size(); i++)
145 m_logicalRows[i] = i;
150 cleanPreproccessKeys();
157 if(!m_PkeysRows.empty())
160 size_t setSize = dset->
size();
162 cleanPreproccessKeys();
164 if(m_logicalRows.empty())
165 m_logicalRows.resize(setSize);
169 for(
size_t i=0; i<setSize; i++)
173 for(
size_t aux=0; aux<pkeys.size(); aux++)
175 if(dset->
isNull(pkeys[aux]) ==
false)
179 m_PkeysRows[pkey] = i;
181 m_logicalRows[i] = i;
189 return m_logicalRows.empty() ? visualRow : m_logicalRows[visualRow];
199 if(m_logicalRows.empty() || m_PkeysRows.empty() || oids == 0)
202 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
206 std::map<size_t, size_t> new_pos;
208 for(it = oids->
begin(); it != oids->
end(); ++it)
210 size_t dsPos = map2Row(*it);
211 new_pos[dsPos] = m_logicalRows[dsPos];
214 std::map<size_t, size_t>::iterator mit;
218 for(mit = new_pos.begin(); mit != new_pos.end(); ++mit)
220 m_logicalRows.erase(m_logicalRows.begin()+mit->first);
221 m_logicalRows.insert(m_logicalRows.begin()+pos, mit->second);
228 boost::ptr_vector<te::dt::AbstractData> data = oid->
getValue();
229 boost::ptr_vector<te::dt::AbstractData>::iterator it_d;
233 for(it_d=data.begin(); it_d!=data.end(); ++it_d)
234 pkey += it_d->toString() +
";";
236 std::map<std::string, size_t>::iterator it = m_PkeysRows.find(pkey);
238 if(it == m_PkeysRows.end())
239 throw Exception(
TE_TR(
"Fail to get position of Object id"));
virtual int getTypeCode() const =0
It returns the data type code associated to the data value.
const boost::ptr_vector< te::dt::AbstractData > & getValue() const
It gets the properties values used to uniquely identify a data set element.
#define TE_TR(message)
It marks a string in order to get translated.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
This class represents an unique id for a data set element.
virtual std::size_t size() const =0
It returns the collection size, if it is known.
virtual std::string getAsString(std::size_t i, int precision=0) const
Method for retrieving a data value as a string plain representation.
A base class for values that can be retrieved from the data access module.
A dataset is the unit of information manipulated by the data access module of TerraLib.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator end() const
Returns an iterator for the object ids in container.
A template for atomic data types (integers, floats, strings and others).
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.
virtual bool moveFirst()=0
It moves the internal pointer to the first item in the collection.