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"
12 #include "boost/type_traits/remove_const.hpp"
13 #include "boost/type_traits/remove_reference.hpp"
17 namespace lsst {
namespace afw {
namespace table {
28 #ifndef SWIG // see comment block in tableLib.i; workaround to avoid dangling references
72 typedef boost::mpl::transform<FieldTypes,MakeItem>::type
ItemTypes;
74 typedef boost::make_variant_over< ItemTypes >::type
ItemVariant;
78 typedef std::map<std::string,int>
NameMap;
82 typedef std::map<std::pair<int,int>,
int>
FlagMap;
101 template <
typename T>
108 std::set<std::string>
getNames(
bool topOnly)
const;
111 std::set<std::string>
getNames(
bool topOnly, std::string
const & prefix)
const;
113 template <
typename T>
117 template <
typename T>
124 template <
typename T>
128 template <
typename T>
142 daf::base::
Citizen(typeid(this)),
155 template <
typename F>
159 template <
typename T>
172 boost::apply_visitor(*
this, v);
186 template <
typename T>
202 #endif // !AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
int getNonFlagFieldCount() const
The number of non-Flag fields.
VisitorWrapper(F func)
Construct the wrapper.
SchemaImpl()
Default constructor.
int getFieldCount() const
The total number of fields.
table::Key< std::string > name
int getFlagFieldCount() const
The number of Flag fields.
int contains(SchemaItem< T > const &item, int flags) const
void operator()(ItemVariant const &v) const
Invoke the visitation.
std::set< std::string > getNames(bool topOnly) const
Return a set of field names (used to implement Schema::getNames).
Boost.MPL metafunction that returns a SchemaItem<T> given a T.
std::map< int, int > OffsetMap
A map from standard field offsets to position in the vector, so we can do field lookups.
int getRecordSize() const
The size of a record in bytes.
SchemaItem< T > find(std::string const &name) const
Find an item by name (used to implement Schema::find).
SchemaItem(Key< T > const &key_, Field< T > const &field_)
std::vector< ItemVariant > ItemContainer
A std::vector whose elements can be any of the allowed SchemaItem types.
void replaceField(Key< T > const &key, Field< T > const &field)
Replace the Field in an existing SchemaItem without changing the Key.
A description of a field in a table.
Key< T > addFieldImpl(int elementSize, int elementCount, Field< T > const &field, bool doReplace)
Tag types used to declare specialized field types.
A private implementation class to hide the messy details of Schema.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a field to the schema (used to implement Schema::addField).
A functor-wrapper used in the implementation of Schema::forEach.
A class used as a handle to a particular field in a table.
Citizen(const std::type_info &)
Key specialization for Flag.
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...
boost::mpl::transform< FieldTypes, MakeItem >::type ItemTypes
An MPL sequence of all the allowed SchemaItem templates.
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
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.
void operator()(SchemaItem< T > const &x) const
Call the wrapped function.
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...