26#ifndef TABLES_EXPRNODESETOPT_H
27#define TABLES_EXPRNODESETOPT_H
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNodeRep.h>
32#include <unordered_map>
123 template <
typename T>
131 void show (ostream& os,
uInt indent)
const override;
170 const std::vector<T>& starts,
171 const std::vector<T>& ends);
176 void show (ostream& os,
uInt indent)
const override;
187 const std::vector<T>& start,
188 const std::vector<T>& end,
189 const std::vector<Bool>& leftC,
190 const std::vector<Bool>& rightC);
221 template <
typename T>
226 const std::vector<T>& starts,
227 const std::vector<T>& ends,
228 const std::vector<Bool>& leftC,
229 const std::vector<Bool>& rightC);
231 void show (ostream& os,
uInt indent)
const override;
265 template <
typename T,
typename LeftComp,
typename RightComp>
270 const std::vector<T>& starts,
271 const std::vector<T>& ends,
272 LeftComp leftCmp, RightComp rightCmp,
275 void show (ostream& os,
uInt indent)
const override;
String: the storage and methods of handling collections of characters.
Abstract base class for a node in a table column expression tree.
virtual Bool contains(const TableExprId &id, Bool value)
Does a set or array contain the value?
TableExprNodeRep(NodeDataType, ValueType, OperType, ArgType, ExprType, Int ndim, const IPosition &shape)
Construct a node.
TableExprNodeSetOptBase(const TableExprNodeRep &orig)
Bool contains(const TableExprId &id, String value) override
Bool contains(const TableExprId &id, Double value) override
MArray< Bool > contains(const TableExprId &id, const MArray< Double > &value) override
MArray< Bool > contains(const TableExprId &id, const MArray< Int64 > &value) override
Tell for each array value if the set contains that value.
MArray< Bool > contains(const TableExprId &id, const MArray< String > &value) override
Bool contains(const TableExprId &id, Int64 value) override
Does the set contain the given value?
virtual Int64 find(String value) const
virtual Int64 find(Double value) const
virtual Int64 find(Int64 value) const
Tell which key matches a value.
static TENShPtr createOptSet(const TableExprNodeSet &set, const std::vector< T > &start, const std::vector< T > &end, const std::vector< Bool > &leftC, const std::vector< Bool > &rightC)
Create the appropriate optimized OptContSet object.
static TENShPtr transform(const TableExprNodeSet &set, Bool combine=True)
Transform a set into an optimized one by ordering the intervals and optionally combining adjacent int...
std::vector< T > itsStarts
TableExprNodeSetOptContSetBase(const TableExprNodeSet &orig, const std::vector< T > &starts, const std::vector< T > &ends)
Construct from the original set and the start and end values of the intervals.
size_t size() const
Get the size (nr of intervals).
void show(ostream &os, uInt indent) const override
Show the node.
TableExprNodeSetOptContSetMixOC(const TableExprNodeSet &orig, const std::vector< T > &starts, const std::vector< T > &ends, const std::vector< Bool > &leftC, const std::vector< Bool > &rightC)
std::vector< Bool > itsLeftC
Int64 find(T value) const override
Tell which interval contains a value.
void show(ostream &os, uInt indent) const override
Show the node.
std::vector< Bool > itsRightC
void show(ostream &os, uInt indent) const override
Show the node.
TableExprNodeSetOptContSet(const TableExprNodeSet &orig, const std::vector< T > &starts, const std::vector< T > &ends, LeftComp leftCmp, RightComp rightCmp, const String &cmpType)
Int64 find(T value) const override
Tell which interval contains a value.
std::unordered_map< T, Int64 > itsMap
Int64 find(T value) const override
Where does a value occur in the set?
void show(ostream &os, uInt indent) const override
Show the node.
TableExprNodeSetOptUSet(const TableExprNodeRep &orig, const Array< T > &)
Construct an empty set.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
std::shared_ptr< TableExprNodeRep > TENShPtr
bool Bool
Define the standard types used by Casacore.
NewDelAllocator< T > NewDelAllocator< T >::value