Module
-
class zhetapi::Module : public zhetapi::Token
Represents a collection of variables (algorithms, registrables, functions, operands) from a separate library or file.
Public Types
Public Functions
-
Module(const std::string&)
Name constructor.
- Parameters
name – the name of the resulting Module object.
-
Module(const std::string&, const std::vector<NamedToken>&)
Name and member constructor.
- Parameters
name – the name of the resulting Module object.
parts – the members to be added to the object, as a list of pairs of their names (as std::strings) and values (as Tokens).
-
Token *attr(const std::string&, Engine*, const Targs&, size_t) override
Overrided attribute method for Modules. Prioritizes the members of the object over its own methods.
- Parameters
id – the name of the member or method.
ctx – the execution context.
args – the arguments to be provided to the member/method.
osize – the original size of the tree’s leaves.
-
virtual void list_attributes(std::ostream&) const override
Overrides the
list_attributes
method from Tokens. Prints the attributes the members and methods of the object.
-
void add(const NamedToken&)
Adds a member to the object.
- Parameters
nt – a pair containing the name and value of the member.
-
void add(const char*, Token*)
Adds a member to the object.
- Parameters
name – the name of the member.
tptr – the value of the member.
-
Module(const std::string&)