/* */ #ifndef ALGEBRAS_DISTRIBUTED3_TESMANAGER_H_ #define ALGEBRAS_DISTRIBUTED3_TESMANAGER_H_ //#include "../DArrayElement.h" #include "Helpers/WorkerConfig.h" #include "Helpers/RemoteEndpoint.h" #include "Algebras/Distributed2/DArrayElement.h" #include "typedefs.h" namespace distributed3 { class TESManager { private: TESManager() {} static TESManager manager; static int exchangeId; std::vector workers = std::vector{}; public: static TESManager& getInstance(); static bool equalWorkers( const std::vector tesWorkers, const std::vector& workers); ~TESManager(); void reset(); std::vector& getWorkerVector(); supplier getWorkers(); int numOfWorkers(); void addWorker(WorkerConfig worker);// noexcept(false); /* true if worker exists with same endpoint or same host and messageServerPort */ bool workerExists(RemoteEndpoint& endpoint, int messageServerPort); std::ostream& print(std::ostream& os) const{ os << " routes: " << workers.size() << std::endl; for (auto& worker : workers) { worker.print(os) << std::endl; } return os; } int getExchangeID(); }; } /* namespace distributed3 */ #endif /* ALGEBRAS_DISTRIBUTED3_TESMANAGER_H_ */