/* * SimpleThread.h * */ #ifndef FHEOFFLINE_SIMPLEGENERATOR_H_ #define FHEOFFLINE_SIMPLEGENERATOR_H_ #include "Networking/Player.h" #include "FHEOffline/SimpleEncCommit.h" #include "FHEOffline/DataSetup.h" #include "FHEOffline/Producer.h" #include "FHEOffline/SimpleDistDecrypt.h" #include "Processor/Data_Files.h" class SimpleMachine; class MultiplicativeMachineParams; class GeneratorBase { Player* player; protected: int thread_num; public: Player& P; pthread_t thread; long long total; map timers; GeneratorBase(int thread_num, const Names& N, Player* player = 0) : player(player ? 0 : new PlainPlayer(N, to_string(thread_num))), thread_num(thread_num), P(player ? *player : *this->player), thread(0), total(0) { } virtual ~GeneratorBase() { if (player) delete player; } virtual void run() = 0; virtual size_t report_size(ReportType type) = 0; virtual void report_size(ReportType type, MemoryUsage& res) = 0; virtual size_t report_sent() = 0; int get_thread_num() const { return thread_num; } }; template