Skip to content
Snippets Groups Projects
Select Git revision
  • 4a0dc9133bd2067d429c783f8079cf8726a3118b
  • master default
  • 1.1
  • 1.0
4 results

compcache.h

Blame
  • compcache.h 693 B
    #include <string>
    #include <vector>
    #include <map>
    #include <complex>
    
    #include "eistype.h"
    
    namespace eis
    {
    
    std::string getTempdir();
    
    struct CompiledObject
    {
    	void* objectCode;
    	std::vector<std::complex<fvalue>>(*symbol)(const std::vector<fvalue>&, const std::vector<fvalue>&);
    };
    
    class CompCache
    {
    public:
    
    private:
    
    	inline static CompCache* instance = nullptr;
    	std::map<size_t, CompiledObject*> objects;
    	CompCache() {};
    
    public:
    
    	static CompCache* getInstance();
    	CompCache(const CompCache&) = delete;
    	CompCache& operator=(const CompCache&) = delete;
    	bool addObject(size_t uuid, const CompiledObject& object);
    	CompiledObject* getObject(size_t uuid);
    	void dropAllObjects();
    };
    
    }