Use naked pointer for attribute list and derive size from schema type to reduce mem usage

This commit is contained in:
Thomas Krijnen
2018-01-29 12:11:50 +01:00
parent a3b7a25866
commit af93f2a64d
6 changed files with 167 additions and 126 deletions
+6 -4
View File
@@ -160,9 +160,11 @@ namespace IfcParse {
/// ==========
class IFC_PARSE_API ArgumentList: public Argument {
private:
std::vector<Argument*> list;
void push(Argument* l);
size_t size_;
Argument** list_;
public:
ArgumentList() : size_(0), list_(0) {}
~ArgumentList();
void read(IfcSpfLexer* t, std::vector<unsigned int>& ids);
@@ -183,11 +185,11 @@ namespace IfcParse {
unsigned int size() const;
Argument* operator [] (unsigned int i) const;
void set(unsigned int i, Argument*);
std::string toString(bool upper=false) const;
std::vector<Argument*>& arguments() { return list; }
Argument**& arguments() { return list_; }
size_t& size() { return size_; }
};