Renaming List to more meaningful PointerList.

This commit is contained in:
Stefano Sanfilippo 2014-11-28 19:37:14 +01:00
parent 7050c5586e
commit 015f8ae6d1

View File

@ -41,9 +41,9 @@ public:
template<class T> template<class T>
class List: public std::vector<T*> { class PointerList: public std::vector<T*> {
public: public:
virtual ~List() { virtual ~PointerList() {
for (T *element: *this) { for (T *element: *this) {
delete element; delete element;
} }
@ -51,14 +51,14 @@ public:
}; };
class StatementList: public List<Statement>, public Emittable { class StatementList: public PointerList<Statement>, public Emittable {
public: public:
virtual void emit(std::ostream &stream, int indent = 0); virtual void emit(std::ostream &stream, int indent = 0);
}; };
template <class T> template <class T>
class ListEmittable: public List<T>, public Emittable { class ListEmittable: public PointerList<T>, public Emittable {
public: public:
virtual void emit(std::ostream &stream, int indent = 0) { virtual void emit(std::ostream &stream, int indent = 0) {
if (this->size() > 0) { if (this->size() > 0) {
@ -234,7 +234,7 @@ private:
}; };
typedef List<BranchCase> BranchCaseList; typedef PointerList<BranchCase> BranchCaseList;
class Branch: public Statement { class Branch: public Statement {
@ -288,7 +288,7 @@ public:
private: private:
std::unique_ptr<Main> main; std::unique_ptr<Main> main;
List<Function> functions; PointerList<Function> functions;
}; };