DEADSOFTWARE

Reader split into files
[odcread.git] / store / store.cc
1 #include "store/store.h"
2 #include "reader/reader.h"
3 #include "visitor/visitor.h"
5 #include <iostream>
7 namespace odc {
9 const std::string Store::TYPENAME("Stores.Store^");
10 const TopTypeProxy<Store> Store::PROXY;
12 Store::Store(INTEGER id): d_id(id) {}
14 INTEGER Store::getId() {
15 return d_id;
16 }
18 const std::string &Store::getTypeName() const {
19 return Store::TYPENAME;
20 }
22 TypePath Store::getTypePath() const {
23 TypePath out;
24 calcTypePath(&out, getTypeName());
25 return out;
26 }
28 void Store::calcTypePath(TypePath *path, const std::string &name) const {
29 const std::string *super = TypeRegister::getInstance().get(name)->getSuper();
30 if (super != 0) {
31 calcTypePath(path, *super);
32 }
33 path->push_back(name);
34 }
36 void Store::internalize(Reader &reader) {
37 reader.readVersion(0, 0);
38 }
40 std::string Store::toString() {
41 return getTypeName();
42 }
44 void Store::accept(Visitor &visitor) const {}
46 const std::string Elem::TYPENAME("Stores.Elem^");
47 const TypeProxy<Elem, Store> Elem::PROXY;
49 Elem::Elem(INTEGER id) : Store(id) {}
51 const std::string &Elem::getTypeName() const {
52 return TYPENAME;
53 }
55 void Elem::internalize(Reader &reader) {
56 Store::internalize(reader);
57 if (reader.isCancelled()) return;
58 reader.readVersion(0, 0);
59 }
61 const std::string Model::TYPENAME("Models.Model^");
62 const TypeProxy<Model, Elem> Model::PROXY;
64 Model::Model(INTEGER id) : Elem(id) {}
66 const std::string &Model::getTypeName() const {
67 return TYPENAME;
68 }
70 void Model::internalize(Reader &reader) {
71 Elem::internalize(reader);
72 if (reader.isCancelled()) return;
73 reader.readVersion(0, 0);
74 }
76 const std::string ContainerModel::TYPENAME("Containers.Model^");
77 const TypeProxy<ContainerModel, Model> ContainerModel::PROXY;
79 ContainerModel::ContainerModel(INTEGER id) : Model(id) {}
81 const std::string &ContainerModel::getTypeName() const {
82 return TYPENAME;
83 }
85 void ContainerModel::internalize(Reader &reader) {
86 Model::internalize(reader);
87 if (reader.isCancelled()) return;
88 reader.readVersion(0, 0);
89 }
91 } // namespace odc