本文整理汇总了C++中data_type::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ data_type::clear方法的具体用法?C++ data_type::clear怎么用?C++ data_type::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data_type
的用法示例。
在下文中一共展示了data_type::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_data
void session_interface::load_data(data_type &data,std::string const &s)
{
data.clear();
char const *begin=s.data(),*end=begin+s.size();
while(begin < end) {
packed p(begin,end);
begin +=sizeof(p);
if(end - begin >= int(p.key_size + p.data_size)) {
string key(begin,begin+p.key_size);
begin+=p.key_size;
string val(begin,begin+p.data_size);
begin+=p.data_size;
entry &ent=data[key];
ent.exposed = p.exposed;
ent.value.swap(val);
}
else {
throw cppcms_error("sessions::format violation data");
}
}
}
示例2: clear
/** @brief Remove all elements from the vector leaving the
* partition_vector with size 0.
*/
void clear()
{
partition_vector_.clear();
}
示例3: initialize
void initialize(size_t s, const char* name)
{
_data.clear();
this->reserve(s);
_outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"method"<<':'<<name<<','<<"params"<<':';
}
示例4: clear
void clear(T&)
{
_data.clear();
}
示例5: clear
/// Remove all elements from the vector leaving the
/// partitioned_vector_partition with size 0.
///
void clear()
{
partitioned_vector_partition_.clear();
}
示例6: clear
/// Remove all elements from the vector leaving the
/// partition_unordered_map with size 0.
///
void clear()
{
partition_unordered_map_.clear();
}