- MainThread* main() { return static_cast<MainThread*>(at(0)); }
- void start_thinking(const Position&, const Search::LimitsType&, Search::StateStackPtr&);
- void read_uci_options();
- int64_t nodes_searched();
+ auto cbegin() const noexcept { return threads.cbegin(); }
+ auto begin() noexcept { return threads.begin(); }
+ auto end() noexcept { return threads.end(); }
+ auto cend() const noexcept { return threads.cend(); }
+ auto size() const noexcept { return threads.size(); }
+ auto empty() const noexcept { return threads.empty(); }
+
+private:
+ StateListPtr setupStates;
+ std::vector<Thread*> threads;
+
+ uint64_t accumulate(std::atomic<uint64_t> Thread::* member) const {
+
+ uint64_t sum = 0;
+ for (Thread* th : threads)
+ sum += (th->*member).load(std::memory_order_relaxed);
+ return sum;
+ }