2#ifndef AFW_TABLE_BaseColumnView_h_INCLUDED
3#define AFW_TABLE_BaseColumnView_h_INCLUDED
46 ndarray::Array<SizeT, 1, 1>
getArray()
const {
return _array; }
61 ndarray::Array<SizeT, 1, 1> _array;
106 ndarray::result_of::vectorize<detail::FlagExtractor, ndarray::Array<Field<Flag>::Element
const, 1> >
::type
138 template <
typename InputIterator>
149 template <
typename InputIterator>
162 ndarray::Manager::Ptr
const& manager);
172template <
typename RecordT>
176 using Table =
typename RecordT::Table;
184 template <
typename InputIterator>
199template <
typename InputIterator>
201 InputIterator last) {
203 return BaseColumnView(table, 0,
nullptr, ndarray::Manager::Ptr());
208 void* buf =
first->_data;
209 ndarray::Manager::Ptr manager =
first->_manager;
210 char* expected =
reinterpret_cast<char*
>(buf) + recordSize;
211 for (++
first;
first != last; ++
first, ++recordCount, expected += recordSize) {
212 if (
first->_data != expected ||
first->_manager != manager) {
214 "Record data is not contiguous in memory.");
220template <
typename InputIterator>
222 InputIterator last) {
223 if (
first == last)
return true;
227 void* buf =
first->_data;
228 ndarray::Manager::Ptr manager =
first->_manager;
229 char* expected =
reinterpret_cast<char*
>(buf) + recordSize;
230 for (++
first;
first != last; ++
first, ++recordCount, expected += recordSize) {
231 if (
first->_data != expected ||
first->_manager != manager) {
table::Key< std::string > name
#define LSST_EXCEPT(type,...)
Tag types used to declare specialized field types.
Column-wise view into a sequence of records that have been allocated contiguously.
BaseColumnView & operator=(BaseColumnView const &)
BitsColumn getBits(std::vector< Key< Flag > > const &keys) const
Return an integer array with the given Flag fields repacked into individual bits.
Schema getSchema() const
Return the schema that defines the fields.
BaseColumnView & operator=(BaseColumnView &&)
BaseColumnView(BaseColumnView const &)
BaseColumnView(BaseColumnView &&)
static BaseColumnView make(std::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
BitsColumn getAllBits() const
Return an integer array with all Flag fields repacked into individual bits.
ndarray::Array< double, 1 > const get_radians_array(Key< Angle > const &key) const
Return an array column as a double array in radians.
std::shared_ptr< BaseTable > getTable() const
Return the table that owns the records.
static bool isRangeContiguous(std::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Return true if the given record iterator range is continuous and the records all belong to the given ...
ndarray::ArrayRef< T, 1 > const operator[](Key< T > const &key) const
Return a 1-d array corresponding to a scalar field (or subfield).
Base class for all tables.
A packed representation of a collection of Flag field columns.
std::vector< SchemaItem< Flag > > const & getSchemaItems() const
SizeT getMask(Key< Flag > const &key) const
SizeT getBit(Key< Flag > const &key) const
ndarray::Array< SizeT, 1, 1 > getArray() const
SizeT getMask(std::string const &name) const
typename RecordT::Table Table
std::shared_ptr< Table > getTable() const
Return the table that owns the records.
ColumnViewT(ColumnViewT const &)=default
ColumnViewT(ColumnViewT &&)=default
ColumnViewT(BaseColumnView const &base)
ColumnViewT & operator=(ColumnViewT const &)=default
ColumnViewT & operator=(ColumnViewT &&)=default
static ColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
A class used as a handle to a particular field in a table.
Defines the fields and offsets for a table.
typename FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).