27 #include "../../common/STLUtils.h"
28 #include "../../common/Translator.h"
29 #include "../../datatype/Enums.h"
30 #include "../query/And.h"
31 #include "../query/In.h"
32 #include "../query/Literal.h"
33 #include "../query/LiteralString.h"
34 #include "../Exception.h"
46 : m_pnames(rhs.m_pnames),
48 m_ptypes(rhs.m_ptypes)
52 std::set<ObjectId*, te::common::LessCmp<ObjectId*> >::const_iterator it;
53 for(it = rhs.
m_oids.begin(); it != rhs.
m_oids.end(); ++it)
54 m_oids.insert((*it)->clone());
65 assert(!name.empty());
66 m_pnames.push_back(name);
67 m_ppos.push_back(pos);
68 m_ptypes.push_back(type);
79 assert(m_pnames.size() == m_ptypes.size());
85 for(std::size_t i = 0; i < m_pnames.size(); ++i)
87 In* in =
new In(m_pnames[i]);
90 std::set<ObjectId*, te::common::LessCmp<ObjectId*> >::const_iterator it;
91 for(it = m_oids.begin(); it != m_oids.end(); ++it)
93 const boost::ptr_vector<te::dt::AbstractData>& data = (*it)->getValue();
123 return m_oids.size();
144 return m_oids.find(oid) != m_oids.end();
149 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::iterator it = m_oids.find(oid);
151 if(it != m_oids.end())
159 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >& newOids = rhs->
m_oids;
161 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::iterator it;
162 for(it = newOids.begin(); it != newOids.end(); ++it)
163 m_oids.find(*it) == m_oids.end() ? add(*it) :
delete *it;
178 const std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >& oidsToRemove = rhs->
m_oids;
180 if(oidsToRemove.empty())
183 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
184 for(it = oidsToRemove.begin(); it != oidsToRemove.end(); ++it)
186 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::iterator itSearch = m_oids.find(*it);
188 if(itSearch == m_oids.end())
192 m_oids.erase(itSearch);
200 const std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >& oidsToInsert = rhs->
m_oids;
202 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
203 for(it = oidsToInsert.begin(); it != oidsToInsert.end(); ++it)
205 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::iterator itSearch = m_oids.find(*it);
207 if(itSearch != m_oids.end())
210 m_oids.erase(itSearch);
213 m_oids.insert((*it)->clone());
219 return m_oids.begin();
const std::vector< std::size_t > & getPropertyPos() const
It returns the property positions used to generated the oids.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > > m_oids
The set of unique ids.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
This class models a string Literal value.
void clear()
It clears this object id set.
Expression * getExpression() const
It returns the expression that can be used to retrieve the data set that contains the all indentified...
void remove(ObjectId *oid)
Removes the object id from set.
This class represents an unique id for a data set element.
const std::vector< std::string > & getPropertyNames() const
It returns the property names used to generated the oids.
std::size_t size() const
It returns the object id set size.
void symDifference(const ObjectIdSet *rhs)
It performs the symmetric difference operation between this ObjectIdSet and the given ObjectIdSet...
void difference(const ObjectIdSet *rhs)
It performs the difference operation between this ObjectIdSet and the given ObjectIdSet.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.
void Union(ObjectIdSet *rhs)
It performs the union operation between this ObjectIdSet and the given ObjectIdSet.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator end() const
Returns an iterator for the object ids in container.
This class represents an unique id for a data set element.
ObjectIdSet()
Constructor.
This class models a literal value.
This is an abstract class that models a query expression.
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.
bool contains(ObjectId *oid) const
It returns if the object id set contains the given oid.
~ObjectIdSet()
Destructor.
const std::vector< int > & getPropertyTypes() const
It returns the property types used to generated the oids.
ObjectIdSet * clone() const
void add(Expression *arg)
It adds the argument to the function list of arguments.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
void add(ObjectId *oid)
It adds an object id to this object id set.
A class that represents the IN operator.