#include <stdexcept>
#include "buffer.h"
#include "bufferable.h"
+#include "error.h"
using namespace std;
return last->offset+last->get_data_size();
}
-Bufferable::AsyncUpdater *Bufferable::refresh_async() const
-{
- return dirty ? new AsyncUpdater(*this) : 0;
-}
-
void Bufferable::unlink_from_buffer()
{
if(prev_in_buffer)
void Bufferable::upload_data(char *target) const
{
+ if(!buffer)
+ throw invalid_operation("Bufferable::upload_data");
+
unsigned data_size = get_data_size();
if(location_dirty)
{
buffer->require_size(offset+data_size);
- location_changed(buffer, offset, data_size);
location_dirty = false;
}