acq_task.cpp 630 B

12345678910111213141516171819202122
  1. #include "acq_task.h"
  2. namespace iot_acq {
  3. void AcqTask::OnEvent(void* args) {}
  4. void AcqTask::OnTimer(void* args) {
  5. for (auto &pair : mapRpc_) {
  6. std::shared_ptr<leoyun::YunRpc> rpc = pair.second;
  7. if (rpc == nullptr) {
  8. HTELINK_LOG_INFO("sth error about %s", pair.first.c_str());
  9. continue;
  10. }
  11. rpc->Run();
  12. }
  13. }
  14. void AcqTask::OnShot(void* args) {}
  15. void AcqTask::PushRpc(const std::string& name,
  16. std::shared_ptr<leoyun::YunRpc> rpc) {
  17. mapRpc_.insert(std::pair<std::string, std::shared_ptr<leoyun::YunRpc>>(name, rpc));
  18. }
  19. } // namespace iot_acq