1#ifndef LSST_GAUSS2D_FIT_CHANNEL_H
2#define LSST_GAUSS2D_FIT_CHANNEL_H
12#include "lsst/gauss2d/object.h"
16namespace lsst::gauss2d::fit {
29class Channel :
public Object {
31 typedef std::map<std::string, std::shared_ptr<const Channel>> Registry;
33 Channel(
const Channel &) =
delete;
34 Channel &operator=(
const Channel &) =
delete;
44 static void erase(std::string name);
52 static const std::shared_ptr<const Channel>
find_channel(std::string name);
60 static const std::shared_ptr<const Channel>
get_channel(std::string name);
62 static std::vector<std::shared_ptr<const Channel>> get_channels();
64 inline static const std::string NAME_NONE =
"None";
66 const std::string name;
68 static const std::shared_ptr<const Channel> NONE_PTR();
69 static const Channel &NONE();
71 std::string repr(
bool name_keywords =
false,
72 std::string_view namespace_separator = Object::CC_NAMESPACE_SEPARATOR)
const override;
73 std::string str()
const override;
81 static std::shared_ptr<Channel>
make(std::string name);
83 static const std::shared_ptr<const Channel>
make_const(std::string name);
87 const bool operator<(
const Channel &c)
const;
88 const bool operator==(
const Channel &c)
const;
89 const bool operator!=(
const Channel &c)
const;
99 explicit Channel(std::string name);
104inline bool operator<(
const std::reference_wrapper<const Channel> &lhs,
105 const std::reference_wrapper<const Channel> &rhs) {
106 return (lhs.get() < rhs.get());
109inline bool operator==(
const std::reference_wrapper<const Channel> &lhs,
110 const std::reference_wrapper<const Channel> &rhs) {
111 return (lhs.get() == rhs.get());
static void erase(std::string name)
Definition channel.cc:51
static const std::shared_ptr< const Channel > make_const(std::string name)
Same as make(), but creating a new Channel.
Definition channel.cc:97
static const std::shared_ptr< const Channel > get_channel(std::string name)
Definition channel.cc:74
static const std::shared_ptr< const Channel > find_channel(std::string name)
Definition channel.cc:67
static std::shared_ptr< Channel > make(std::string name)
Definition channel.cc:89