Debian Codegraph @

pdata/pprofile/generated_profilesdictionary.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 "go.opentelemetry.io/collector/pdata/pcommon"
12 )
13
14 // ProfilesDictionary is the reference table containing all data shared by profiles across the message being sent.
15 //
16 // This is a reference type, if passed by value and callee modifies it the
17 // caller will see the modification.
18 //
19 // Must use NewProfilesDictionary function to create new instances.
20 // Important: zero-initialized instance is not valid for use.
21 type ProfilesDictionary struct {
22 orig *internal.ProfilesDictionary
23 state *internal.State
24 }
25
26 func newProfilesDictionary(orig *internal.ProfilesDictionary, state *internal.State) ProfilesDictionary {
27 return ProfilesDictionary{orig: orig, state: state}
28 }
29
30 // NewProfilesDictionary creates a new empty ProfilesDictionary.
31 //
32 // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice,
33 // OR directly access the member if this is embedded in another struct.
34 func NewProfilesDictionary() ProfilesDictionary {
35 return newProfilesDictionary(internal.NewProfilesDictionary(), internal.NewState())
36 }
37
38 // MoveTo moves all properties from the current struct overriding the destination and
39 // resetting the current instance to its zero value
40 func (ms ProfilesDictionary) MoveTo(dest ProfilesDictionary) {
41 ms.state.AssertMutable()
42 dest.state.AssertMutable()
43 // If they point to the same data, they are the same, nothing to do.
44 if ms.orig == dest.orig {
45 return
46 }
47 internal.DeleteProfilesDictionary(dest.orig, false)
48 *dest.orig, *ms.orig = *ms.orig, *dest.orig
49 }
50
51 // MappingTable returns the MappingTable associated with this ProfilesDictionary.
52 func (ms ProfilesDictionary) MappingTable() MappingSlice {
53 return newMappingSlice(&ms.orig.MappingTable, ms.state)
54 }
55
56 // LocationTable returns the LocationTable associated with this ProfilesDictionary.
57 func (ms ProfilesDictionary) LocationTable() LocationSlice {
58 return newLocationSlice(&ms.orig.LocationTable, ms.state)
59 }
60
61 // FunctionTable returns the FunctionTable associated with this ProfilesDictionary.
62 func (ms ProfilesDictionary) FunctionTable() FunctionSlice {
63 return newFunctionSlice(&ms.orig.FunctionTable, ms.state)
64 }
65
66 // LinkTable returns the LinkTable associated with this ProfilesDictionary.
67 func (ms ProfilesDictionary) LinkTable() LinkSlice {
68 return newLinkSlice(&ms.orig.LinkTable, ms.state)
69 }
70
71 // StringTable returns the StringTable associated with this ProfilesDictionary.
72 func (ms ProfilesDictionary) StringTable() pcommon.StringSlice {
73 return pcommon.StringSlice(internal.NewStringSliceWrapper(&ms.orig.StringTable, ms.state))
74 }
75
76 // AttributeTable returns the AttributeTable associated with this ProfilesDictionary.
77 func (ms ProfilesDictionary) AttributeTable() KeyValueAndUnitSlice {
78 return newKeyValueAndUnitSlice(&ms.orig.AttributeTable, ms.state)
79 }
80
81 // StackTable returns the StackTable associated with this ProfilesDictionary.
82 func (ms ProfilesDictionary) StackTable() StackSlice {
83 return newStackSlice(&ms.orig.StackTable, ms.state)
84 }
85
86 // CopyTo copies all properties from the current struct overriding the destination.
87 func (ms ProfilesDictionary) CopyTo(dest ProfilesDictionary) {
88 dest.state.AssertMutable()
89 internal.CopyProfilesDictionary(dest.orig, ms.orig)
90 }