36 #define G_NAME "GObservationRegistry::name(int&)"
43 #define G_DEBUG_REGISTRY 0
62 std::cout <<
"GObservationRegistry(void): ";
63 for (
int i = 0; i <
size(); ++i) {
64 std::cout <<
"\"" <<
names()[i] <<
"\" ";
66 std::cout << std::endl;
86 std::cout <<
"GObservationRegistry(const GObservation*): ";
87 std::cout <<
"add \"" << obs->
instrument() <<
"\" 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_obs[i] = this->
obs()[i];
105 names().assign(new_names);
106 this->
obs().assign(new_obs);
113 std::cout <<
"GObservationRegistry(const GObservation*): ";
114 for (
int i = 0; i <
size(); ++i) {
115 std::cout <<
"\"" <<
names()[i] <<
"\" ";
117 std::cout << std::endl;
171 if (
this != ®istry) {
211 for (
int i = 0; i <
size(); ++i) {
213 obs = this->
obs()[i]->clone();
235 #if defined(G_RANGE_CHECK)
236 if (index < 0 || index >=
size()) {
243 return (
names()[index]);
262 result.append(
"=== GObservationRegistry ===");
270 for (
int i = 0; i <
size(); ++i) {
272 result.append(this->
obs()[i]->instrument());
virtual ~GObservationRegistry(void)
Destructor.
GObservation * alloc(const std::string &name) const
Allocate observation of given name.
virtual std::string instrument(void) const =0
GObservationRegistry & operator=(const GObservationRegistry ®istry)
Assignment operator.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
int size(void) const
Return number of registered observations.
static GRegistryPointer< const GObservation * > & obs()
Interface definition for the observation registry class.
Observation registry class definition.
std::string name(const int &index) const
Returns instrument name for a specific registered observation.
Abstract observation base class.
GObservationRegistry(void)
Void constructor.
void copy_members(const GObservationRegistry ®istry)
Copy class members.
Exception handler interface definition.
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
static GRegistryPointer< std::string > & names()
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.