2 #ifndef AFW_TABLE_BaseTable_h_INCLUDED
3 #define AFW_TABLE_BaseTable_h_INCLUDED
7 #include "lsst/daf/base/Citizen.h"
8 #include "ndarray/Manager.h"
44 class BaseTable :
public std::enable_shared_from_this<BaseTable>,
public daf::base::Citizen {
62 std::shared_ptr<daf::base::PropertyList>
getMetadata()
const {
return _metadata; }
65 void setMetadata(std::shared_ptr<daf::base::PropertyList>
const& metadata) { _metadata = metadata; }
69 std::shared_ptr<daf::base::PropertyList> tmp;
161 template <
typename Derived>
163 return std::static_pointer_cast<Derived>(shared_from_this());
167 template <
typename Derived>
168 std::shared_ptr<Derived const>
getSelf()
const {
169 return std::static_pointer_cast<Derived
const>(shared_from_this());
175 virtual std::shared_ptr<BaseTable>
_clone()
const;
185 : daf::base::Citizen(other), _schema(other._schema), _metadata(other._metadata) {
214 virtual std::shared_ptr<io::FitsWriter> makeFitsWriter(
fits::Fits* fitsfile,
int flags)
const;
218 ndarray::Manager::Ptr _manager;
219 std::shared_ptr<daf::base::PropertyList>
_metadata;
225 #endif // !AFW_TABLE_BaseTable_h_INCLUDED
Defines the fields and offsets for a table.
BaseRecord Record
The associated record class.
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
std::shared_ptr< BaseRecord > makeRecord()
Default-construct an associated record.
std::shared_ptr< Derived const > getSelf() const
Convenience function for static-casting shared_from_this for use by derived classes.
A custom container class for records, based on std::vector.
A mapping between the keys of two Schemas, used to copy data between them.
BaseColumnView ColumnView
The associated ColumnView class.
Mapping class that holds aliases for a Schema.
BaseTable(BaseTable const &other)
Copy construct.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
std::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
void preallocate(std::size_t nRecords)
Allocate contiguous space for new records in advance.
void setMetadata(std::shared_ptr< daf::base::PropertyList > const &metadata)
Set the flexible metadata associated with the table. May be null.
static int nRecordsPerBlock
Number of records in each memory block.
CatalogT< Record const > ConstCatalog
Template of CatalogT used to hold const records of the associated type.
CatalogT< Record > Catalog
Template of CatalogT used to hold records of the associated type.
BaseTable(Schema const &schema)
Construct from a schema.
std::shared_ptr< Derived > getSelf()
Convenience function for static-casting shared_from_this for use by derived classes.
Base class for all records.
static std::shared_ptr< BaseTable > make(Schema const &schema)
Construct a new table.
Schema getSchema() const
Return the table's schema.
std::shared_ptr< BaseTable > clone() const
Return a polymorphic deep copy of the table.
daf::base::PropertySet & _metadata
std::shared_ptr< daf::base::PropertyList > popMetadata()
Return the metadata and set the internal metadata to a null pointer.
std::shared_ptr< daf::base::PropertyList > getMetadata() const
Return the flexible metadata associated with the table. May be null.
virtual std::shared_ptr< BaseTable > _clone() const
Clone implementation with noncovariant return types.
std::size_t getBufferSize() const
Return the number of additional records space has been already been allocated for.
Base class for all tables.
virtual void handleAliasChange(std::string const &alias)
afw::table::Schema schema
lsst::daf::base::PropertyList PropertyList
virtual std::shared_ptr< BaseRecord > _makeRecord()
Default-construct an associated record (protected implementation).