Exemple #1
0
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");
		}

	}

}
 /** @brief Remove all elements from the vector leaving the
     *          partition_vector with size 0.
     */
 void clear()
 {
     partition_vector_.clear();
 }
 void initialize(size_t s, const char* name)
 {
   _data.clear();
   this->reserve(s);
   _outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"method"<<':'<<name<<','<<"params"<<':';
 }
 void initialize(size_t s)
 {
   _data.clear();
   this->reserve(s);
   _outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"result"<<':';
 }
 void clear(T&)
 {
   _data.clear();
 }
 /// Remove all elements from the vector leaving the
 /// partitioned_vector_partition with size 0.
 ///
 void clear()
 {
     partitioned_vector_partition_.clear();
 }
 /// Remove all elements from the vector leaving the
 /// partition_unordered_map with size 0.
 ///
 void clear()
 {
     partition_unordered_map_.clear();
 }