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 size_t setSize = dset->
size();
159 cleanPreproccessKeys();
161 if(m_logicalRows.empty())
162 m_logicalRows.resize(setSize);
166 for(
size_t i=0; i<setSize; i++)
170 for(
size_t aux=0; aux<pkeys.size(); aux++)
172 if(dset->
isNull(pkeys[aux]) ==
false)
176 m_PkeysRows[pkey] = i;
178 m_logicalRows[i] = i;
186 return m_logicalRows.empty() ? visualRow : m_logicalRows[visualRow];
196 if(m_logicalRows.empty() || m_PkeysRows.empty() || oids == 0)
199 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
203 std::map<size_t, size_t> new_pos;
205 for(it = oids->
begin(); it != oids->
end(); ++it)
207 size_t dsPos = map2Row(*it);
208 new_pos[dsPos] = m_logicalRows[dsPos];
211 std::map<size_t, size_t>::iterator mit;
215 for(mit = new_pos.begin(); mit != new_pos.end(); ++mit)
217 m_logicalRows.erase(m_logicalRows.begin()+mit->first);
218 m_logicalRows.insert(m_logicalRows.begin()+pos, mit->second);
225 boost::ptr_vector<te::dt::AbstractData> data = oid->
getValue();
226 boost::ptr_vector<te::dt::AbstractData>::iterator it_d;
230 for(it_d=data.begin(); it_d!=data.end(); ++it_d)
231 pkey += it_d->toString() +
";";
233 std::map<std::string, size_t>::iterator it = m_PkeysRows.find(pkey);
235 if(it == m_PkeysRows.end())
236 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.