LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
A proxy type for name lookups in a Schema. More...
#include <Schema.h>
Public Member Functions | |
template<typename T > | |
SchemaItem< T > | find (std::string const &name) const |
Find a nested SchemaItem by name. More... | |
SubSchema | operator[] (std::string const &name) const |
Return a nested proxy. More... | |
std::string const & | getPrefix () const |
Return the prefix that defines this SubSchema relative to its parent Schema. More... | |
std::set< std::string > | getNames (bool topOnly=false) const |
Return a set of nested names that start with the SubSchema's prefix. More... | |
template<typename T > | |
operator Key< T > () const | |
Implicit conversion to the appropriate Key type. More... | |
template<typename T > | |
operator Field< T > () const | |
Implicit conversion to the appropriate Key type. More... | |
Private Types | |
typedef detail::SchemaImpl | Impl |
Private Member Functions | |
SubSchema (boost::shared_ptr< Impl > impl, boost::shared_ptr< AliasMap > aliases, std::string const &name) | |
Private Attributes | |
boost::shared_ptr< Impl > | _impl |
boost::shared_ptr< AliasMap > | _aliases |
std::string | _name |
Friends | |
class | Schema |
A proxy type for name lookups in a Schema.
Elements of schema names are assumed to be separated by periods ("a.b.c.d"); an incomplete lookup is one that does not resolve to a field. Not that even complete lookups can have nested names; a Point field, for instance, has "x" and "y" nested names.
This proxy object is implicitly convertible to both the appropriate Key type and the appropriate Field type, if the name is a complete one, and supports additional find() operations for nested names.
SubSchema is implemented as a proxy that essentially calls Schema::find after concatenating strings. It does not provide any performance advantage over using Schema::find directly. It is also lazy, so looking up a name prefix that does not exist within the schema is not considered an error until the proxy is used.
Some examples:
|
private |
|
private |
SchemaItem<T> lsst.afw.table::SubSchema::find | ( | std::string const & | name | ) | const |
Find a nested SchemaItem by name.
std::set<std::string> lsst.afw.table::SubSchema::getNames | ( | bool | topOnly = false | ) | const |
Return a set of nested names that start with the SubSchema's prefix.
Returns an instance of Python's builtin set in Python.
|
inline |
|
inline |
|
inline |
SubSchema lsst.afw.table::SubSchema::operator[] | ( | std::string const & | name | ) | const |
Return a nested proxy.
|
private |
|
private |