38 #define G_ALLOC "GCTAModelSpatialRegistry::alloc(GXmlElement&)"
39 #define G_NAME "GCTAModelSpatialRegistry::name(int&)"
64 #if defined(G_DEBUG_REGISTRY)
65 std::cout <<
"GCTAModelSpatialRegistry(void): ";
66 for (
int i = 0; i <
size(); ++i) {
67 std::cout <<
"\"" <<
models()[i]->type() <<
"\" ";
69 std::cout << std::endl;
91 #if defined(G_DEBUG_REGISTRY)
92 std::cout <<
"GCTAModelSpatialRegistry(const GCTAModelSpatial*): ";
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);
114 #if defined(G_DEBUG_REGISTRY)
115 std::cout <<
"GCTAModelSpatialRegistry(const GCTAModelSpatial*): ";
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 =
"Spatial model of type \""+xml.
attribute(
"type")+
226 "\" not found in registry. Possible spatial 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(
"=== GCTAModelSpatialRegistry ===");
290 for (
int i = 0; i <
size(); ++i) {
292 for (
int k = 0; k <
models()[i]->size(); ++k) {
Abstract spatial model class.
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
static GRegistryPointer< const GCTAModelSpatial * > & models()
void free_members(void)
Delete class members.
virtual std::string type(void) const =0
GCTAModelSpatialRegistry(void)
Void constructor.
Interface definition for the spatial model registry class.
Model parameter class interface definition.
void init_members(void)
Initialise class members.
void copy_members(const GCTAModelSpatialRegistry ®istry)
Copy class members.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
virtual ~GCTAModelSpatialRegistry(void)
Destructor.
Abstract spatial model class interface definition.
Exception handler interface definition.
GCTAModelSpatialRegistry & operator=(const GCTAModelSpatialRegistry ®istry)
Assignment operator.
int size(void) const
Return number of registered models.
GCTAModelSpatial * alloc(const GXmlElement &xml) const
Allocate spatial model that is found in XML element.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
Spatial model registry class definition.
virtual void read(const GXmlElement &xml)=0
std::string name(const int &index) const
Returns model name.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.