| 110 | using Ptr = std::shared_ptr<ReqQueueMain>; |
| 111 | |
| 112 | ReqQueueMain(DBus::Connection::Ptr conn, |
| 113 | const std::string &path, |
| 114 | const std::string &interface, |
| 115 | std::shared_ptr<std::ostream> log_) |
| 116 | : DBus::Object::Base(path, interface), |
| 117 | dbuscon(conn), log(*log_) |
| 118 | { |
| 119 | queue = RequiresQueueDebug::Create(); |
| 120 | queue->QueueSetup(this, |
| 121 | "t_QueueCheckTypeGroup", |
| 122 | "t_QueueFetch", |
| 123 | "t_QueueCheck", |
| 124 | "t_ProvideResponse"); |
| 125 | queue->AddCallback( |
| 126 | RequiresQueue::CallbackType::CHECK_TYPE_GROUP, |
| 127 | [this]() |
| 128 | { |
| 129 | this->cb_counters[RequiresQueue::CallbackType::CHECK_TYPE_GROUP]++; |
| 130 | }); |
| 131 | queue->AddCallback( |
| 132 | RequiresQueue::CallbackType::QUEUE_CHECK, |
| 133 | [this]() |
| 134 | { |
| 135 | this->cb_counters[RequiresQueue::CallbackType::QUEUE_CHECK]++; |
| 136 | }); |
| 137 | queue->AddCallback( |
| 138 | RequiresQueue::CallbackType::QUEUE_FETCH, |
| 139 | [this]() |
| 140 | { |
| 141 | this->cb_counters[RequiresQueue::CallbackType::QUEUE_FETCH]++; |
| 142 | }); |
| 143 | queue->AddCallback( |
| 144 | RequiresQueue::CallbackType::PROVIDE_RESPONSE, |
| 145 | [this]() |
| 146 | { |
| 147 | this->cb_counters[RequiresQueue::CallbackType::PROVIDE_RESPONSE]++; |
| 148 | }); |
| 149 | |
| 150 | init(); |
| 151 | |
| 152 | AddMethod("ServerDumpResponse", |
| 153 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 154 | { |
| 155 | std::lock_guard<std::mutex> lg(init_mtx); |
| 156 | queue->_DumpQueue(log); |
| 157 | args->SetMethodReturn(nullptr); |
| 158 | }); |
| 159 | |
| 160 | AddMethod("Init", |
| 161 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 162 | { |
| 163 | this->init(); |
| 164 | args->SetMethodReturn(nullptr); |
| 165 | }); |
| 166 | |
| 167 | auto validate = AddMethod("Validate", |
| 168 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 169 | { |
nothing calls this directly
no test coverage detected