SCENE C++ API  2.1.0
lsattributecontainer.h
1 #pragma once
2 
3 #include <core_api/lsglobaldefinitions.h>
4 #include <core_api/lsinterface.h>
5 #include <core_api/lsreftype.h>
6 #include <core_api/lsresult.h>
7 #include <core_api/lsstring.h>
8 #include <core_api/lsattribute.h>
9 
10 namespace SCENE_API {
11 
12 // Forward declarations
13 class LSAttributeContainer_Implementation;
14 
19 {
20  LS_UNCOPYABLE(LSAttributeContainer)
21 
22 public:
23 
28  CORE_API_EXPORT LSString getTypeName() const;
29 
33  CORE_API_EXPORT LSString getName() const;
34 
37  CORE_API_EXPORT LSResult::Result setName(LSString name);
38 
43  CORE_API_EXPORT LSString getUuid() const;
44 
50  CORE_API_EXPORT LSString assignUuid();
51 
52 
56  CORE_API_EXPORT unsigned int getNumAttributes() const;
57 
60  CORE_API_EXPORT LSString getAttributeName(unsigned int index) const;
61 
64  CORE_API_EXPORT unsigned int getAttributeIndex(LSString name) const;
65 
68  CORE_API_EXPORT LSAttribute getAttribute(unsigned int index) const;
69 
72  CORE_API_EXPORT LSAttribute getAttribute(LSString name) const;
73 
76  CORE_API_EXPORT LSResult::Result setAttribute(unsigned int index, const LSAttribute& attribute);
77 
80  CORE_API_EXPORT LSResult::Result setAttribute(LSString name, const LSAttribute& attribute);
81 
84  CORE_API_EXPORT LSResult::Result addCustomAttribute(LSString name, const LSAttribute& attribute);
85 
88  CORE_API_EXPORT bool removeCustomAttribute(LSString name);
89 
90 
94  CORE_API_EXPORT unsigned int getNumFields() const;
95 
98  CORE_API_EXPORT ref_ptr<LSAttributeContainer> getField(unsigned int index) const;
99 
102  CORE_API_EXPORT ref_ptr<LSAttributeContainer> getField(const LSString& name) const;
103 
106  CORE_API_EXPORT LSResult::Result addField(const LSString& name, const LSString& typeName, ref_ptr<LSAttributeContainer>& fieldOut);
107 
110  CORE_API_EXPORT bool rmField(const LSString& name);
111 
112 
114  CORE_API_EXPORT friend bool operator==(const LSAttributeContainer& container1, const LSAttributeContainer& container2);
116  CORE_API_EXPORT friend bool operator!=(const LSAttributeContainer& container1, const LSAttributeContainer& container2);
117 
118 protected:
119  LS_INTERFACE(LSAttributeContainer, LSInterface)
120 };
121 
122 }