36 #define G_NAME "GCTAModelRadialRegistry::name(int&)"
43 #define G_DEBUG_REGISTRY 0
62 std::cout <<
"GCTAModelRadialRegistry(void): ";
63 for (
int i = 0; i <
size(); ++i) {
64 std::cout <<
"\"" <<
names()[i] <<
"\" ";
66 std::cout << std::endl;
86 std::cout <<
"GCTAModelRadialRegistry(const GCTAModelRadial*): ";
87 std::cout <<
"add \"" << model->
type() <<
"\" to registry." << std::endl;
91 std::string* new_names =
new std::string[
size()+1];
95 for (
int i = 0; i <
size(); ++i) {
96 new_names[i] =
names()[i];
97 new_models[i] =
models()[i];
102 new_models[
size()] = model;
105 names().assign(new_names);
106 models().assign(new_models);
113 std::cout <<
"GCTAModelRadialRegistry(const GCTAModelRadial*): ";
114 for (
int i = 0; i <
size(); ++i) {
115 std::cout <<
"\"" <<
names()[i] <<
"\" ";
117 std::cout << std::endl;
171 if (
this != ®istry) {
210 for (
int i = 0; i <
size(); ++i) {
212 model =
models()[i]->clone();
234 #if defined(G_RANGE_CHECK)
235 if (index < 0 || index >=
size()) {
241 return (
names()[index]);
260 result.append(
"=== GCTAModelRadialRegistry ===");
268 for (
int i = 0; i <
size(); ++i) {
270 result.append(
models()[i]->type());
static GRegistryPointer< const GCTAModelRadial * > & models()
virtual ~GCTAModelRadialRegistry(void)
Destructor.
CTA radial model registry class definition.
void init_members(void)
Initialise class members.
GCTAModelRadialRegistry(void)
Void constructor.
std::string name(const int &index) const
Returns model name.
int size(void) const
Return number of registered models.
GCTAModelRadial * alloc(const std::string &name) const
Allocate radial model of given name.
GCTAModelRadialRegistry & operator=(const GCTAModelRadialRegistry ®istry)
Assignment operator.
Interface definition for the CTA radial model registry class.
Exception handler interface definition.
Abstract radial acceptance model class.
void free_members(void)
Delete class members.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
virtual std::string type(void) const =0
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
void copy_members(const GCTAModelRadialRegistry ®istry)
Copy class members.
static GRegistryPointer< std::string > & names()
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.