#pragma once #include "../../Netzwerk/Patcher.h" #include #include #include #include using namespace Framework; class Update : public Thread { private: Patcher *p; FBalken *fb; bool updateAbbrechen; int dg; std::function< void(bool) > after; public: // Konstruktor Update( Schrift *zSchrift, FBalken *fb, int dg, std::function< void(bool) > after = [](bool b){} ); // Destruktor ~Update(); // nicht constant void setPatcher( Patcher *p ); void abbrechen(); void herunterladen(); void thread() override; void threadEnd() override; // constant int getDateiGruppe() const; }; class UpdateHandler { private: Patcher *patcher; RCArray< Update > *updates; Critical cs; int ref; // privat void lock(); void unlock(); public: // Konstruktor UpdateHandler(); // Destruktor ~UpdateHandler(); // nicht constant bool add( Update *update ); void remove( int dg = 0 ); bool hat( int dg = 0 ); // Reference Counting UpdateHandler *getThis(); UpdateHandler *release(); };