38#define G_ALLOC "GModelTemporalRegistry::alloc(GXmlElement&)"
39#define G_NAME "GModelTemporalRegistry::name(int&)"
46#define G_DEBUG_REGISTRY 0
65 std::cout <<
"GModelTemporalRegistry(void): ";
66 for (
int i = 0; i <
size(); ++i) {
67 std::cout <<
"\"" <<
models()[i]->type() <<
"\" ";
69 std::cout << std::endl;
92 std::cout <<
"GModelTemporalRegistry(const GModelTemporal*): ";
93 std::cout <<
"add \"" << model->
type() <<
"\" to registry." << std::endl;
100 for (
int i = 0; i <
size(); ++i) {
101 new_models[i] =
models()[i];
105 new_models[
size()] = model;
108 models().assign(new_models);
115 std::cout <<
"GModelTemporalRegistry(const GModelTemporal*): ";
116 for (
int i = 0; i <
size(); ++i) {
117 std::cout <<
"\"" <<
models()[i]->type() <<
"\" ";
119 std::cout << std::endl;
173 if (
this != ®istry) {
216 for (
int i = 0; i <
size(); ++i) {
225 std::string msg =
"Temporal model of type \""+xml.
attribute(
"type")+
226 "\" not found in registry. Possible temporal model "
228 for (
int i = 0; i <
size(); ++i) {
229 msg +=
" \""+
models()[i]->type()+
"\"";
255 #if defined(G_RANGE_CHECK)
256 if (index < 0 || index >=
size()) {
263 return (
models()[index]->type());
282 result.append(
"=== GModelTemporalRegistry ===");
290 for (
int i = 0; i <
size(); ++i) {
292 for (
int k = 0; k <
models()[i]->size(); ++k) {
297 result.append((*(
models()[i]))[k].name());
Exception handler interface definition.
Model parameter class interface definition.
Temporal model registry class definition.
Abstract temporal model base class interface definition.
Interface definition for the temporal model registry class.
void free_members(void)
Delete class members.
static GRegistryPointer< const GModelTemporal * > & models()
virtual ~GModelTemporalRegistry(void)
Destructor.
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
GModelTemporalRegistry(void)
Void constructor.
void copy_members(const GModelTemporalRegistry ®istry)
Copy class members.
void init_members(void)
Initialise class members.
std::string name(const int &index) const
Returns model name.
int size(void) const
Return number of registered models.
GModelTemporal * alloc(const GXmlElement &xml) const
Allocate temporal model that is found in XML element.
GModelTemporalRegistry & operator=(const GModelTemporalRegistry ®istry)
Assignment operator.
Abstract temporal model base class.
virtual void read(const GXmlElement &xml)=0
virtual GModelTemporal * clone(void) const =0
Clones object.
virtual std::string type(void) const =0
const GXmlAttribute * attribute(const int &index) const
Return attribute.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.