LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
afw
11.0-2-g04d2804
include
lsst
afw
table
AliasMap.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
#ifndef AFW_TABLE_AliasMap_h_INCLUDED
3
#define AFW_TABLE_AliasMap_h_INCLUDED
4
5
#include <map>
6
#include <string>
7
8
namespace
lsst {
namespace
afw {
namespace
table {
9
10
class
BaseTable;
11
34
class
AliasMap
{
35
typedef
std::map<std::string,std::string>
Internal
;
36
public
:
37
38
// Create an empty AliasMap
39
AliasMap
() :
_internal
(),
_table
(0) {}
40
46
AliasMap
(
AliasMap
const
& other) :
_internal
(other.
_internal
),
_table
(0) {}
47
49
typedef
std::map<std::string,std::string>::const_iterator
Iterator
;
50
52
Iterator
begin
()
const
{
return
_internal
.begin(); }
53
55
Iterator
end
()
const
{
return
_internal
.end(); }
56
58
std::size_t
size
()
const
{
return
_internal
.size(); }
59
61
bool
empty
()
const
{
return
_internal
.empty(); }
62
79
std::string
apply
(std::string
const
&
name
)
const
;
80
88
std::string
get
(std::string
const
& alias)
const
;
89
91
void
set
(std::string
const
& alias, std::string
const
& target);
92
98
bool
erase
(std::string
const
& alias);
99
101
104
bool
operator==
(
AliasMap
const
& other)
const
;
105
bool
operator!=
(
AliasMap
const
& other)
const
{
return
!(other == *
this
); }
107
109
bool
contains
(
AliasMap
const
& other)
const
;
110
111
private
:
112
113
friend
class
Schema
;
114
friend
class
SubSchema
;
115
friend
class
BaseTable
;
116
117
// Internal in-place implementation of apply()
118
void
_apply
(std::string &
name
)
const
;
119
120
Internal
_internal
;
121
122
// Table to notify of any changes. We can't use a shared_ptr here because the Table needs to set
123
// this in its own constructor, but the Table does guarantee that this pointer is either valid or
124
// null.
125
BaseTable
*
_table
;
126
};
127
128
}}}
// namespace lsst::afw::table
129
130
#endif // !AFW_TABLE_AliasMap_h_INCLUDED
lsst::afw::table::Schema
Defines the fields and offsets for a table.
Definition:
Schema.h:46
lsst::afw::table::SubSchema
A proxy type for name lookups in a Schema.
Definition:
Schema.h:330
name
table::Key< std::string > name
Definition:
ApCorrMap.cc:71
lsst::afw::table::AliasMap::operator==
bool operator==(AliasMap const &other) const
lsst::afw::table::AliasMap::AliasMap
AliasMap(AliasMap const &other)
Definition:
AliasMap.h:46
lsst::afw::table::AliasMap::set
void set(std::string const &alias, std::string const &target)
Add an alias to the schema or replace an existing one.
lsst::afw::table::AliasMap
Mapping class that holds aliases for a Schema.
Definition:
AliasMap.h:34
lsst::afw::table::AliasMap::_internal
Internal _internal
Definition:
AliasMap.h:120
lsst::afw::table::AliasMap::begin
Iterator begin() const
Return a iterator to the beginning of the map.
Definition:
AliasMap.h:52
lsst::afw::table::AliasMap::apply
std::string apply(std::string const &name) const
lsst::afw::table::AliasMap::operator!=
bool operator!=(AliasMap const &other) const
Definition:
AliasMap.h:105
lsst::afw::table::AliasMap::Internal
std::map< std::string, std::string > Internal
Definition:
AliasMap.h:35
lsst::afw::table::AliasMap::erase
bool erase(std::string const &alias)
Remove an alias from the schema if it is present.
lsst::afw::table::AliasMap::AliasMap
AliasMap()
Definition:
AliasMap.h:39
lsst::afw::table::AliasMap::_apply
void _apply(std::string &name) const
lsst::afw::table::AliasMap::_table
BaseTable * _table
Definition:
AliasMap.h:125
lsst::afw::table::AliasMap::empty
bool empty() const
Return the true if there are no aliases.
Definition:
AliasMap.h:61
lsst::afw::table::AliasMap::end
Iterator end() const
Return a iterator to one past the end of the map.
Definition:
AliasMap.h:55
lsst::afw::table::AliasMap::size
std::size_t size() const
Return the number of aliases.
Definition:
AliasMap.h:58
lsst::afw::table::BaseTable
Base class for all tables.
Definition:
BaseTable.h:44
lsst::afw::table::AliasMap::contains
bool contains(AliasMap const &other) const
Return true if all aliases in this are also in other (with the same targets).
lsst::afw::table::AliasMap::Iterator
std::map< std::string, std::string >::const_iterator Iterator
An iterator over alias->target pairs.
Definition:
AliasMap.h:49
Generated on Thu Sep 24 2015 02:29:15 for LSSTApplications by
1.8.5