LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
metatype.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cad/const.h>
4 #include <string>
5 #include <memory>
6 #include <iostream>
7 
13 namespace lc {
17  class MetaType {
18  public:
20  }
21 
22  virtual ~MetaType() = default;
23 
28  virtual const std::string id() const = 0;
29 
30  private:
31  friend std::ostream &operator<<(std::ostream &os, const MetaType &lineWidth) {
32  os << "MetaType()" << std::endl;;
33  return os;
34  }
35 
36  };
37 
41  class DocumentMetaType : public MetaType {
42  public:
47  virtual const std::string name() const = 0;
48 
49  private:
50  friend std::ostream &operator<<(std::ostream &os, const DocumentMetaType &lineWidth) {
51  os << "DocumentMetaType()" << std::endl;
52  return os;
53  }
54  };
55 
59  class EntityMetaType : public MetaType {
60  public:
65  virtual const std::string metaTypeID() const = 0;
66 
67  private:
68  friend std::ostream &operator<<(std::ostream &os, const EntityMetaType &lineWidth) {
69  os << "EntityMetaType()" << std::endl;;
70  return os;
71  }
72  };
73 
74  DECLARE_SHORT_SHARED_PTR(MetaType)
75  DECLARE_SHORT_SHARED_PTR(DocumentMetaType)
76  DECLARE_SHORT_SHARED_PTR(EntityMetaType)
77 }
virtual const std::string id() const =0
DECLARE_SHORT_SHARED_PTR(Document)
Definition: cadentity.h:12
friend std::ostream & operator<<(std::ostream &os, const DocumentMetaType &lineWidth)
Definition: metatype.h:50
virtual ~MetaType()=default
virtual const std::string name() const =0
friend std::ostream & operator<<(std::ostream &os, const EntityMetaType &lineWidth)
Definition: metatype.h:68
virtual const std::string metaTypeID() const =0
friend std::ostream & operator<<(std::ostream &os, const MetaType &lineWidth)
Definition: metatype.h:31