OpenLexocad  27.0
PropertyLinkSetBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/DbgInfo.h>
4 #include <Core/DocObject.h>
5 #include <Core/Property.h>
6 #include <Core/Variant.h>
7 #include <Core/core_defines2.h>
8 
9 
10 namespace Core
11 {
13 {
15 
16 public:
18  virtual ~PropertyLinkSetBase();
19 
20  virtual void setValue(const boost::unordered_set<Core::DocObject*>& set);
21  bool setValueFromVariant(const Core::Variant& value) override;
23  bool setKeyValue(const std::string& key, const Core::Variant& value) override;
25  std::map<std::string, Core::Variant> getKeyValueMap() const override;
26 
27  const boost::unordered_set<Core::DocObject*>& getValue() const;
28  Core::Variant getVariant() const override;
29 
30  void copyValue(Core::Property* p) override;
31  void deepCopy(Core::Property* p, Core::CoreDocument* dest_doc, DocObjectMap& copyMap) override;
32 
33  virtual bool addLink(Core::DocObject* link);
34  virtual void addLinks(const boost::unordered_set<Core::DocObject*>& linkset);
35  virtual bool removeLink(Core::DocObject* link);
36  bool hasLink(const Core::DocObject* o) const;
37  void setEmpty();
38  bool isEmpty() const;
39  size_t getSize() const;
40  void rehash(long n);
41 
42 
43  void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version) override;
44  inline void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version) override;
45  const Core::PropertyKind getPropertyKind(void) const override;
46  bool isEqual(const Property* p) const override;
47  bool isLink() const override { return true; }
48  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
49 
50 protected:
51  boost::unordered_set<Core::DocObject*> _linkSet;
52 };
53 
54 } // namespace Core
#define CORE_EXPORT
Definition: core_defines2.h:10
Definition: Persistance.h:20
LX_CORE_EXPORT Version & version
Definition: CoreDocument.h:197
Definition: Variant.h:90
Definition: AbstractXMLReader.h:10
PropertyKind
Definition: Property.h:54
Definition: Base.h:19
Definition: Writer.h:27
Definition: Property.h:81
std::map< Core::DocObject *, Core::DocObject * > DocObjectMap
Definition: DocObject.h:11
TYPESYSTEM_HEADER()
Definition: DocObject.h:28