feat(eosIO): added EosIO class to handle arbitrary eos data
EosIO class wraps all eos tables (like helm) so that they can be used in a more standard fashion
This commit is contained in:
34
src/eos/public/eosIO.h
Normal file
34
src/eos/public/eosIO.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef EOSIO_H
|
||||
#define EOSIO_H
|
||||
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
// EOS table format includes
|
||||
#include "helm.h"
|
||||
|
||||
using EOSTable = std::variant<
|
||||
std::unique_ptr<helmholtz::HELMTable>
|
||||
>;
|
||||
|
||||
class EosIO {
|
||||
private:
|
||||
std::string m_filename;
|
||||
bool m_loaded = false;
|
||||
std::string m_format;
|
||||
EOSTable m_table;
|
||||
void load();
|
||||
|
||||
// Loaders for each format, right now just HELM
|
||||
void loadHelm();
|
||||
public:
|
||||
EosIO(const std::string filename);
|
||||
~EosIO() = default;
|
||||
|
||||
std::string getFormat() const;
|
||||
|
||||
EOSTable& getTable();
|
||||
};
|
||||
|
||||
#endif // EOSIO_H
|
||||
Reference in New Issue
Block a user