コード例 #1
0
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);
}
コード例 #2
0
ファイル: nodeCollection.cpp プロジェクト: jaegil/BlackHole
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());
}
コード例 #3
0
 bool close(Handle hdl) {
   auto x = by_id(hdl);
   if (!x)
     return false;
   x->stop_reading();
   return true;
 }
コード例 #4
0
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();
}
コード例 #5
0
ファイル: test.cpp プロジェクト: Tatoeba/cppcms-skeleton
        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;
        }
コード例 #6
0
 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();
   }
 }
コード例 #7
0
ファイル: test.cpp プロジェクト: Tatoeba/cppcms-skeleton
 bool test_not_work() {
     cppcmsskel::results::User user = by_id(42);
     return user.exists();
 }
コード例 #8
0
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);
}
コード例 #9
0
void abstract_broker::flush(connection_handle hdl) {
  auto x = by_id(hdl);
  if (x)
    x->flush();
}
コード例 #10
0
 void trigger(Handle hdl) {
   auto ref = by_id(hdl);
   if (ref)
     ref->trigger();
 }
コード例 #11
0
 void halt(Handle hdl) {
   auto ref = by_id(hdl);
   if (ref)
     ref->halt();
 }