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) {
218 model =
models()[i]->clone();
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) {
GModelTemporalRegistry(void)
Void constructor.
Abstract temporal model base class.
std::string name(const int &index) const
Returns model name.
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
void init_members(void)
Initialise class members.
Model parameter class interface definition.
Abstract temporal model base class interface definition.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
void free_members(void)
Delete class members.
GModelTemporalRegistry & operator=(const GModelTemporalRegistry ®istry)
Assignment operator.
GModelTemporal * alloc(const GXmlElement &xml) const
Allocate temporal model that is found in XML element.
int size(void) const
Return number of registered models.
virtual void read(const GXmlElement &xml)=0
void copy_members(const GModelTemporalRegistry ®istry)
Copy class members.
Interface definition for the temporal model registry class.
virtual std::string type(void) const =0
Temporal model registry class definition.
Exception handler interface definition.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
virtual ~GModelTemporalRegistry(void)
Destructor.
static GRegistryPointer< const GModelTemporal * > & models()
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.