Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
Case 4: multiple base classes; an earlier base has no virtual methods, while a later one does. The polymorphic base (Shape) is the primary base, so the class reuses its vptr and introduces no new one; the primary base is laid out first (before the non-polymorphic Tag) to keep the shared vptr at offset 0. Shape's inherited slots (area, the two destructor slots, the private-method placeholder) precede the new click slot.
func (*Button) XGo_vptr ¶
func (p *Button) XGo_vptr() *X_vtable_Button
type Circle ¶
Case 3: single base class, and the base class has virtual methods. The derived class reuses the base's vptr, so it introduces no new vptr. It does not declare its own destructor, so Shape's destructor and private-method slots are inherited unchanged (with this re-typed to *Circle).
func (*Circle) XGo_vptr ¶
func (p *Circle) XGo_vptr() *X_vtable_Circle
type Shape ¶
Case 1: no base class; the class itself has virtual methods.
It also declares a virtual destructor and a private virtual method to exercise the two extra vtable slot rules:
- a virtual destructor takes two consecutive Itanium slots, XGo_dtor (complete object) then XGo_dtor_deleting, both func(this *Shape);
- a private virtual method still occupies a slot, emitted as an unexported placeholder so later slots keep their index.
Declaration order fixes the vtable order: area, ~Shape (two slots), reset.
func (*Shape) XGo_vptr ¶
func (p *Shape) XGo_vptr() *X_vtable_Shape
type Widget ¶
Case 2: has a base class, but the base has no virtual methods; the class itself has virtual methods. It also declares a virtual destructor, so its own vtable holds paint plus the two destructor slots.
func (*Widget) XGo_Dtor ¶
func (this *Widget) XGo_Dtor()
llgo:link (*Widget).XGo_Dtor C._ZN6WidgetD1Ev
func (*Widget) XGo_vptr ¶
func (p *Widget) XGo_vptr() *X_vtable_Widget
type X_vtable_Button ¶ added in v0.9.3
type X_vtable_Button struct {
Area func(this *Button) c.Int
XGo_dtor func(this *Button)
XGo_dtor_deleting func(this *Button)
Click func(this *Button) c.Int
// contains filtered or unexported fields
}
llgo:type C
type X_vtable_Circle ¶ added in v0.9.3
type X_vtable_Circle struct {
Area func(this *Circle) c.Int
XGo_dtor func(this *Circle)
XGo_dtor_deleting func(this *Circle)
// contains filtered or unexported fields
}
llgo:type C