Files
IfcOpenShell/src/serializers/RocksDbSerializer.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1022 B
C++
Raw Normal View History

2025-08-26 12:54:04 +02:00
#ifndef ROCKSDBSERIALIZER_H
#define ROCKSDBSERIALIZER_H
#ifdef IFOPSH_WITH_ROCKSDB
#include "../serializers/serializers_api.h"
#include "../ifcgeom/Serializer.h"
2026-03-31 15:32:36 +02:00
#include "../ifcparse/file.h"
#include <rocksdb/db.h>
#include <string>
#include <vector>
class SERIALIZERS_API RocksDbSerializer : public Serializer {
private:
rocksdb::DB* db_;
std::string rocksdb_filename_;
2026-03-31 15:32:36 +02:00
std::variant<ifcopenshell::file*, std::string> file_;
ifcopenshell::file* output_file_;
std::vector<std::string> skip_supertypes_;
void write_streaming_();
public:
2026-03-31 15:32:36 +02:00
RocksDbSerializer(ifcopenshell::file* file, const std::string& rocksdb_filename);
RocksDbSerializer(const std::string& input_filename, const std::string& rocksdb_filename, bool stream, const std::vector<std::string>& skip_supertypes = {});
virtual ~RocksDbSerializer() {}
bool ready() { return true; }
void writeHeader() {}
void finalize();
2026-03-31 15:32:36 +02:00
void setFile(ifcopenshell::file*) { throw ifcopenshell::exception("Should be supplied on construction"); }
};
2025-08-26 12:54:04 +02:00
#endif
#endif