25 std::vector<std::shared_ptr<bpp_method>>
methods;
35 std::shared_ptr<bpp_class>
get_class()
override;
38 bool add_method(std::shared_ptr<bpp_method> method);
41 const std::vector<std::shared_ptr<bpp_method>>&
get_methods()
const;
42 const std::vector<std::shared_ptr<bpp_datamember>>&
get_datamembers()
const;
44 std::shared_ptr<bpp_method>
get_method(
const std::string&
name, std::shared_ptr<bpp_entity> context);
46 std::shared_ptr<bpp_datamember>
get_datamember(
const std::string&
name, std::shared_ptr<bpp_entity> context);
50 void inherit(std::shared_ptr<bpp_class> parent)
override;
A class in Bash++.
Definition bpp_class.h:23
void set_name(const std::string &name) override
Definition bpp_class.cpp:59
bool set_containing_class(std::weak_ptr< bpp::bpp_class > containing_class) override
Definition bpp_class.cpp:55
const std::vector< std::shared_ptr< bpp_method > > & get_methods() const
Definition bpp_class.cpp:147
std::shared_ptr< bpp_class > get_class() override
Definition bpp_class.cpp:51
void inherit(std::shared_ptr< bpp_class > parent) override
Inherit from a parent class.
Definition bpp_class.cpp:262
bool add_method(std::shared_ptr< bpp_method > method)
Add a method to the class.
Definition bpp_class.cpp:67
std::vector< std::shared_ptr< bpp_class > > get_all_known_classes() const override
Definition bpp_class.cpp:301
void add_default_toPrimitive()
Add the default toPrimitive method.
Definition bpp_class.cpp:33
std::vector< std::shared_ptr< bpp_datamember > > datamembers
Definition bpp_class.h:26
const std::vector< std::shared_ptr< bpp_datamember > > & get_datamembers() const
Definition bpp_class.cpp:151
std::shared_ptr< bpp_datamember > get_datamember(const std::string &name, std::shared_ptr< bpp_entity > context)
Get a datamember by name.
Definition bpp_class.cpp:223
bool has_custom_toPrimitive
Definition bpp_class.h:27
void remove_default_toPrimitive()
Remove the default toPrimitive method.
Definition bpp_class.cpp:20
std::shared_ptr< bpp::bpp_class > get_parent()
Definition bpp_class.cpp:294
std::shared_ptr< bpp_method > get_method(const std::string &name, std::shared_ptr< bpp_entity > context)
Get a method by name.
Definition bpp_class.cpp:168
std::shared_ptr< bpp_method > get_method_UNSAFE(const std::string &name)
Get a method by name without checking the context.
Definition bpp_class.cpp:201
std::shared_ptr< bpp_datamember > get_datamember_UNSAFE(const std::string &name)
Definition bpp_class.cpp:246
std::weak_ptr< bpp_class > get_containing_class() override
Get the class which contains this entity.
Definition bpp_class.cpp:47
bool add_datamember(std::shared_ptr< bpp_datamember > datamember)
Add a datamember to the class.
Definition bpp_class.cpp:126
std::vector< std::shared_ptr< bpp_method > > methods
Definition bpp_class.h:25
The base class for all entities in the Bash++ compiler.
Definition bpp_entity.h:25
std::string name
Definition bpp_entity.h:27
std::weak_ptr< bpp_class > containing_class
Definition bpp_entity.h:34
void inherit(std::shared_ptr< bpp_entity > parent)
Inherit from a parent entity.
Definition bpp_entity.cpp:93
Definition bash_case.cpp:9