Rename TimerGeneric to TimerOroApi
It's not *that* generic, it's really meant to only work with oro::Api methods
This commit is contained in:
parent
5bf036f056
commit
9bb2efb2ee
2 changed files with 8 additions and 8 deletions
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "evloop.hpp"
|
#include "evloop.hpp"
|
||||||
#include "timer_generic.hpp"
|
#include "timer_oro_api.hpp"
|
||||||
#include "eventia/eventia.hpp"
|
#include "eventia/eventia.hpp"
|
||||||
#include "roar11/ThreadPool.hpp"
|
#include "roar11/ThreadPool.hpp"
|
||||||
#include "oro/api.hpp"
|
#include "oro/api.hpp"
|
||||||
|
@ -44,9 +44,9 @@ void join(roar11::ThreadPool& pool) {
|
||||||
} //unnamed namespace
|
} //unnamed namespace
|
||||||
|
|
||||||
void test(oro::Api* api, oro::OriginsDB* db) {
|
void test(oro::Api* api, oro::OriginsDB* db) {
|
||||||
typedef TimerGeneric<&oro::Api::market_list> TimerShops;
|
typedef TimerOroApi<&oro::Api::market_list> TimerShops;
|
||||||
typedef TimerGeneric<&oro::Api::items_list> TimerItems;
|
typedef TimerOroApi<&oro::Api::items_list> TimerItems;
|
||||||
typedef TimerGeneric<&oro::Api::items_icons> TimerIcons;
|
typedef TimerOroApi<&oro::Api::items_icons> TimerIcons;
|
||||||
|
|
||||||
const std::size_t thread_count = 2U; //std::min(std::max(3U, std::thread::hardware_concurrency()) - 1, 4U);
|
const std::size_t thread_count = 2U; //std::min(std::max(3U, std::thread::hardware_concurrency()) - 1, 4U);
|
||||||
std::cout << "Running with " << thread_count << " worker threads\n";
|
std::cout << "Running with " << thread_count << " worker threads\n";
|
||||||
|
|
|
@ -26,9 +26,9 @@ namespace oro {
|
||||||
namespace duck {
|
namespace duck {
|
||||||
|
|
||||||
template<auto Method>
|
template<auto Method>
|
||||||
class TimerGeneric : TimerBase {
|
class TimerOroApi : TimerBase {
|
||||||
public:
|
public:
|
||||||
TimerGeneric (
|
TimerOroApi (
|
||||||
const eve::Context& ctx,
|
const eve::Context& ctx,
|
||||||
double timeout,
|
double timeout,
|
||||||
roar11::ThreadPool* pool,
|
roar11::ThreadPool* pool,
|
||||||
|
@ -41,7 +41,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<auto Method>
|
template<auto Method>
|
||||||
inline TimerGeneric<Method>::TimerGeneric (
|
inline TimerOroApi<Method>::TimerOroApi (
|
||||||
const eve::Context& ctx,
|
const eve::Context& ctx,
|
||||||
double timeout,
|
double timeout,
|
||||||
roar11::ThreadPool* pool,
|
roar11::ThreadPool* pool,
|
||||||
|
@ -53,7 +53,7 @@ inline TimerGeneric<Method>::TimerGeneric (
|
||||||
}
|
}
|
||||||
|
|
||||||
template<auto Method>
|
template<auto Method>
|
||||||
inline void TimerGeneric<Method>::fetch_data() {
|
inline void TimerOroApi<Method>::fetch_data() {
|
||||||
auto results = (oro_api().*Method)();
|
auto results = (oro_api().*Method)();
|
||||||
set_next_timer(results.first);
|
set_next_timer(results.first);
|
||||||
this->update_db(results.second);
|
this->update_db(results.second);
|
Loading…
Add table
Reference in a new issue