[PLUGIN] Add plugin system

This commit is contained in:
tqchen
2016-01-12 11:56:22 -08:00
parent 36c389ac46
commit 96f4542a67
14 changed files with 457 additions and 13 deletions

View File

@@ -4,11 +4,14 @@
* Raw binary format of sparse page.
*/
#include <xgboost/data.h>
#include <dmlc/registry.h>
#include "./sparse_batch_page.h"
namespace xgboost {
namespace data {
DMLC_REGISTRY_FILE_TAG(sparse_page_raw_format);
class SparsePageRawFormat : public SparsePage::Format {
public:
bool Read(SparsePage* page, dmlc::SeekStream* fi) override {
@@ -73,7 +76,7 @@ class SparsePageRawFormat : public SparsePage::Format {
return true;
}
void Write(const SparsePage& page, dmlc::Stream* fo) const override {
void Write(const SparsePage& page, dmlc::Stream* fo) override {
CHECK(page.offset.size() != 0 && page.offset[0] == 0);
CHECK_EQ(page.offset.back(), page.data.size());
fo->Write(page.offset);