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.
Column-wise view into a sequence of records that have been allocated contiguously.
A packed representation of a collection of Flag field columns.
static BaseColumnView make(boost::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
table::Key< std::string > name
BitsColumn getBits(std::vector< Key< Flag > > const &keys) const
Return an integer array with the given Flag fields repacked into individual bits. ...
ndarray::ArrayRef< T, 1 > const operator[](Key< T > const &key) const
Return a 1-d array corresponding to a scalar field (or subfield).
BitsColumn getAllBits() const
Return an integer array with all Flag fields repacked into individual bits.
IntT getBit(Key< Flag > const &key) const
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 ...
boost::shared_ptr< Impl > _impl
boost::intrusive_ptr< Manager > Ptr
ndarray::Array< IntT, 1, 1 > _array
ColumnViewT(BaseColumnView const &base)
A description of a field in a table.
Tag types used to declare specialized field types.
std::vector< SchemaItem< Flag > > _items
ndarray::Array< IntT, 1, 1 > getArray() const
#define LSST_EXCEPT(type,...)
IntT getMask(Key< Flag > const &key) const
Schema getSchema() const
Return the table's schema.
A class used as a handle to a particular field in a table.
Key specialization for Flag.
int getRecordSize() const
Return the raw size of a record in bytes.
static ColumnViewT make(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
boost::shared_ptr< BaseTable > getTable() const
Return the table that owns the records.
Schema getSchema() const
Return the schema that defines the fields.
BaseColumnView(boost::shared_ptr< BaseTable > const &table, int recordCount, void *buf, ndarray::Manager::Ptr const &manager)
std::vector< SchemaItem< Flag > > const & getSchemaItems() const
boost::shared_ptr< Table > getTable() const
Return the table that owns the records.
IntT getMask(std::string const &name) const
Base class for all tables.