obj.hpp
Go to the documentation of this file.
1
2#pragma once
3
5#include "core/ast/scope.hpp"
7
8namespace by {
9
10 class mgdType;
11 class origin;
12 class runExpr;
13
19 class _nout obj: public baseObj {
20 BY(ME(obj, baseObj), INIT_META(obj), CLONE(obj), VISIT())
21
22 public:
23 typedef ntype metaType;
24 friend class slot;
25
26 public:
27 explicit obj(); // this means 'any' class.
28 explicit obj(const scope& subs);
29 explicit obj(const me& rhs);
30
31 protected:
32 explicit obj(const scope& shares, scope& owns);
33
34 public:
35 me& operator=(const me& rhs);
36
37 public:
38 using super::subs;
39 scope& subs() override;
40
41 tstr<nbicontainer> mySubs() const override;
42
43 state getState() const override;
44 void setState(state new1) override;
45
46 scope& getShares();
47 const scope& getShares() const BY_CONST_FUNC(getShares())
48 scope::super& getOwns();
49 const scope::super& getOwns() const BY_CONST_FUNC(getOwns())
50
51 const ntype& getType() const override;
52
53 void onCloneDeep(const clonable& from) override;
54
55 virtual node* getCallComplete();
56 const node* getCallComplete() const BY_CONST_FUNC(getCallComplete())
57
58 protected:
59 void _inFrame(frame& fr, const bicontainable* args) const override;
60 str _onBeforeCtor() override;
61
62 private:
63 me& _assign(const me& rhs);
64
65 private:
66 tstr<scope> _subs;
67 };
68
69#ifdef BY_BUILD_PLATFORM_IS_WINDOWS
70 // f***ing annoying another MSVC bug here:
71 // first of all, I'm so sorry to start my slang. but I couldn't help spitting it out after
72 // I used plenty hours of heading to the ground.
73 //
74 // I don't know why, but unless define below variable here, I'll observe that the
75 // member-variable
76 // '_subs' above was tried to be instantiated but failed.
77 // error message said that 'You've used undefined type "identifiertstr<scope>"'.
78 // however, MSVC definately knows about tstr<T> and scope types.
79 //
80 // clang, gcc didn't complain about this.
81 namespace {
82 static const inline scope a3;
83 }
84#endif
85} // namespace by
Function call arguments container.
Definition: args.hpp:13
Base class for all objects in byeol language.
Definition: baseObj.hpp:24
Interface for objects that can be cloned.
Definition: clonable.hpp:12
Execution frame for byeol runtime.
Definition: frame.hpp:29
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Native type system for byeol language.
Definition: ntype.hpp:19
Managed object in byeol programming environment.
Definition: obj.hpp:19
Pack slot for loading and management.
Definition: slot.hpp:16
Template bidirectional container interface.
Definition: tbicontainable.hpp:17
Strong reference smart pointer with strict type checking.
Definition: tstr.hpp:13