acl  3.5.3.0
acl::connect_guard类 参考

#include <connect_pool.hpp>

+ 类 acl::connect_guard 继承关系图:
+ acl::connect_guard 的协作图:

Public 成员函数

 connect_guard (connect_pool &pool)
 
virtual ~connect_guard (void)
 
void set_keep (bool keep)
 
connect_clientpeek (void)
 

Protected 属性

bool keep_
 
connect_poolpool_
 
connect_clientconn_
 

额外继承的成员函数

- Protected 成员函数 继承自 acl::acl::noncopyable
 noncopyable ()
 
 ~noncopyable ()
 

详细描述

在文件 connect_pool.hpp219 行定义.

构造及析构函数说明

◆ connect_guard()

acl::connect_guard::connect_guard ( connect_pool pool)
inline

在文件 connect_pool.hpp222 行定义.

223  : keep_(true), pool_(pool), conn_(NULL)
224  {
225  }
connect_pool & pool_
connect_client * conn_

◆ ~connect_guard()

virtual acl::connect_guard::~connect_guard ( void  )
inlinevirtual

在文件 connect_pool.hpp227 行定义.

228  {
229  if (conn_)
230  pool_.put(conn_, keep_);
231  }
connect_pool & pool_
void put(connect_client *conn, bool keep=true)
connect_client * conn_

成员函数说明

◆ peek()

connect_client* acl::connect_guard::peek ( void  )
inline

在文件 connect_pool.hpp238 行定义.

239  {
240  conn_ = pool_.peek();
241  return conn_;
242  }
connect_pool & pool_
connect_client * peek(bool on=true)
connect_client * conn_

◆ set_keep()

void acl::connect_guard::set_keep ( bool  keep)
inline

在文件 connect_pool.hpp233 行定义.

234  {
235  keep_ = keep;
236  }

类成员变量说明

◆ conn_

connect_client* acl::connect_guard::conn_
protected

在文件 connect_pool.hpp247 行定义.

◆ keep_

bool acl::connect_guard::keep_
protected

在文件 connect_pool.hpp245 行定义.

◆ pool_

connect_pool& acl::connect_guard::pool_
protected

在文件 connect_pool.hpp246 行定义.


该类的文档由以下文件生成: