o cleanup

This commit is contained in:
optixx
2009-04-22 20:04:28 +02:00
parent 55e3468f74
commit 0c378a9f7c
1078 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#ifndef NALL_MODULO_HPP
#define NALL_MODULO_HPP
#include <nall/new.hpp>
namespace nall {
template<typename T, int size> class modulo_array {
public:
inline T operator[](int index) const {
return buffer[size + index];
}
inline T read(int index) const {
return buffer[size + index];
}
inline void write(unsigned index, const T value) {
buffer[index] =
buffer[index + size] =
buffer[index + size + size] = value;
}
modulo_array() {
buffer = new(zeromemory) T[size * 3];
}
~modulo_array() {
delete[] buffer;
}
private:
T *buffer;
};
}
#endif