File BaseTable.h¶
-
namespace
lsst
Class for a simple mapping implementing a generic AstrometryTransform.
Remove all non-astronomical counts from the Chunk Exposure’s pixels.
Forward declarations for lsst::utils::Cache
For details on the Cache class, see the Cache.h file.
It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.
A base class for image defects
Numeric constants used by the Integrate.h integrator routines.
Compute Image Statistics
- Note
Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.
- Note
The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.
-
namespace
afw
-
namespace
table
-
class
BaseTable
: public std::enable_shared_from_this<BaseTable> - #include <BaseTable.h>
Base class for all tables.
Tables have two largely distinct purposes:
They serve as factories for records, allocating their field data in blocks.
They carry additional information (such as the schema) that should be shared by multiple records.
It’s mostly a matter of convenience that we use the same class to serve both needs.
Tables do not actually maintain a list of all the records they have allocated - but those records hold a pointer back to the table. This allows the work of holding and iterating over records to be delegated to templated container classes (such as CatalogT) while allowing tables to be polymorphic, non-template classes. In some sense, then, it may make more sense to think of a table as a combination factory and “container header”.
Tables are always created in shared_ptrs (a requirement of enable_shared_from_this). BaseTable provides a make static member function to create a new table, and most derived table classes should do the same.
Each table class should be associated with a particular record class (1-to-1). Each table instance may be associated with many record instances.
Subclassed by lsst::afw::detection::PeakTable, lsst::afw::table::ExposureTable, lsst::afw::table::SimpleTable
Public Types
-
typedef BaseRecord
Record
The associated record class.
-
typedef BaseColumnView
ColumnView
The associated ColumnView class.
Public Functions
-
std::shared_ptr<daf::base::PropertyList>
getMetadata
() const Return the flexible metadata associated with the table. May be null.
Set the flexible metadata associated with the table. May be null.
-
std::shared_ptr<daf::base::PropertyList>
popMetadata
() Return the metadata and set the internal metadata to a null pointer.
-
std::shared_ptr<BaseTable>
clone
() const Return a polymorphic deep copy of the table.
Derived classes should reimplement by static-casting the output of _clone to a pointer-to-derived to simulate covariant return types.
Cloning a table does not clone its associated records; the new table produced by clone() does not have any associated records.
-
std::shared_ptr<BaseRecord>
makeRecord
() Default-construct an associated record.
Derived classes should reimplement by static-casting the output of _makeRecord to the appropriate BaseRecord subclass to simulate covariant return types.
-
std::shared_ptr<BaseRecord>
copyRecord
(BaseRecord const &input) Deep-copy a record, requiring that it have the same schema as this table.
Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.
Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.
Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.
This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.
-
std::shared_ptr<BaseRecord>
copyRecord
(BaseRecord const &input, SchemaMapper const &mapper) Deep-copy a record, using a mapper to relate two schemas.
Deep-copy a record, requiring that it have the same schema as this table.
Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.
Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.
Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.
This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.
-
Schema
getSchema
() const Return the table’s schema.
-
void
preallocate
(std::size_t nRecords) Allocate contiguous space for new records in advance.
If a contiguous memory block for at least n additional records has already been allocated, this is a no-op. If not, a new block will be allocated, and any remaining space on the old block will go to waste; this ensures the new records will be allocated contiguously. Note that “wasted” memory is not leaked; it will be deallocated along with any records created from that block when those records go out of scope.
Note that unlike std::vector::reserve, this does not factor in existing records in any way; nRecords refers to a number of new records to reserve space for.
-
std::size_t
getBufferSize
() const Return the number of additional records space has been already been allocated for.
Unlike std::vector::capacity, this does not factor in existing records in any way.
-
virtual
~BaseTable
()
Public Static Functions
-
static std::shared_ptr<BaseTable>
make
(Schema const &schema) Construct a new table.
Because BaseTable is an abstract class, this actually returns a hidden trivial subclass (which is associated with a hidden trivial subclass of BaseRecord).
Hiding concrete table and record classes in anonymous namespaces is not required, but it makes it easier to ensure instances are always created within shared_ptrs, and it eliminates some multilateral friending that would otherwise be necessary. In some cases it may also serve as a form of pimpl, keeping class implementation details out of header files.
Public Static Attributes
-
int
nRecordsPerBlock
Number of records in each memory block.
Protected Functions
Helper function that must be used by all _makeRecord overrides to actually construct records.
Use of this function is enforced by the fact that Record::ConstructionToken can only be created by BaseTable, and is only ever constructed inside this method.
This function expects Record subclasses to have a constructor signature of the form
Record(ConstructionToken const &, detail::RecordData &&, Args && ...);
-
virtual void
handleAliasChange
(std::string const &alias)
-
virtual std::shared_ptr<BaseTable>
_clone
() const Clone implementation with noncovariant return types.
-
virtual std::shared_ptr<BaseRecord>
_makeRecord
() Default-construct an associated record (protected implementation).
-
BaseTable
(Schema const &schema) Construct from a schema.
-
BaseTable
(BaseTable const &other) Copy construct.
-
BaseTable
(BaseTable &&other)
Private Members
-
ndarray::Manager::Ptr
_manager
¶
Friends
-
friend
lsst::afw::table::BaseRecord
-
friend
lsst::afw::table::io::FitsWriter
-
friend
lsst::afw::table::AliasMap
-
namespace
detail
-
struct
RecordData
¶ - #include <BaseTable.h>
Helper struct that contains the information passed from BaseTable to BaseRecord at construction.
This can’t be a nested class of either of those two classes for dependency reasons, but it should nevertheless be considered opaque by all derived Table and Record classes.
-
struct
-
class
-
namespace