Esempio n. 1
0
	void RemoteContainerManager::ReceiveDataAnswer(vector<string>::iterator begin, vector<string>::iterator end, ProtocolAnswer* answer)
	{
		size_t fieldsTotalSize;
		vector<FieldInfo> fields;

		pair_assign(fields, fieldsTotalSize) = ExtractFieldSet(begin, end);

		if(response_.size() < fieldsTotalSize)
			asio::read(socket_, response_, asio::transfer_at_least(fieldsTotalSize - response_.size()));

		BOOST_ASSERT(response_.size() >= fieldsTotalSize);

		ExtractFieldsFromBuffer(
			fields, 
			asio::buffer_cast<const void*>(response_.data()),
			fieldsTotalSize,
			&answer->key, &answer->value, &answer->metadata);

		response_.consume(fieldsTotalSize);

		return;
	}
Esempio n. 2
0
void _type_copy_pair(const void* cpv_first, const void* cpv_second, void* pv_output)
{
    assert(cpv_first != NULL && cpv_second != NULL && pv_output != NULL);
    pair_assign((pair_t*)cpv_first, (pair_t*)cpv_second);
    *(bool_t*)pv_output = true;
}