本文整理汇总了C++中boost::ptr_vector::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ptr_vector::clear方法的具体用法?C++ ptr_vector::clear怎么用?C++ ptr_vector::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::ptr_vector
的用法示例。
在下文中一共展示了ptr_vector::clear方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: close_request
inline void command::close_request()
{
if (lib::error(m_req)) return;
m_cols.clear();
int req(CCI_ER_REQ_HANDLE); std::swap(m_req, req);
lib::singleton().p_cci_close_req_handle(req);
}
示例2: close_stmt
inline void command::close_stmt()
{
if (!m_stmt) return;
m_binds.clear();
m_cols.clear();
MYSQL_STMT* stmt(0); std::swap(stmt, m_stmt);
lib::singleton().p_mysql_stmt_close(stmt);
}
示例3: dumpImageProperties
void dumpImageProperties( boost::ptr_vector<sp::FileObject>& listing )
{
BOOST_FOREACH( const sp::FileObject& sequence, listing )
{
switch( sequence.getMaskType () )
{
case sp::eMaskTypeSequence : dumpImageProperties( static_cast<const sp::Sequence&>( sequence ) ); break;
case sp::eMaskTypeFile : dumpImageProperties( static_cast<const sp::File&>( sequence ) ); break;
case sp::eMaskTypeDirectory : break;
case sp::eMaskTypeUndefined : break;
}
}
listing.clear();
}
示例4: count
inline std::vector<std::string> command::columns()
{
using namespace std;
using namespace brig::unicode;
vector<string> cols;
if (0 == m_hnd.stmt) return cols;
m_cols.clear();
ub4 count(0);
m_hnd.check(lib::singleton().p_OCIAttrGet(m_hnd.stmt, OCI_HTYPE_STMT, &count, 0, OCI_ATTR_PARAM_COUNT, m_hnd.err));
for (ub4 i(0); i < count; ++i)
{
OCIParam *dsc(0);
m_hnd.check(lib::singleton().p_OCIParamGet(m_hnd.stmt, OCI_HTYPE_STMT, m_hnd.err, (void**)&dsc, i + 1));
try
{
ub2 data_type(0), size(0);
sb2 precision(0);
sb1 scale(-1);
ub1 charset_form(SQLCS_NCHAR);
utext *name(0), *nty_schema(0), *nty(0);
ub4 name_len(0), nty_schema_len(0), nty_len(0);
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &name, &name_len, OCI_ATTR_NAME, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &data_type, 0, OCI_ATTR_DATA_TYPE, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &size, 0, OCI_ATTR_DATA_SIZE, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &precision, 0, OCI_ATTR_PRECISION, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &charset_form, 0, OCI_ATTR_CHARSET_FORM, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &nty_schema, &nty_schema_len, OCI_ATTR_SCHEMA_NAME, m_hnd.err));
m_hnd.check(lib::singleton().p_OCIAttrGet(dsc, OCI_DTYPE_PARAM, &nty, &nty_len, OCI_ATTR_TYPE_NAME, m_hnd.err));
identifier nty_lcase = { transform<char>(nty_schema, lower_case), transform<char>(nty, lower_case), "" };
m_cols.push_back(define_factory(&m_hnd, i + 1, data_type, size, precision, scale, charset_form, nty_lcase));
cols.push_back(transform<char>(name));
}
catch (const exception&) { handles::free_descriptor((void**)&dsc, OCI_DTYPE_PARAM); throw; }
handles::free_descriptor((void**)&dsc, OCI_DTYPE_PARAM);
}
ub4 rows = ub4(PageSize);
m_hnd.check(lib::singleton().p_OCIAttrSet(m_hnd.stmt, OCI_HTYPE_STMT, &rows, 0, OCI_ATTR_PREFETCH_ROWS, m_hnd.err));
return cols;
}
示例5: GetAll
void GetAll(boost::ptr_vector<acl::Group>& groups)
{
groups.clear();
QueryResults results;
mongo::Query query;
boost::unique_future<bool> future;
TaskPtr task(new db::Select("groups", query, results, future));
Pool::Queue(task);
future.wait();
if (results.size() == 0) return;
for (auto& obj: results)
groups.push_back(bson::Group::Unserialize(obj));
}
示例6: col_count
inline std::vector<std::string> command::columns()
{
std::vector<std::string> cols;
if (lib::error(m_req)) return cols;
m_cols.clear();
T_CCI_SQLX_CMD cmd_type;
int col_count(0);
T_CCI_COL_INFO* col_info(lib::singleton().p_cci_get_result_info(m_req, &cmd_type, &col_count));
if (!col_info) throw std::runtime_error("CUBRID error");
for (int i(1); i <= col_count; ++i)
{
m_cols.push_back(get_data_factory(CCI_GET_RESULT_INFO_TYPE(col_info, i)));
cols.push_back(CCI_GET_RESULT_INFO_NAME(col_info, i));
}
return cols;
}
示例7: res
inline std::vector<std::string> command::columns()
{
std::vector<std::string> cols;
if (!m_stmt) return cols;
m_binds.clear();
m_cols.clear();
MYSQL_RES* res(lib::singleton().p_mysql_stmt_result_metadata(m_stmt));
check(res != 0);
const unsigned int count(lib::singleton().p_mysql_num_fields(res));
m_binds.resize(count);
memset(m_binds.data(), 0, m_binds.size() * sizeof(MYSQL_BIND));
for (unsigned int i(0); i < count; ++i)
{
MYSQL_FIELD* field(lib::singleton().p_mysql_fetch_field_direct(res, i));
m_cols.push_back(bind_result_factory(field, m_binds[i]));
cols.push_back(field->name);
}
lib::singleton().p_mysql_free_result(res);
check(lib::singleton().p_mysql_stmt_bind_result(m_stmt, m_binds.data()) == 0);
return cols;
}
示例8: close_stmt
inline void command::close_stmt()
{
m_cols.clear();
handles::free_handle((void**)&m_hnd.stmt, OCI_HTYPE_STMT);
}
示例9: CreateProcesses
void CreateProcesses(void)
{
process_list.clear();
boost::mpl::for_each<ProcessList>(boost::ref(*this));
}