forb
Public Member Functions | List of all members
forbcc::entity Class Referenceabstract

Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables. More...

#include <entity.hpp>

Inheritance diagram for forbcc::entity:
forbcc::interface forbcc::method forbcc::module forbcc::type forbcc::variable forbcc::type_array forbcc::type_primitive forbcc::type_struct

Public Member Functions

 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 void print_declaration (code_ostream &out) const =0
 Prints the declaration of the given entity, if required.
 
virtual void print_definition (code_ostream &out) const =0
 Prints the definition of the given entity, if required.
 
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...
 

Detailed Description

Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables.

Constructor & Destructor Documentation

§ ~entity()

virtual forbcc::entity::~entity ( )
virtualdefault

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.

Also subclasses shall have virtual destructors

Member Function Documentation

§ codename()

virtual std::string forbcc::entity::codename ( ) const
inlinevirtual

Returns the codename of the given entity, which is the name of the entity as seen from the global scope.

This means that it is the codename of the parent entity followed by :: operator and the name of the given entity.

Reimplemented in forbcc::type_primitive.


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