27 #ifndef FLAGGING_RFCOMMON_H
28 #define FLAGGING_RFCOMMON_H
154 casacore::DataType type2 = casacore::TpNumberOfTypes )
158 casacore::DataType t = parm.
dataType(
id);
159 return t==type || t==type2;
168 return (*func)(
type);
203 inline std::vector<bool>
bitvec_from_ulong(
unsigned long val,
size_t len = std::numeric_limits<unsigned long>::digits ) {
204 std::vector<bool> result(len,
false);
205 unsigned long mask = 1;
206 for(
size_t i=0; i <
std::min((
size_t)result.size( ),(size_t)std::numeric_limits<unsigned long>::digits); ++i ) {
207 result[i] = mask & val ?
true :
false;
214 unsigned long result = 0;
215 unsigned long mask = 1;
216 for(
size_t i=0; i < std::min((size_t)std::numeric_limits<unsigned long>::digits,(size_t)val.size()); ++i ) {
217 result |= (val[i] ? mask : 0);
Bool asBool(const RecordFieldId &) const
The following functions get the value based on field name or number.
virtual const RecordInterface & asRecord(const RecordFieldId &) const =0
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
casacore::uInt RFlagWord
RFAs use bitwise flags.
casacore::Vector< RFlagWord > FlagVector
casacore::uInt fieldSize(const casacore::RecordInterface &parm, const casacore::String &id)
casacore::Short inline function for returning the number of elements in a field (0 for no field...
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
const char RF_CENTERTIME[]
virtual Type type()
Return the type enum.
unsigned long bitvec_to_ulong(const std::vector< bool > &val)
A 2-D Specialization of the Array class.
ostream-like interface to creating log messages.
DataType dataType(const RecordFieldId &) const
casacore::Matrix< RFlagWord > FlagMatrix
const char RF_TIMEDELTA[]
casacore::Bool fieldType(const casacore::RecordInterface &parm, const casacore::String &id, casacore::DataType type, casacore::DataType type2=casacore::TpNumberOfTypes)
short inline function for checking the type of a record field
const char RF_ELEVATION[]
int dprintf(casacore::LogIO &os, const char *format,...)
a debug-printf function, for printf-ing debug messages
const char RF_GLISHINDEX[]
character constants for common agent parameters
std::vector< bool > bitvec_from_ulong(unsigned long val, size_t len=std::numeric_limits< unsigned long >::digits)
bool Bool
Define the standard types used by Casacore.
TableExprNode upcase(const TableExprNode &node)
casacore::String stringUpper(const casacore::String &in)
Basically just upcase(), but in a form suitable for casacore::Array::apply.
const char RF_LOWERLIMIT[]
Bool isDefined(const String &fieldName) const
Test if a field name exists.
casacore::Bool isField(const casacore::RecordInterface &parm, const casacore::String &id, casacore::Bool(*func)(casacore::DataType))
short inline function for checking a field's data type against some function
virtual uInt nfields() const =0
How many fields does this structure have?
casacore::Bool isFieldSet(const casacore::RecordInterface &parm, const casacore::String &id)
casacore::Short inline function for checking if a record field is "set", i.e.
FlaggerEnums: collection of enums for various flagger classes.
const char RF_ROW_DISABLE[]
casacore::Bool isValidRecord(const casacore::RecordInterface &parm, const casacore::String &id)
short inline function for checking that a field is a non-empty record
const char RF_QUACKMODE[]
String: the storage and methods of handling collections of characters.
const char RF_UPPERLIMIT[]
Abstract base class for Record classes.
const char RF_OBSERVATION[]
const char RF_FLAGRANGE[]
const char RF_TIMERANGE[]
Int64 product() const
Returns 0 if nelements() == 0, otherwise it returns the product of its elements.