forb
Public Member Functions | List of all members
forbcc::type_struct Class Reference

Structure types are basically structures defined by the user that can be transferred between library components. More...

#include <type_struct.hpp>

Inheritance diagram for forbcc::type_struct:
forbcc::type forbcc::shareable< type_struct > forbcc::ordered_unique_list< variable > forbcc::entity

Public Member Functions

 type_struct ()
 Empty structure type, used to preallocate variables in arrays or to use later assignment operator.
 
 type_struct (const std::shared_ptr< module > &parent, const std::string &name)
 Using constructors from superclass.
 
 ~type_struct () override=default
 This class is virtual, so it requires a virtual destructor.
 
 type_struct (type_struct &&)=default
 This class supports moving.
 
type_structoperator= (type_struct &&)=default
 This class supports moving.
 
 type_struct (const type_struct &)=default
 This class supports copying.
 
type_structoperator= (const type_struct &)=default
 This class supports copying.
 
void print_declaration (code_ostream &out) const override
 Custom types require a declaration of course.
 
void print_definition (code_ostream &out) const override
 Custom types define a partial specialization of the marshal/unmarshal templates.
 
bool insert (std::string key, const variable &value) override
 Wraps odered_unique_list::insert method adding a few operations to calculate structure size and alignment.
 
size_t size_of () const override
 Returns the size of the given type.
 
size_t alignment () const override
 Returns the alignment of the given type.
 
- Public Member Functions inherited from forbcc::type
 type ()
 Empty type, used to preallocate types in arrays or to use later assignment operator.
 
 type (const std::shared_ptr< module > &parent, const std::string &name)
 Using constructors from superclass.
 
 ~type () override=default
 This class is virtual, so it requires a virtual destructor.
 
 type (type &&)=default
 This class supports moving.
 
typeoperator= (type &&)=default
 This class supports moving.
 
 type (const type &)=default
 This class supports copying.
 
typeoperator= (const type &)=default
 This class supports copying.
 
virtual void print_var_declaration (code_ostream &out, const std::string &var_name) const
 Print the declaration of a variable of this type.
 
virtual void print_var_definition (code_ostream &out, const std::string &var_name, bool force_stack) const
 Print the definition of a variable of this type.
 
virtual void print_var_lvalue (code_ostream &out, const std::string &var_name, bool force_stack) const
 Print the acquisition of the value of a variable of this type.
 
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.
 
virtual void print_var_reference (code_ostream &out, const std::string &var_name) const
 Print the declaration of a reference to a variable of this type.
 
virtual void print_var_marshal (code_ostream &out, const std::string &var_name, const marshal &do_undo, bool force_stack) const
 Print the actions needed to either marshal or unmarshal a variable of this type.
 
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.
 
virtual void print_var_serialize (code_ostream &out, const std::string &var_name, const serialize &do_undo, bool force_stack) const
 Print the actions needed to either serialize or deserialize a variable of this type.
 
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.
 
- Public Member Functions inherited from forbcc::entity
 entity ()
 Constructs an empty entity, used to preallocate entity variables (like in arrays) and to later use the assignment operator to overwrite its content.
 
 entity (const std::shared_ptr< entity > &parent, const std::string &name)
 Constructs an entity within a given parent.
 
virtual ~entity ()=default
 Does nothing because the destructor of the shared_ptr handles all the stuff It's necessary for the destructor to be virtual because share_ptrs to subclasses shall be able to correctly destruct objects of the subclasses. More...
 
 entity (entity &&)=default
 This class supports moving.
 
entityoperator= (entity &&)=default
 This class supports moving.
 
 entity (const entity &)=default
 This class supports copying.
 
entityoperator= (const entity &)=default
 This class supports copying.
 
std::shared_ptr< entityparent () const
 Returns the parent of the given entity.
 
std::string name () const
 Returns the name of the given entity.
 
virtual std::string codename () const
 Returns the codename of the given entity, which is the name of the entity as seen from the global scope. More...
 
- Public Member Functions inherited from forbcc::ordered_unique_list< variable >
const list_tlist () const
 Returns a const reference to the list of the elements.
 
bool contains (std::string key) const
 Returns true if the given key is present within the set of keys.
 
variableoperator[] (std::string key)
 Returns a reference to an element from its key. More...
 
const_Toperator[] (std::string key) const
 Same as operator[](std::string), but returns a const_T instead, when used on a const reference to the list object. More...
 

Additional Inherited Members

- Public Types inherited from forbcc::shareable< type_struct >
using const_T = typename std::add_const< type_struct >::type
 Alias to the same type T, but with const qualifier.
 
using ptr_t = std::shared_ptr< type_struct >
 Alias to std::shared_ptr<T>
 
using ptr_const_t = std::shared_ptr< const_T >
 Alias to std::shared_ptr<const T>
 
- Public Types inherited from forbcc::ordered_unique_list< variable >
using set_t = std::map< std::string, int >
 The type of the set of keys, used to access the list.
 
using list_t = std::vector< variable >
 The type of the list.
 
using const_T = typename std::add_const< variable >::type
 Alias of the const version of the template type T.
 
- Static Public Member Functions inherited from forbcc::shareable< type_struct >
static ptr_t new_ptr (Args &&... args)
 Calls the constructor of the class with the given arguments to create a shared_pointer to T. More...
 
static ptr_const_t new_ptr_const (Args &&... args)
 Calls the constructor of the class with the given arguments to create a shared_pointer to a const T. More...
 

Detailed Description

Structure types are basically structures defined by the user that can be transferred between library components.


The documentation for this class was generated from the following files: