Debian Codegraph @

pdata/pprofile/generated_line.go

raw
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 // Line details a specific line in a source code, linked to a function.
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 NewLine function to create new instances.
19 // Important: zero-initialized instance is not valid for use.
20 type Line struct {
21 orig *internal.Line
22 state *internal.State
23 }
24
25 func newLine(orig *internal.Line, state *internal.State) Line {
26 return Line{orig: orig, state: state}
27 }
28
29 // NewLine creates a new empty Line.
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 NewLine() Line {
34 return newLine(internal.NewLine(), 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 Line) MoveTo(dest Line) {
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.DeleteLine(dest.orig, false)
47 *dest.orig, *ms.orig = *ms.orig, *dest.orig
48 }
49
50 // FunctionIndex returns the functionindex associated with this Line.
51 func (ms Line) FunctionIndex() int32 {
52 return ms.orig.FunctionIndex
53 }
54
55 // SetFunctionIndex replaces the functionindex associated with this Line.
56 func (ms Line) SetFunctionIndex(v int32) {
57 ms.state.AssertMutable()
58 ms.orig.FunctionIndex = v
59 }
60
61 // Line returns the line associated with this Line.
62 func (ms Line) Line() int64 {
63 return ms.orig.Line
64 }
65
66 // SetLine replaces the line associated with this Line.
67 func (ms Line) SetLine(v int64) {
68 ms.state.AssertMutable()
69 ms.orig.Line = v
70 }
71
72 // Column returns the column associated with this Line.
73 func (ms Line) Column() int64 {
74 return ms.orig.Column
75 }
76
77 // SetColumn replaces the column associated with this Line.
78 func (ms Line) SetColumn(v int64) {
79 ms.state.AssertMutable()
80 ms.orig.Column = v
81 }
82
83 // CopyTo copies all properties from the current struct overriding the destination.
84 func (ms Line) CopyTo(dest Line) {
85 dest.state.AssertMutable()
86 internal.CopyLine(dest.orig, ms.orig)
87 }