index 039354d5b5c120737498795f9267a65babea13ca..da8434060bf2af7999e2440fb45e85fb33efaef6 100644 (file)
--- a/store.h
+++ b/store.h
#include <oberon.h>
#include <domain.h>
#include <oberon.h>
#include <domain.h>
+#include <typeregister.h>
#include <string>
#include <vector>
namespace odc {
#include <string>
#include <vector>
namespace odc {
+ class Reader; // forward decl
class TypePath : public std::vector<std::string> {
public:
class TypePath : public std::vector<std::string> {
public:
*/
class Store {
private:
*/
class Store {
private:
+ static const std::string TYPENAME;
+ static const TypeProxy<Store> PROXY;
+
INTEGER d_id;
public:
INTEGER d_id;
public:
INTEGER getId();
INTEGER getId();
+ /**
+ * Get the TypeName of this object.
+ * @see TypeRegister
+ */
+ static const std::string &getType();
+ /**
+ * Get the TypeName of the supertype of this object. Return 0 pointer if no supertype.
+ * @see TypeRegister
+ */
+ static const std::string *getSuper();
+ /**
+ * Get the TypeName for this object.
+ */
+ virtual const std::string &getTypeName() const;
+ /**
+ * Get the TypePath to this object's type.
+ * @see TypePath
+ */
+ void getTypePath(TypePath *path) const;
/**
* PROCEDURE (s: Store) Domain (): Domain
/**
* PROCEDURE (s: Store) Domain (): Domain
* A store may be associated with a domain. This is done by the procedure InitDomain, which assigns a domain to the store.
* Domain may be called by arbitrary clients.
*/
* A store may be associated with a domain. This is done by the procedure InitDomain, which assigns a domain to the store.
* Domain may be called by arbitrary clients.
*/
- Domain* getDomain();
+ //Domain* getDomain();
/**
* PROCEDURE (s: Store) CopyFrom- (source: Store)
/**
* PROCEDURE (s: Store) CopyFrom- (source: Store)
* source.Domain() = NIL guaranteed
* source is not yet initialized guaranteed
*/
* source.Domain() = NIL guaranteed
* source is not yet initialized guaranteed
*/
-// void internalize(Reader &reader) {
+ virtual void internalize(Reader &reader);
// PROCEDURE (s: Store) Internalize- (VAR rd: Reader), NEW, EXTENSIBLE;
// VAR thisVersion: INTEGER;
// BEGIN
// PROCEDURE (s: Store) Internalize- (VAR rd: Reader), NEW, EXTENSIBLE;
// VAR thisVersion: INTEGER;
// BEGIN
*/
// FIXME
*/
// FIXME
- virtual std::string toString() = 0;
+ virtual std::string toString();
+
+ private:
+ void calcTypePath(TypePath * out, const std::string &name) const;
};
};
+ class Elem : public Store {
+ private:
+ static const std::string TYPENAME;
+ static const TypeProxy<Elem> PROXY;
+
+ public:
+ Elem(INTEGER id);
+
+ /**
+ * Get the TypeName of this object.
+ * @see TypeRegister
+ */
+ static const std::string &getType();
+ /**
+ * Get the TypeName of the supertype of this object. Return 0 pointer if no supertype.
+ * @see TypeRegister
+ */
+ static const std::string *getSuper();
+ /**
+ * Get the TypeName for this object.
+ */
+ virtual const std::string &getTypeName() const;
+
+ virtual void internalize(Reader &reader);
+ };
+
+ class Model : public Elem {
+ private:
+ static const std::string TYPENAME;
+ static const TypeProxy<Model> PROXY;
+
+ public:
+ Model(INTEGER id);
+
+ /**
+ * Get the TypeName of this object.
+ * @see TypeRegister
+ */
+ static const std::string &getType();
+ /**
+ * Get the TypeName of the supertype of this object. Return 0 pointer if no supertype.
+ * @see TypeRegister
+ */
+ static const std::string *getSuper();
+ /**
+ * Get the TypeName for this object.
+ */
+ virtual const std::string &getTypeName() const;
+
+ virtual void internalize(Reader &reader);
+ };
+
+ class ContainerModel : public Model {
+ private:
+ static const std::string TYPENAME;
+ static const TypeProxy<ContainerModel> PROXY;
+
+ public:
+ ContainerModel(INTEGER id);
+ static const std::string &getType();
+ static const std::string *getSuper();
+ virtual const std::string &getTypeName() const;
+ virtual void internalize(Reader &reader);
+ };
}
#endif // _STORE_H_
}
#endif // _STORE_H_