<commit_before>#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include "FilterMode.h"

namespace canvas {
  class Texture {
  public:
    friend class TextureRef;

  Texture(unsigned int _width, unsigned int _height, FilterMode _min_filter, FilterMode _mag_filter, unsigned int _mipmap_levels) 
    : width(_width), height(_height), mipmap_levels(_mipmap_levels), min_filter(_min_filter), mag_filter(_mag_filter) { }
    virtual ~Texture() { }

    virtual void updateData(const void * buffer) = 0;
    virtual void updateData(const void * buffer, unsigned int x, unsigned int y, unsigned int width, unsigned int height) = 0;
    virtual unsigned int getTextureId() const { return 0; }

    unsigned int getWidth() const { return width; }
    unsigned int getHeight() const { return height; }
    unsigned int getMipmapLevels() const { return mipmap_levels; }
    FilterMode getMinFilter() const { return min_filter; }
    FilterMode getMagFilter() const { return mag_filter; }

  protected:
    void incRefcnt() { ++refcnt; }
    int decRefcnt();

  private:
    Texture(const Texture & other);
    Texture & operator=(const Texture & other);

    int refcnt = 0;
    unsigned int width, height, mipmap_levels;
    FilterMode min_filter;
    FilterMode mag_filter;
  };

  class TextureFactory {
  public:
    TextureFactory() { }
    
  };
};

#endif
<commit_msg>add method isDefined to Texture<commit_after>#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include "FilterMode.h"

namespace canvas {
  class Texture {
  public:
    friend class TextureRef;

  Texture(unsigned int _width, unsigned int _height, FilterMode _min_filter, FilterMode _mag_filter, unsigned int _mipmap_levels) 
    : width(_width), height(_height), mipmap_levels(_mipmap_levels), min_filter(_min_filter), mag_filter(_mag_filter) { }
    virtual ~Texture() { }

    virtual void updateData(const void * buffer) = 0;
    virtual void updateData(const void * buffer, unsigned int x, unsigned int y, unsigned int width, unsigned int height) = 0;
    virtual unsigned int getTextureId() const { return 0; }

    unsigned int getWidth() const { return width; }
    unsigned int getHeight() const { return height; }
    unsigned int getMipmapLevels() const { return mipmap_levels; }
    FilterMode getMinFilter() const { return min_filter; }
    FilterMode getMagFilter() const { return mag_filter; }
    bool isDefined() const { return getTextureId() != 0; }

  protected:
    void incRefcnt() { ++refcnt; }
    int decRefcnt();

  private:
    Texture(const Texture & other);
    Texture & operator=(const Texture & other);

    int refcnt = 0;
    unsigned int width, height, mipmap_levels;
    FilterMode min_filter;
    FilterMode mag_filter;
  };

  class TextureFactory {
  public:
    TextureFactory() { }
    
  };
};

#endif

{'fraction_non_alphanumeric': 0.09409660107334526, 'fraction_numerical': 0.0032200357781753132, 'mean_word_length': 3.939929328621908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7006219', 'n_tokens_mistral': 881, 'n_tokens_neox': 831, 'n_words': 258}