void abstract_broker::configure_read(connection_handle hdl, receive_policy::config cfg) { CAF_LOG_TRACE(CAF_ARG(hdl) << CAF_ARG(cfg)); auto x = by_id(hdl); if (x) x->configure_read(cfg); }
void nodeCollection::copyToVector(){ for(std::map<int, blackHoleNode*>::iterator it = nodeMap.begin(); it != nodeMap.end(); it++){ nodeVec.push_back(it->second); } std::sort(nodeVec.begin(), nodeVec.end(), by_id()); }
bool close(Handle hdl) { auto x = by_id(hdl); if (!x) return false; x->stop_reading(); return true; }
std::vector<char>& abstract_broker::wr_buf(connection_handle hdl) { auto x = by_id(hdl); if (!x) { CAF_LOG_ERROR("tried to access wr_buf() of an unknown connection_handle"); return dummy_wr_buf_; } return x->wr_buf(); }
bool test_work() { const int userId = add( adminName, adminPassword, adminEmail, cppcmsskel::results::User::Permission::admin ); cppcmsskel::results::User user = by_id(userId); return user.exists() && user.id == userId && user.name == adminName && user.permission == cppcmsskel::results::User::Permission::admin; }
void trigger(Handle hdl, size_t num_events) { auto ref = by_id(hdl); if (!ref) return; if (num_events > 0) { ref->trigger(num_events); } else { // if we have any number of activity tokens, ignore this call // otherwise (currently in unconditional receive state) halt auto x = ref->activity_tokens(); if (!x) ref->halt(); } }
bool test_not_work() { cppcmsskel::results::User user = by_id(42); return user.exists(); }
void abstract_broker::ack_writes(connection_handle hdl, bool enable) { CAF_LOG_TRACE(CAF_ARG(hdl) << CAF_ARG(enable)); auto x = by_id(hdl); if (x) x->ack_writes(enable); }
void abstract_broker::flush(connection_handle hdl) { auto x = by_id(hdl); if (x) x->flush(); }
void trigger(Handle hdl) { auto ref = by_id(hdl); if (ref) ref->trigger(); }
void halt(Handle hdl) { auto ref = by_id(hdl); if (ref) ref->halt(); }