| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. |
| 5 |
// To regenerate this file run "make genpdata". |
| 6 |
|
| 7 |
package pprofile |
| 8 |
|
| 9 |
import ( |
| 10 |
"go.opentelemetry.io/collector/pdata/internal" |
| 11 |
) |
| 12 |
|
| 13 |
// Function describes a function, including its human-readable name, system name, source file, and starting line number in the source. |
| 14 |
// |
| 15 |
// This is a reference type, if passed by value and callee modifies it the |
| 16 |
// caller will see the modification. |
| 17 |
// |
| 18 |
// Must use NewFunction function to create new instances. |
| 19 |
// Important: zero-initialized instance is not valid for use. |
| 20 |
type Function struct { |
| 21 |
orig *internal.Function |
| 22 |
state *internal.State |
| 23 |
} |
| 24 |
|
| 25 |
func newFunction(orig *internal.Function, state *internal.State) Function { |
| 26 |
return Function{orig: orig, state: state} |
| 27 |
} |
| 28 |
|
| 29 |
// NewFunction creates a new empty Function. |
| 30 |
// |
| 31 |
// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, |
| 32 |
// OR directly access the member if this is embedded in another struct. |
| 33 |
func NewFunction() Function { |
| 34 |
return newFunction(internal.NewFunction(), internal.NewState()) |
| 35 |
} |
| 36 |
|
| 37 |
// MoveTo moves all properties from the current struct overriding the destination and |
| 38 |
// resetting the current instance to its zero value |
| 39 |
func (ms Function) MoveTo(dest Function) { |
| 40 |
ms.state.AssertMutable() |
| 41 |
dest.state.AssertMutable() |
| 42 |
// If they point to the same data, they are the same, nothing to do. |
| 43 |
if ms.orig == dest.orig { |
| 44 |
return |
| 45 |
} |
| 46 |
internal.DeleteFunction(dest.orig, false) |
| 47 |
*dest.orig, *ms.orig = *ms.orig, *dest.orig |
| 48 |
} |
| 49 |
|
| 50 |
// NameStrindex returns the namestrindex associated with this Function. |
| 51 |
func (ms Function) NameStrindex() int32 { |
| 52 |
return ms.orig.NameStrindex |
| 53 |
} |
| 54 |
|
| 55 |
// SetNameStrindex replaces the namestrindex associated with this Function. |
| 56 |
func (ms Function) SetNameStrindex(v int32) { |
| 57 |
ms.state.AssertMutable() |
| 58 |
ms.orig.NameStrindex = v |
| 59 |
} |
| 60 |
|
| 61 |
// SystemNameStrindex returns the systemnamestrindex associated with this Function. |
| 62 |
func (ms Function) SystemNameStrindex() int32 { |
| 63 |
return ms.orig.SystemNameStrindex |
| 64 |
} |
| 65 |
|
| 66 |
// SetSystemNameStrindex replaces the systemnamestrindex associated with this Function. |
| 67 |
func (ms Function) SetSystemNameStrindex(v int32) { |
| 68 |
ms.state.AssertMutable() |
| 69 |
ms.orig.SystemNameStrindex = v |
| 70 |
} |
| 71 |
|
| 72 |
// FilenameStrindex returns the filenamestrindex associated with this Function. |
| 73 |
func (ms Function) FilenameStrindex() int32 { |
| 74 |
return ms.orig.FilenameStrindex |
| 75 |
} |
| 76 |
|
| 77 |
// SetFilenameStrindex replaces the filenamestrindex associated with this Function. |
| 78 |
func (ms Function) SetFilenameStrindex(v int32) { |
| 79 |
ms.state.AssertMutable() |
| 80 |
ms.orig.FilenameStrindex = v |
| 81 |
} |
| 82 |
|
| 83 |
// StartLine returns the startline associated with this Function. |
| 84 |
func (ms Function) StartLine() int64 { |
| 85 |
return ms.orig.StartLine |
| 86 |
} |
| 87 |
|
| 88 |
// SetStartLine replaces the startline associated with this Function. |
| 89 |
func (ms Function) SetStartLine(v int64) { |
| 90 |
ms.state.AssertMutable() |
| 91 |
ms.orig.StartLine = v |
| 92 |
} |
| 93 |
|
| 94 |
// CopyTo copies all properties from the current struct overriding the destination. |
| 95 |
func (ms Function) CopyTo(dest Function) { |
| 96 |
dest.state.AssertMutable() |
| 97 |
internal.CopyFunction(dest.orig, ms.orig) |
| 98 |
} |