refactor: add bytecode to module
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
#ifndef FURVM_MODULE_HPP
|
||||
#define FURVM_MODULE_HPP
|
||||
|
||||
#include "furvm/fwd.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace furvm {
|
||||
|
||||
class mod {
|
||||
public:
|
||||
mod() = default;
|
||||
using bytecode_t = std::vector<byte>; /**< An alias to a vector of bytes. */
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new module.
|
||||
*
|
||||
* @param args Arguments to forward to bytecode's constructor.
|
||||
*/
|
||||
template <typename... Args, typename = std::enable_if_t<std::is_constructible_v<bytecode_t, Args...>>>
|
||||
mod(Args&&... args)
|
||||
: m_bytecode(std::forward<Args>(args)...) {}
|
||||
|
||||
~mod() = default;
|
||||
|
||||
/**
|
||||
@@ -21,6 +35,7 @@ public:
|
||||
mod(const mod&) = delete;
|
||||
mod& operator=(const mod&) = delete;
|
||||
private:
|
||||
bytecode_t m_bytecode;
|
||||
};
|
||||
|
||||
} // namespace furvm
|
||||
|
||||
Reference in New Issue
Block a user