include/RelationalWriter.h
author František Kučera <franta-hg@frantovo.cz>
Sun, 22 Jul 2018 17:19:25 +0200
branchv_0
changeset 16 3613617d3076
parent 15 8fd6c4d44071
child 17 f2cccaa9dd38
permissions -rw-r--r--
writeAttribute() with raw pointer and type_info

#pragma once

#include <string>
#include <iostream>
#include <vector>

#include "typedefs.h"
#include "TypeId.h"

namespace relpipe {
namespace writer {

class RelationalWriter {
public:

	virtual ~RelationalWriter() = default;

	virtual TypeId toTypeId(const string_t typeCode) = 0;

	virtual string_t toTypeCode(const TypeId typeId) = 0;

	virtual void startRelation(string_t name, std::vector<std::pair<string_t, TypeId>> attributes, boolean_t writeHeader) = 0;

	virtual void writeRecord(std::vector<string_t> attributes) = 0;
	
	// TODO: write bitmap + attribute:
	// virtual void writeBitmap(...) = 0;
	// virtual void writeAttribute(string_t attribute) = 0;
	
	virtual void writeAttribute(const void* value, const std::type_info& type) = 0;

};

}
}