public: \r
\r
template<typename Func>\r
- static void begin_invoke(Func&& func) // noexcept\r
+ static void begin_invoke(Func&& func, task_priority priority) // noexcept\r
{ \r
- if(get_instance().executor_.size() < 1024)\r
- get_instance().executor_.begin_invoke(std::forward<Func>(func)); \r
+ if(get_instance().executor_.size() < 128)\r
+ get_instance().executor_.begin_invoke(std::forward<Func>(func), priority); \r
}\r
\r
static void register_drawable(const std::shared_ptr<drawable>& drawable)\r
begin_invoke([=]\r
{\r
get_instance().do_register_drawable(drawable);\r
- });\r
+ }, high_priority);\r
}\r
\r
static void show(bool value)\r
begin_invoke([=]\r
{ \r
get_instance().do_show(value);\r
- });\r
+ }, high_priority);\r
}\r
\r
private:\r
\r
if(!tick_data_.empty())\r
{\r
- float sum = *std::max_element(tick_data_.begin(), tick_data_.end()) + std::numeric_limits<float>::min();\r
+ float sum = std::accumulate(tick_data_.begin(), tick_data_.end(), 0.0) + std::numeric_limits<float>::min();\r
line_data_.push_back(std::make_pair(static_cast<float>(sum)/static_cast<float>(tick_data_.size()), tick_tag_));\r
tick_data_.clear();\r
}\r
context::begin_invoke([=]\r
{ \r
p->set_text(value);\r
- });\r
+ }, high_priority);\r
}\r
\r
void graph::set_text(const std::wstring& value)\r
{\r
- set_text(narrow(value));\r
+ auto p = impl_;\r
+ context::begin_invoke([=]\r
+ { \r
+ set_text(narrow(value));\r
+ }, high_priority);\r
}\r
\r
void graph::update_value(const std::string& name, double value)\r
context::begin_invoke([=]\r
{ \r
p->update(name, value);\r
- });\r
+ }, high_priority);\r
}\r
void graph::set_value(const std::string& name, double value)\r
{ \r
context::begin_invoke([=]\r
{ \r
p->set(name, value);\r
- }); \r
+ }, high_priority); \r
}\r
void graph::set_color(const std::string& name, color c)\r
{ \r
context::begin_invoke([=]\r
{ \r
p->set_color(name, c);\r
- });\r
+ }, high_priority);\r
}\r
void graph::add_tag(const std::string& name)\r
{ \r
context::begin_invoke([=]\r
{ \r
p->tag(name);\r
- });\r
+ }, high_priority);\r
}\r
void graph::add_guide(const std::string& name, double value)\r
{ \r
context::begin_invoke([=]\r
{ \r
p->guide(name, value);\r
- });\r
+ }, high_priority);\r
}\r
\r
void register_graph(const safe_ptr<graph>& graph)\r