LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
43 for (
int i = 1; i <
result._size; ++i) {
54 if (size == 0)
return result;
59 for (
int i = 1; i <
result._size; ++i) {
67 if (
keys.empty())
return;
68 _begin =
keys.front();
69 for (
int i = 1; i < _size; ++i) {
70 if (
keys[i].getOffset() - _begin.getOffset() !=
static_cast<int>(i *
sizeof(T))) {
72 "Keys passed to ArrayKey constructor are not contiguous");
89 if (current.
getOffset() - _begin.getOffset() !=
static_cast<int>(
_size *
sizeof(T))) {
91 "Keys discovered in Schema are not contiguous");
101 template <typename T>
103 template <typename T>
105 template <typename T>
108 template <typename T>
110 return ndarray::external(record.getElement(_begin), ndarray::makeVector(
_size), ndarray::ROW_MAJOR,
111 record.getManager());
114 template <
typename T>
118 "Size of input array (%d) does not match size of array field (%d)");
119 std::copy(value.begin(), value.end(), record.getElement(_begin));
122 template <
typename T>
124 return ndarray::external(record.
getElement(_begin), ndarray::makeVector(
_size), ndarray::ROW_MAJOR,
128 template <
typename T>
130 return ndarray::external(record.
getElement(_begin), ndarray::makeVector(
_size), ndarray::ROW_MAJOR,
134 template <
typename T>
136 if (i < 0 || i >=
_size) {
139 return detail::Access::makeKey<T>(_begin.getOffset() + i *
sizeof(T));
142 template <
typename T>
144 if (begin < 0 || end >
_size) {
146 "ArrayKey slice range does not fit within valid range");
#define LSST_THROW_IF_NE(N1, N2, EXC_CLASS, MSG)
Check whether the given values are equal, and throw an LSST Exception if they are not.
afw::table::Key< afw::table::Array< Scalar > > ArrayKey
Reports attempts to access elements using an invalid key.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Defines the fields and offsets for a table.
ndarray::Manager::Ptr getManager() const
Field< T >::Element * getElement(Key< T > const &key)
Return a pointer to the underlying elements of a field (non-const).
A FunctorKey used to get or set a ndarray::Array from a sequence of scalar Keys.
table::Key< table::Array< int > > _size
ArrayKey() noexcept
Default constructor; instance will not be usable unless subsequently assigned to.
Reports attempts to exceed implementation-defined length limits for some classes.
ItemVariant const * other
Base class for all records.
A class used as a handle to a particular field in a table.
Tag types used to declare specialized field types.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Reports invalid arguments.
A proxy type for name lookups in a Schema.
static ArrayKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit, std::vector< T > const &docData)
Add an array of fields to a Schema, and return an ArrayKey that points to them.
daf::base::PropertySet * set
int getOffset() const noexcept
Return the offset (in bytes) of this field within a record.