#ifndef FURVM_FWD_HPP #define FURVM_FWD_HPP #include // IWYU pragma: export #include // IWYU pragma: export #include #include /** * @brief Furlang's virtual machine. */ namespace furvm { /** * @brief A byte. * * There's nothing more to it. */ using byte = std::uint8_t; /** * @brief An offset into bytecode. */ using bytecode_pos = std::uint64_t; /** * @brief Handle header with reference count. */ template class refcount_header; /** * @brief Generic handle header. */ template class generic_header; /** * @brief Generic furvm object handle. * * @tparam Value Type of the handle's value. * @tparam Header Type of the handle's header. */ template class handle; /** * @brief Container for the handles. * * @tparam Handle Type of the container's handle. */ template class handle_container; // constant.hpp /** * @brief Constant index. * * An index to the constant in module's constant pool. */ using constant_index = std::uint16_t; /** * @enum constant_t * @brief Constant type. */ enum class constant_t : std::uint8_t; /** * @class constant * @brief Constant. */ class constant; // instruction.hpp /** * @enum instruction_t * @brief Furvm's instruction type. */ enum class instruction_t : byte; /** * @struct instruction * @brief Furvm's instruction. */ struct instruction; // function.hpp /** * @enum function_t * @brief Function type. */ enum class function_t : std::uint8_t; /** * @class function * @brief Function. * * A furvm function. */ class function; /** * @brief Furvm function's index. */ using function_id = std::uint16_t; /** * @brief A handle to a furvm function. */ using function_h = handle>; // module.hpp struct mod_type; using mod_type_id = std::uint32_t; using mod_type_h = handle>; /** * @class mod * @brief Module. * * A furvm module. Translation unit of furlang. */ class mod; /** * @brief An alias to a module shared pointer. */ using mod_p = std::shared_ptr; /** * @brief An alias for a module's identifier. */ using mod_id = std::string; /** * @brief A handle to a furvm module. */ using mod_h = handle>; // thing_allocator.hpp template class thing_allocator; // thing.hpp /** * @class bad_thing_access * @brief Bad thing access exception. */ class bad_thing_access; using thing_type_id = std::uint32_t; /** * @class thing * @brief Furvm thing. * * A stack element. Think of it like of a value in C++ or I guess a class in java. */ template