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>
124 void show(ostream& os,
uInt indent)
const override;
161 const std::vector<T>& starts,
const std::vector<T>& ends);
165 void show(ostream& os,
uInt indent)
const override;
175 const std::vector<T>&
end,
const std::vector<Bool>& leftC,
176 const std::vector<Bool>& rightC);
211 const std::vector<T>& ends,
const std::vector<Bool>& leftC,
212 const std::vector<Bool>& rightC);
214 void show(ostream& os,
uInt indent)
const override;
249template <
typename T,
typename LeftComp,
typename RightComp>
253 const std::vector<T>& ends, LeftComp leftCmp, RightComp rightCmp,
256 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.
Int64 find(T value) const override
Where does a value occur in the set?
std::unordered_map< T, Int64 > itsMap
void show(ostream &os, uInt indent) const override
Show the node.
TableExprNodeSetOptUSet(const TableExprNodeRep &orig, const Array< T > &)
Construct an empty set.
For temporary backward namespace compatibility, use casa as alias for casacore.
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