LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
2 #ifndef AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
3 #define AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
10 #include "boost/variant.hpp"
11 #include "boost/mpl/transform.hpp"
106 visitor(_items[
iter->second]);
115 template <
typename T>
119 template <
typename T>
126 template <
typename T>
133 template <
typename T>
146 explicit SchemaImpl() : _recordSize(0), _lastFlagField(-1), _lastFlagBit(-1), _items() {}
157 template <
typename F>
160 template <
typename T>
177 template <
typename T>
187 template <
typename T>
188 Key<T> addFieldImpl(
int elementSize,
int elementCount,
Field<T> const&
field,
bool doReplace);
203 #endif // !AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
int getFlagFieldCount() const
The number of Flag fields.
ItemContainer const & getItems() const
Return the vector of SchemaItem variants.
std::map< std::string, int > NameMap
A map from field names to position in the vector, so we can do name lookups.
Reports attempts to access elements using an invalid key.
A private implementation class to hide the messy details of Schema.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
std::map< int, int > OffsetMap
A map from standard field offsets to position in the vector, so we can do field lookups.
void operator()(ItemVariant const &v) const
Invoke the visitation.
std::map< std::pair< int, int >, int > FlagMap
A map from Flag field offset/bit pairs to position in the vector, so we can do Flag field lookups.
int getNonFlagFieldCount() const
The number of non-Flag fields.
VisitorWrapper(T &&func)
Construct the wrapper.
std::vector< ItemVariant > ItemContainer
A std::vector whose elements can be any of the allowed SchemaItem types.
int getFieldCount() const
The total number of fields.
SchemaItem(Key< T > const &key_, Field< T > const &field_)
boost::make_variant_over< ItemTypes >::type ItemVariant
A Boost.Variant type that can hold any one of the allowed SchemaItem types.
A simple pair-like struct for mapping a Field (name and description) with a Key (used for actual data...
A class used as a handle to a particular field in a table.
SchemaItem< T > find(std::string const &name) const
Find an item by name (used to implement Schema::find).
Tag types used to declare specialized field types.
int contains(SchemaItem< T > const &item, int flags) const
void operator()(SchemaItem< T > const &x) const
Call the wrapped function.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
A description of a field in a table.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a field to the schema (used to implement Schema::addField).
SchemaImpl()
Default constructor.
A functor-wrapper used in the implementation of Schema::forEach.
std::set< std::string > getNames(bool topOnly) const
Return a set of field names (used to implement Schema::getNames).
Key specialization for Flag.
void findAndApply(std::string const &name, F &&func) const
Find an item by name and run the given functor on it.
void replaceField(Key< T > const &key, Field< T > const &field)
Replace the Field in an existing SchemaItem without changing the Key.
boost::mpl::transform< FieldTypes, MakeItem >::type ItemTypes
An MPL sequence of all the allowed SchemaItem templates.
int getRecordSize() const
The size of a record in bytes.