1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-20 17:31:44 +02:00
openrw/rwengine/include/loaders/DataLoader.hpp

42 lines
776 B
C++
Raw Normal View History

2014-06-04 07:02:41 +02:00
#pragma once
#ifndef _DATALOADER_HPP_
#define _DATALOADER_HPP_
#include <iostream>
2014-06-04 12:53:11 +02:00
class WorkContext;
2014-06-04 07:02:41 +02:00
class DataLoader
{
2014-06-04 12:53:11 +02:00
WorkContext* _context;
2014-06-04 07:02:41 +02:00
public:
2014-06-04 12:53:11 +02:00
DataLoader(WorkContext* context)
2014-06-04 07:02:41 +02:00
: _context(context) {}
virtual ~DataLoader() {}
/**
* @brief getContext
* @return The loading context for this Loader
*/
2014-06-04 12:53:11 +02:00
WorkContext* getContext() const { return _context; }
2014-06-04 07:02:41 +02:00
/**
* @brief load the data contained in a set of bytes
* @param data The bytes from which to load data.
* @param size The number of bytes.
* @return true if the data was valid and loaded, false otherwise.
*/
virtual bool load( const char* data, size_t size ) = 0;
/**
* @brief create perform any after-load activitiy that is required.
*/
virtual void create() = 0;
};
#endif