33 std::weak_ptr<bpp_class>
type;
38 std::vector<std::weak_ptr<bpp_class>>
parents;
55 virtual bool add_object(std::shared_ptr<bpp_object>
object,
bool make_local =
false);
57 virtual std::shared_ptr<bpp_class>
get_class();
60 virtual std::string
get_name()
const;
65 void inherit(std::shared_ptr<bpp_entity> parent);
66 void inherit(std::shared_ptr<bpp_program> program);
67 virtual void inherit(std::shared_ptr<bpp_class> parent);
70 void add_reference(
const std::string& file, uint64_t line, uint64_t column);
75 virtual std::shared_ptr<bpp_class>
get_class(
const std::string&
name,
size_t max_visible_index = SIZE_MAX);
76 std::shared_ptr<bpp_object>
get_object(
const std::string&
name,
size_t max_visible_index = SIZE_MAX);
The base class for all entities in the Bash++ compiler.
Definition bpp_entity.h:25
virtual size_t number_of_known_classes() const
Definition bpp_entity.cpp:177
std::shared_ptr< bpp_class > get_parent() const
Definition bpp_entity.cpp:161
size_t number_of_known_objects() const
Definition bpp_entity.cpp:169
std::weak_ptr< bpp_class > type
Definition bpp_entity.h:33
virtual void set_name(const std::string &name)
Definition bpp_entity.cpp:38
virtual std::weak_ptr< bpp::bpp_class > get_containing_class()
Get the class which contains this entity.
Definition bpp_entity.cpp:51
std::shared_ptr< bpp_object > get_object(const std::string &name, size_t max_visible_index=SIZE_MAX)
Definition bpp_entity.cpp:120
std::string name
Definition bpp_entity.h:27
virtual std::vector< std::shared_ptr< bpp_object > > get_all_known_objects() const
Definition bpp_entity.cpp:145
virtual bool add_object(std::shared_ptr< bpp_object > object, bool make_local=false)
Add an object to this entity's list of objects.
Definition bpp_entity.cpp:22
virtual ~bpp_entity()=default
bpp_entity & operator=(bpp_entity &&other) noexcept=default
OwnedEntityList< bpp_object > local_objects
Definition bpp_entity.h:29
std::vector< std::weak_ptr< bpp_class > > parents
For classes: the list of parent classes, in order.
Definition bpp_entity.h:38
void add_reference(const std::string &file, uint64_t line, uint64_t column)
Definition bpp_entity.cpp:73
bpp::SymbolPosition get_initial_definition() const
Definition bpp_entity.cpp:69
bpp_entity(const bpp_entity &other)=default
std::weak_ptr< bpp_entity > parent_entity
For all entities (except program), the parent entity from which this entity inherits.
Definition bpp_entity.h:41
std::weak_ptr< bpp_program > containing_program
Definition bpp_entity.h:35
virtual std::weak_ptr< bpp_program > get_containing_program()
Definition bpp_entity.cpp:55
std::weak_ptr< bpp_method > overridden_method
Definition bpp_entity.h:43
size_t parent_visible_object_count_at_creation
Definition bpp_entity.h:30
virtual std::string get_address() const
Definition bpp_entity.cpp:34
std::list< bpp::SymbolPosition > references
Definition bpp_entity.h:45
virtual std::vector< std::shared_ptr< bpp_class > > get_all_known_classes() const
Definition bpp_entity.cpp:135
const OwnedEntityList< bpp_object > & get_local_objects() const
Definition bpp_entity.cpp:131
std::weak_ptr< bpp_class > containing_class
Definition bpp_entity.h:34
virtual bool set_containing_class(std::weak_ptr< bpp::bpp_class > containing_class)
Definition bpp_entity.cpp:59
virtual std::string get_name() const
Definition bpp_entity.cpp:42
size_t program_visible_class_count_at_creation
Definition bpp_entity.h:31
std::list< bpp::SymbolPosition > get_references() const
Definition bpp_entity.cpp:84
void inherit(std::shared_ptr< bpp_entity > parent)
Inherit from a parent entity.
Definition bpp_entity.cpp:93
void set_definition_position(const std::string &file, uint64_t line, uint64_t column)
Definition bpp_entity.cpp:64
bpp_entity(bpp_entity &&other) noexcept=default
bpp_entity & operator=(const bpp_entity &other)=default
virtual std::shared_ptr< bpp_class > get_class()
Definition bpp_entity.cpp:30
bpp::SymbolPosition initial_definition
Definition bpp_entity.h:44
Definition bash_case.cpp:9