|
Bash++
Bash++ compiler internal documentation
|
A method in a class. More...
#include <bpp_method.h>


Public Member Functions | |
| virtual bool | add_parameter (std::shared_ptr< bpp_method_parameter > parameter) |
| Add a parameter to the method. | |
| void | set_scope (bpp_scope scope) |
| void | set_virtual (bool is_virtual) |
| void | set_overridable (bool is_overridable) |
| void | set_inherited (bool is_inherited) |
| void | set_last_override (const std::string &class_name) |
| void | set_overridden_method (std::weak_ptr< bpp_method > method) |
| bool | add_object (std::shared_ptr< bpp_object > object, bool make_local) override |
| Add an object to the code entity. | |
| std::vector< std::shared_ptr< bpp_method_parameter > > | get_parameters () const |
| bpp_scope | get_scope () const |
| bool | is_virtual () const |
| bool | is_overridable () const |
| bool | is_inherited () const |
| std::string | get_last_override () const |
Public Member Functions inherited from bpp::bpp_code_entity | |
| virtual void | add_code (const std::string &code, bool add_newline=true) |
| Add code to the code entity. | |
| virtual void | add_code_to_previous_line (const std::string &code) |
| Add code to the code entity's pre-code buffer. | |
| virtual void | add_code_to_next_line (const std::string &code) |
| Add code to the code entity's post-code buffer. | |
| virtual void | flush_nextline_buffer () |
| virtual void | flush_postline_buffer () |
| virtual void | flush_code_buffers () |
| virtual void | clear_all_buffers () |
| void | destruct_local_objects (std::shared_ptr< bpp_program > program) |
| Destruct all local objects in the code entity. | |
| virtual std::string | get_code () const |
| Return the contents of the main code buffer as a string. | |
| virtual std::string | get_pre_code () const |
| Return the contents of the pre-code buffer as a string. | |
| virtual std::string | get_post_code () const |
| Return the contents of the post-code buffer as a string. | |
| void | set_requires_perfect_forwarding (bool require) |
| bool | get_requires_perfect_forwarding () const |
| void | adopt (std::shared_ptr< bpp_entity > entity) |
| Take ownership of all local objects in another entity, by moving them into this entity's local object map. | |
Public Member Functions inherited from bpp::bpp_entity | |
| bpp_entity ()=default | |
| virtual | ~bpp_entity ()=default |
| bpp_entity (const bpp_entity &other)=default | |
| bpp_entity & | operator= (const bpp_entity &other)=default |
| bpp_entity (bpp_entity &&other) noexcept=default | |
| bpp_entity & | operator= (bpp_entity &&other) noexcept=default |
| virtual std::shared_ptr< bpp_class > | get_class () |
| virtual std::string | get_address () const |
| virtual void | set_name (const std::string &name) |
| virtual std::string | get_name () const |
| virtual std::weak_ptr< bpp::bpp_class > | get_containing_class () |
| Get the class which contains this entity. | |
| virtual std::weak_ptr< bpp_program > | get_containing_program () |
| virtual bool | set_containing_class (std::weak_ptr< bpp::bpp_class > containing_class) |
| void | inherit (std::shared_ptr< bpp_entity > parent) |
| Inherit from a parent entity. | |
| void | inherit (std::shared_ptr< bpp_program > program) |
| virtual void | inherit (std::shared_ptr< bpp_class > parent) |
| void | set_definition_position (const std::string &file, uint64_t line, uint64_t column) |
| void | add_reference (const std::string &file, uint64_t line, uint64_t column) |
| bpp::SymbolPosition | get_initial_definition () const |
| std::list< bpp::SymbolPosition > | get_references () const |
| virtual std::shared_ptr< bpp_class > | get_class (const std::string &name, size_t max_visible_index=SIZE_MAX) |
| std::shared_ptr< bpp_object > | get_object (const std::string &name, size_t max_visible_index=SIZE_MAX) |
| virtual std::vector< std::shared_ptr< bpp_class > > | get_all_known_classes () const |
| virtual std::vector< std::shared_ptr< bpp_object > > | get_all_known_objects () const |
| const OwnedEntityList< bpp_object > & | get_local_objects () const |
| std::shared_ptr< bpp_class > | get_parent () const |
| size_t | number_of_known_objects () const |
| virtual size_t | number_of_known_classes () const |
Private Member Functions | |
| bool | add_object_as_parameter (std::shared_ptr< bpp_object > object) |
| Add a pointer to a non-primitive object as a parameter to the method. | |
Private Attributes | |
| std::vector< std::shared_ptr< bpp_method_parameter > > | parameters |
| bpp_scope | scope = bpp_scope::SCOPE_PUBLIC |
| bool | m_is_virtual = false |
| bool | m_is_overridable = false |
| bool | inherited = false |
| std::string | last_override |
Additional Inherited Members | |
Protected Attributes inherited from bpp::bpp_code_entity | |
| std::shared_ptr< std::ostream > | code = std::make_shared<std::ostringstream>() |
| std::string | nextline_buffer |
| std::string | postline_buffer |
| bool | buffers_flushed = false |
| bool | requires_perfect_forwarding = false |
| Signals to bash_command_sequence entities whether they should operate in perfect forwarding mode I.e., whether this entity has special need to separate its pre- and post-code from its main code. | |
Protected Attributes inherited from bpp::bpp_entity | |
| std::string | name |
| OwnedEntityList< bpp_object > | local_objects |
| size_t | parent_visible_object_count_at_creation = 0 |
| size_t | program_visible_class_count_at_creation = 0 |
| std::weak_ptr< bpp_class > | type |
| std::weak_ptr< bpp_class > | containing_class |
| std::weak_ptr< bpp_program > | containing_program |
| std::vector< std::weak_ptr< bpp_class > > | parents |
| For classes: the list of parent classes, in order. | |
| std::weak_ptr< bpp_entity > | parent_entity |
| For all entities (except program), the parent entity from which this entity inherits. | |
| std::weak_ptr< bpp_method > | overridden_method |
| bpp::SymbolPosition | initial_definition |
| std::list< bpp::SymbolPosition > | references |
A method in a class.
|
overridevirtual |
Add an object to the code entity.
Adding an object to a code entity involves adding the necessary code to create the object. Unlike in the case where we add an object to a non-code entity, where we only need to update the object map.
This function generates the code necessary to create the object, including calling its constructor if it exists.
| object | The object to add |
Reimplemented from bpp::bpp_code_entity.
|
private |
Add a pointer to a non-primitive object as a parameter to the method.
This function ensures that code within the scope of the method is able to access an object passed as an argument to the method, by adding the object to the local_objects map.
|
virtual |
Add a parameter to the method.
This function adds a parameter to the method. If the passed bpp_method_parameter is not a primitive type, it will also add the object to the local_objects map by calling add_object_as_parameter.
| std::string bpp::bpp_method::get_last_override | ( | ) | const |
| std::vector< std::shared_ptr< bpp_method_parameter > > bpp::bpp_method::get_parameters | ( | ) | const |
| bpp_scope bpp::bpp_method::get_scope | ( | ) | const |
| bool bpp::bpp_method::is_inherited | ( | ) | const |
| bool bpp::bpp_method::is_overridable | ( | ) | const |
| bool bpp::bpp_method::is_virtual | ( | ) | const |
| void bpp::bpp_method::set_inherited | ( | bool | is_inherited | ) |
| void bpp::bpp_method::set_last_override | ( | const std::string & | class_name | ) |
| void bpp::bpp_method::set_overridable | ( | bool | is_overridable | ) |
| void bpp::bpp_method::set_overridden_method | ( | std::weak_ptr< bpp_method > | method | ) |
| void bpp::bpp_method::set_scope | ( | bpp_scope | scope | ) |
| void bpp::bpp_method::set_virtual | ( | bool | is_virtual | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |