9 constexpr
size_t max_stack_size = 16 * 1024;
17 enum class serialize {
30 type(
const std::shared_ptr<module> &parent,
const std::string &name) :
entity(parent, name) {};
35 ~
type()
override =
default;
47 type &operator=(
const type &) =
default;
52 virtual void print_var_declaration(
code_ostream &out,
const std::string &var_name)
const;
55 virtual void print_var_definition(
code_ostream &out,
const std::string &var_name,
bool force_stack)
const;
58 virtual void print_var_lvalue(
code_ostream &out,
const std::string &var_name,
bool force_stack)
const;
62 print_var_lvalue(out, var_name,
true);
66 virtual void print_var_reference(
code_ostream &out,
const std::string &var_name)
const;
69 virtual void print_var_marshal(
code_ostream &out,
const std::string &var_name,
70 const marshal &do_undo,
bool force_stack)
const;
74 print_var_marshal(out, var_name, do_undo,
true);
78 virtual void print_var_serialize(
code_ostream &out,
const std::string &var_name,
79 const serialize &do_undo,
bool force_stack)
const;
83 print_var_serialize(out, var_name, do_undo,
true);
87 virtual size_t size_of()
const = 0;
90 virtual size_t alignment()
const = 0;
95 #endif //FORBCC_TYPE_H type()
Empty type, used to preallocate types in arrays or to use later assignment operator.
Definition: type.hpp:27
void print_var_marshal(code_ostream &out, const std::string &var_name, const marshal &do_undo) const
Print the actions needed to either marshal or unmarshal a variable of this type.
Definition: type.hpp:73
void print_var_lvalue(code_ostream &out, const std::string &var_name) const
Print the acquisition of the value of a variable of this type.
Definition: type.hpp:61
void print_var_serialize(code_ostream &out, const std::string &var_name, const serialize &do_undo) const
Print the actions needed to either serialize or deserialize a variable of this type.
Definition: type.hpp:82
This output stream supports indentation of code lines, which are formatted at each std::endl...
Definition: code_ostream.hpp:14
type(const std::shared_ptr< module > &parent, const std::string &name)
Using constructors from superclass.
Definition: type.hpp:30
Definition: code_ostream.hpp:11
Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables.
Definition: entity.hpp:18
Base class used to define primitive types, custom types (structures) and arrays.
Definition: type.hpp:22