aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp/oo/ObjArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'meowpp/oo/ObjArray.h')
-rw-r--r--meowpp/oo/ObjArray.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/meowpp/oo/ObjArray.h b/meowpp/oo/ObjArray.h
index 4417524..b58b89c 100644
--- a/meowpp/oo/ObjArray.h
+++ b/meowpp/oo/ObjArray.h
@@ -37,19 +37,19 @@ private:
public:
ObjArray(): self(true) {
}
-
+
ObjArray(ObjArray const& a): self(false) {
self().copyFrom(a.self);
}
-
+
ObjArray(std::vector<T> const& a): self(true) {
self()->array_ = a;
}
-
+
ObjArray(size_t sz, T const& e): self(true) {
self()->array_.resize(sz, e);
}
-
+
~ObjArray() {
}
@@ -79,7 +79,7 @@ public:
self()->array_.resize(res);
return size();
}
-
+
void clear() {
self()->array_.clear();
}
@@ -96,7 +96,7 @@ public:
self()->array_.push_back(e);
return entry(size() - 1);
}
-
+
bool popBack() {
if (empty()) return false;
self()->array_.pop_back();
@@ -106,11 +106,11 @@ public:
ObjArray& operator=(ObjArray const& a) {
return copyFrom(a);
}
-
+
T const& operator[](size_t i) const {
return self->array_[i];
}
-
+
T& operator[](size_t i) {
return self()->array_[i];
}
@@ -128,7 +128,7 @@ public:
}
return true;
}
-
+
bool read(FILE* f, bool bin, unsigned int fg) {
size_t sz;
if (bin) {
@@ -143,19 +143,19 @@ public:
}
return true;
}
-
+
ObjBase* create() const {
return new ObjArray();
}
-
+
ObjBase* copyFrom(ObjBase const* b) {
return &(copyFrom(*b));
}
-
+
char const* ctype() const {
return typeid(*this).name();
}
-
+
std::string type() const {
return std::string(ctype());
}