mirror of
https://github.com/dbalsom/x86_microcode.git
synced 2026-06-09 13:04:17 +03:00
22 lines
442 B
C++
22 lines
442 B
C++
#include "alfe/main.h"
|
|
|
|
#ifndef INCLUDED_OWNING_ARRAY_H
|
|
#define INCLUDED_OWNING_ARRAY_H
|
|
|
|
// An object which holds other objects and deletes them all on destruction.
|
|
template<class T> class OwningArray : public AppendableArray<T*>
|
|
{
|
|
public:
|
|
void add(T* object)
|
|
{
|
|
append(object);
|
|
}
|
|
~OwningArray()
|
|
{
|
|
for (int i = 0; i < count(); ++i)
|
|
delete (*this)[i];
|
|
}
|
|
};
|
|
|
|
#endif // INCLUDED_OWNING_ARRAY_H
|