make objects noncopyable

This commit is contained in:
Konstantin Käfer
2014-01-20 11:43:03 +01:00
parent 15d4327229
commit ef15a1d1dc
6 changed files with 40 additions and 3 deletions

View File

@@ -7,6 +7,13 @@ class settings {
public:
virtual void save() = 0;
// Make noncopyable
settings() = default;
settings(const settings&) = delete;
settings(const settings&&) = delete;
settings &operator=(const settings&) = delete;
settings &operator=(const settings&&) = delete;
public:
// position
double longitude = 0;

View File

@@ -27,6 +27,13 @@ public:
tile(tile_id id);
~tile();
// Make noncopyable
tile(const tile&) = delete;
tile(const tile&&) = delete;
tile &operator=(const tile&) = delete;
tile &operator=(const tile&&) = delete;
// Other functions
void setData(uint8_t *data, uint32_t bytes);
bool parse();
void parseLayer(const uint8_t *data, uint32_t bytes);

View File

@@ -18,6 +18,12 @@ class transform {
public:
transform();
// Make noncopyable
transform(const transform&) = delete;
transform(const transform&&) = delete;
transform &operator=(const transform&) = delete;
transform &operator=(const transform&&) = delete;
// Animations
bool needsAnimation() const;
void updateAnimations();

View File

@@ -14,6 +14,13 @@ class painter {
public:
painter(class transform *transform, class settings *settings);
// Make noncopyable
painter(const painter&) = delete;
painter(const painter&&) = delete;
painter &operator=(const painter&) = delete;
painter &operator=(const painter&&) = delete;
void setup();
void teardown();

View File

@@ -9,6 +9,13 @@ class Shader {
public:
Shader(const char *vertex, const char *fragment);
~Shader();
// Make noncopyable
Shader(const Shader&) = delete;
Shader(const Shader&&) = delete;
Shader &operator=(const Shader&) = delete;
Shader &operator=(const Shader&&) = delete;
bool valid;
uint32_t program;
std::forward_list<uint32_t> attributes;

View File

@@ -12,9 +12,12 @@ public:
};
animation(double from, double to, double &value, double duration);
animation(const animation &) = delete;
animation(const animation &&) = delete;
animation &operator=(const animation &) = delete;
// Make noncopyable
animation(const animation&) = delete;
animation(const animation&&) = delete;
animation &operator=(const animation&) = delete;
animation &operator=(const animation&&) = delete;
state update() const;