2 #ifndef AFW_TABLE_BaseColumnView_h_INCLUDED
3 #define AFW_TABLE_BaseColumnView_h_INCLUDED
9 namespace lsst {
namespace afw {
namespace table {
64 std::vector< SchemaItem<Flag> >
_items;
110 ndarray::Array< Field<Flag>::Element
const,1> >::type
139 template <
typename InputIterator>
149 template <
typename InputIterator>
157 PTR(
BaseTable)
const & table,
int recordCount,
void * buf, ndarray::Manager::Ptr
const & manager
166 std::shared_ptr<Impl>
_impl;
169 template <
typename RecordT>
174 typedef typename RecordT::Table
Table;
180 template <
typename InputIterator>
191 template <
typename InputIterator>
198 std::size_t recordCount = 1;
199 void * buf = first->_data;
200 ndarray::Manager::Ptr manager = first->_manager;
201 char * expected =
reinterpret_cast<char*
>(buf) + recordSize;
202 for (++first; first != last; ++first, ++recordCount, expected += recordSize) {
203 if (first->_data != expected || first->_manager != manager) {
205 lsst::pex::exceptions::RuntimeError,
206 "Record data is not contiguous in memory."
213 template <
typename InputIterator>
215 PTR(
BaseTable)
const & table, InputIterator first, InputIterator last
217 if (first == last)
return true;
220 std::size_t recordCount = 1;
221 void * buf = first->_data;
222 ndarray::Manager::Ptr manager = first->_manager;
223 char * expected =
reinterpret_cast<char*
>(buf) + recordSize;
224 for (++first; first != last; ++first, ++recordCount, expected += recordSize) {
225 if (first->_data != expected || first->_manager != manager) {
234 #endif // !AFW_TABLE_BaseColumnView_h_INCLUDED
Defines the fields and offsets for a table.
ndarray::Array< IntT, 1, 1 > _array
Schema getSchema() const
Return the schema that defines the fields.
BitsColumn getAllBits() const
Return an integer array with all Flag fields repacked into individual bits.
Column-wise view into a sequence of records that have been allocated contiguously.
A packed representation of a collection of Flag field columns.
table::Key< std::string > name
afw::table::Schema schema
IntT getMask(Key< Flag > const &key) const
ColumnViewT(BaseColumnView const &base)
boost::shared_ptr< Table > getTable() const
Return the table that owns the records.
static ColumnViewT make(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
BaseColumnView(boost::shared_ptr< BaseTable > const &table, int recordCount, void *buf, ndarray::Manager::Ptr const &manager)
BitsColumn getBits(std::vector< Key< Flag > > const &keys) const
Return an integer array with the given Flag fields repacked into individual bits. ...
std::shared_ptr< Impl > _impl
int getRecordSize() const
Return the raw size of a record in bytes.
A description of a field in a table.
Tag types used to declare specialized field types.
static BaseColumnView make(boost::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
std::vector< SchemaItem< Flag > > const & getSchemaItems() const
ndarray::ArrayRef< T, 1 > const operator[](Key< T > const &key) const
Return a 1-d array corresponding to a scalar field (or subfield).
boost::shared_ptr< BaseTable > getTable() const
Return the table that owns the records.
IntT getBit(Key< Flag > const &key) const
#define LSST_EXCEPT(type,...)
A class used as a handle to a particular field in a table.
Key specialization for Flag.
Schema getSchema() const
Return the table's schema.
static bool isRangeContiguous(boost::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 ...
std::vector< SchemaItem< Flag > > _items
ndarray::Array< IntT, 1, 1 > getArray() const
Base class for all tables.
IntT getMask(std::string const &name) const