MCPcopy Create free account
hub / github.com/cogentcore/core / NewInstance

Method NewInstance

tree/nodebase.go:140–142  ·  view source on GitHub ↗

NewInstance returns a new instance of this node type.

()

Source from the content-addressed store, hash-verified

138
139// NewInstance returns a new instance of this node type.
140func (n *NodeBase) NewInstance() Node {
141 return reflect.New(reflect.TypeOf(n.This).Elem()).Interface().(Node)
142}
143
144// Parents:
145

Callers 4

NodeTypeMethod · 0.95
CloneMethod · 0.95
BenchmarkNodeNewInstanceFunction · 0.95
TestLiveTypeFunction · 0.80

Calls 2

ElemMethod · 0.80
NewMethod · 0.65

Tested by 2

BenchmarkNodeNewInstanceFunction · 0.76
TestLiveTypeFunction · 0.64