<commit_before>//
//  GPUProgramState.h
//  G3MiOSSDK
//
//  Created by <NAME> on 05/04/13.
//
//

#ifndef __G3MiOSSDK__GPUProgramState__
#define __G3MiOSSDK__GPUProgramState__

#include <iostream>
#include <map>
#include <string>

#include "GPUUniform.hpp"
#include "GPUAttribute.hpp"
#include "GL.hpp"
#include "GPUProgram.hpp"
#include "MutableMatrix44D.hpp"

class GPUProgramState{
  
  std::map<std::string, GPUUniformValue*> _uniformValues;
  std::map<std::string, GPUAttributeValue*> _attributesValues;
  std::map<std::string, bool> _attributesEnabled;
  
  const GPUProgramState* _parentState;
  
  void setUniformValue(const std::string& name, GPUUniformValue* v);
  void setAttributeValue(const std::string& name, GPUAttributeValue* v);
  
  
  MutableMatrix44D* getMatrixValue(const std::string name) const;
  
  void setValuesOntoGPUProgram(GPUProgram& prog) const;
  
public:
  
  
  GPUProgramState(const GPUProgramState* parentState):_parentState(parentState){}
  
  
  ~GPUProgramState(){
    for(std::map<std::string, GPUUniformValue*> ::const_iterator it = _uniformValues.begin();
        it != _uniformValues.end();
        it++){
      delete it->second;
    }
  }
  
  
  void setUniformValue(const std::string& name, bool b);
  
  void setUniformValue(const std::string& name, float f);
  
  void setUniformValue(const std::string& name, const Vector2D& v);
  
  void setUniformValue(const std::string& name, double x, double y, double z, double w);
  
  void setUniformValue(const std::string& name, const MutableMatrix44D& m);
  <commit_msg>Leak fixed<commit_after>//
//  GPUProgramState.h
//  G3MiOSSDK
//
//  Created by <NAME> on 05/04/13.
//
//

#ifndef __G3MiOSSDK__GPUProgramState__
#define __G3MiOSSDK__GPUProgramState__

#include <iostream>
#include <map>
#include <string>

#include "GPUUniform.hpp"
#include "GPUAttribute.hpp"
#include "GL.hpp"
#include "GPUProgram.hpp"
#include "MutableMatrix44D.hpp"

class GPUProgramState{
  
  std::map<std::string, GPUUniformValue*> _uniformValues;
  std::map<std::string, GPUAttributeValue*> _attributesValues;
  std::map<std::string, bool> _attributesEnabled;
  
  const GPUProgramState* _parentState;
  
  void setUniformValue(const std::string& name, GPUUniformValue* v);
  void setAttributeValue(const std::string& name, GPUAttributeValue* v);
  
  
  MutableMatrix44D* getMatrixValue(const std::string name) const;
  
  void setValuesOntoGPUProgram(GPUProgram& prog) const;
  
public:
  
  
  GPUProgramState(const GPUProgramState* parentState):_parentState(parentState){}
  
  
  ~GPUProgramState(){
    for(std::map<std::string, GPUUniformValue*> ::const_iterator it = _uniformValues.begin();
        it != _uniformValues.end();
        it++){
      delete it->second;
    }
    
    for(std::map<std::string, GPUAttributeValue*> ::const_iterator it = _attributesValues.begin();
        it != _attributesValues.end();
        it++){
      delete it->second;
    }
  }
  
  
  void setUniformValue(const std::string& name, bool b);
  
  void setUniformValue(const std::string& name, float f);
  
  void setUniformValue(const std::string& name, const Vector2D& v);
  
  void setUniformValue(const std::string& name, double x, double y, double z, double w);
  
  void setUniformValue(const std::string& name, const MutableMatrix44D& m);
  
{'fraction_non_alphanumeric': 0.12545235223160434, 'fraction_numerical': 0.009650180940892641, 'mean_word_length': 4.5191347753743765, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 23, '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': '1877338', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1086, 'n_words': 243}