2 #ifndef AFW_TABLE_BaseColumnView_h_INCLUDED
3 #define AFW_TABLE_BaseColumnView_h_INCLUDED
7 namespace lsst {
namespace afw {
namespace table {
41 typedef boost::int64_t
IntT;
62 std::vector< SchemaItem<Flag> >
_items;
137 template <
typename InputIterator>
147 template <
typename InputIterator>
164 boost::shared_ptr<Impl>
_impl;
167 template <
typename RecordT>
172 typedef typename RecordT::Table
Table;
178 template <
typename InputIterator>
189 template <
typename InputIterator>
196 std::size_t recordCount = 1;
197 void * buf = first->_data;
199 char * expected =
reinterpret_cast<char*
>(buf) + recordSize;
200 for (++first; first != last; ++first, ++recordCount, expected += recordSize) {
201 if (first->_data != expected || first->_manager != manager) {
203 lsst::pex::exceptions::RuntimeError,
204 "Record data is not contiguous in memory."
211 template <
typename InputIterator>
213 PTR(
BaseTable)
const & table, InputIterator first, InputIterator last
215 if (first == last)
return true;
218 std::size_t recordCount = 1;
219 void * buf = first->_data;
221 char * expected =
reinterpret_cast<char*
>(buf) + recordSize;
222 for (++first; first != last; ++first, ++recordCount, expected += recordSize) {
223 if (first->_data != expected || first->_manager != manager) {
232 #endif // !AFW_TABLE_BaseColumnView_h_INCLUDED
A proxy class for Array with deep assignment operators.
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
boost::shared_ptr< Impl > _impl
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. ...
boost::intrusive_ptr< Manager > Ptr
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