| 78 | FreqMan::~FreqMan() {} |
| 79 | |
| 80 | comm::RetCode FreqMan::Init(const int topic_id, Consumer *consumer) { |
| 81 | impl_->topic_id = topic_id; |
| 82 | impl_->consumer = consumer; |
| 83 | |
| 84 | impl_->last_update_time = comm::utils::Time::GetSteadyClockMS(); |
| 85 | |
| 86 | impl_->shm = (FreqManShm_t *)mmap(nullptr, sizeof(FreqManShm_t), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); |
| 87 | if (MAP_FAILED == impl_->shm) { |
| 88 | QLErr("mmap failed %s", strerror(errno)); |
| 89 | return comm::RetCode::RET_ERR_SYS; |
| 90 | } |
| 91 | memset(impl_->shm, 0, sizeof(FreqManShm_t)); |
| 92 | |
| 93 | return comm::RetCode::RET_OK; |
| 94 | } |
| 95 | |
| 96 | static void ClearConsumeStat(ConsumeStat_t &consume_stat, const int nhandle_id) { |
| 97 | consume_stat.nget = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected