1 #ifndef FORBCC_PRIMITIVE_TYPE_H 2 #define FORBCC_PRIMITIVE_TYPE_H 4 #include <templates/shareable.hpp> 5 #include <types/type.hpp> 18 std::string actual_type;
35 class static_initializer {
42 static static_initializer _init;
51 :
type(nullptr, name), actual_type(actual_type), _size(size) {};
98 #endif //FORBCC_PRIMITIVE_TYPE_H void print_declaration(code_ostream &) const override
Does nothing, primitive types do not need to be declared.
Definition: type_primitive.hpp:73
~type_primitive() override=default
This class is virtual, so it requires a virtual destructor.
std::string codename() const final
The codename for primitive types is defined by their actual type.
Definition: type_primitive.hpp:79
A template that can be used to declare a list of unique ordered items.
Definition: ordered_unique_list.hpp:16
static type_primitive_list known_types
The list of all known primitive types.
Definition: type_primitive.hpp:31
size_t alignment() const override
Returns the alignment of the given type.
Definition: type_primitive.hpp:89
A template that can be used to ease the declaration of a shared_pointer of a given type...
Definition: shareable.hpp:13
type_primitive & operator=(type_primitive &&)=default
This class supports moving.
void print_definition(code_ostream &) const override
Does nothing, primitive types do not need to be defined.
Definition: type_primitive.hpp:76
std::string name() const
Returns the name of the given entity.
Definition: entity.hpp:68
This output stream supports indentation of code lines, which are formatted at each std::endl...
Definition: code_ostream.hpp:14
type_primitive(const std::string &name, const std::string &actual_type, const size_t size)
Each primitive types corresponds to an actual type with fixed size.
Definition: type_primitive.hpp:50
Definition: code_ostream.hpp:11
Identifies one of the primitive types recognized by the library when parsing a FORB IDL file...
Definition: type_primitive.hpp:12
Base class used to define primitive types, custom types (structures) and arrays.
Definition: type.hpp:22
type_primitive()
Empty primitive type, used to preallocate variables in arrays or to use later assignment operator...
Definition: type_primitive.hpp:47
size_t size_of() const override
The size of the given type.
Definition: type_primitive.hpp:84