| 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 pcommon |
| 8 |
|
| 9 |
import ( |
| 10 |
"go.opentelemetry.io/collector/pdata/internal" |
| 11 |
) |
| 12 |
|
| 13 |
// InstrumentationScope is a message representing the instrumentation scope information. |
| 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 NewInstrumentationScope function to create new instances. |
| 19 |
// Important: zero-initialized instance is not valid for use. |
| 20 |
type InstrumentationScope internal.InstrumentationScopeWrapper |
| 21 |
|
| 22 |
func newInstrumentationScope(orig *internal.InstrumentationScope, state *internal.State) InstrumentationScope { |
| 23 |
return InstrumentationScope(internal.NewInstrumentationScopeWrapper(orig, state)) |
| 24 |
} |
| 25 |
|
| 26 |
// NewInstrumentationScope creates a new empty InstrumentationScope. |
| 27 |
// |
| 28 |
// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, |
| 29 |
// OR directly access the member if this is embedded in another struct. |
| 30 |
func NewInstrumentationScope() InstrumentationScope { |
| 31 |
return newInstrumentationScope(internal.NewInstrumentationScope(), internal.NewState()) |
| 32 |
} |
| 33 |
|
| 34 |
// MoveTo moves all properties from the current struct overriding the destination and |
| 35 |
// resetting the current instance to its zero value |
| 36 |
func (ms InstrumentationScope) MoveTo(dest InstrumentationScope) { |
| 37 |
ms.getState().AssertMutable() |
| 38 |
dest.getState().AssertMutable() |
| 39 |
// If they point to the same data, they are the same, nothing to do. |
| 40 |
if ms.getOrig() == dest.getOrig() { |
| 41 |
return |
| 42 |
} |
| 43 |
internal.DeleteInstrumentationScope(dest.getOrig(), false) |
| 44 |
*dest.getOrig(), *ms.getOrig() = *ms.getOrig(), *dest.getOrig() |
| 45 |
} |
| 46 |
|
| 47 |
// Name returns the name associated with this InstrumentationScope. |
| 48 |
func (ms InstrumentationScope) Name() string { |
| 49 |
return ms.getOrig().Name |
| 50 |
} |
| 51 |
|
| 52 |
// SetName replaces the name associated with this InstrumentationScope. |
| 53 |
func (ms InstrumentationScope) SetName(v string) { |
| 54 |
ms.getState().AssertMutable() |
| 55 |
ms.getOrig().Name = v |
| 56 |
} |
| 57 |
|
| 58 |
// Version returns the version associated with this InstrumentationScope. |
| 59 |
func (ms InstrumentationScope) Version() string { |
| 60 |
return ms.getOrig().Version |
| 61 |
} |
| 62 |
|
| 63 |
// SetVersion replaces the version associated with this InstrumentationScope. |
| 64 |
func (ms InstrumentationScope) SetVersion(v string) { |
| 65 |
ms.getState().AssertMutable() |
| 66 |
ms.getOrig().Version = v |
| 67 |
} |
| 68 |
|
| 69 |
// Attributes returns the Attributes associated with this InstrumentationScope. |
| 70 |
func (ms InstrumentationScope) Attributes() Map { |
| 71 |
return Map(internal.NewMapWrapper(&ms.getOrig().Attributes, ms.getState())) |
| 72 |
} |
| 73 |
|
| 74 |
// DroppedAttributesCount returns the droppedattributescount associated with this InstrumentationScope. |
| 75 |
func (ms InstrumentationScope) DroppedAttributesCount() uint32 { |
| 76 |
return ms.getOrig().DroppedAttributesCount |
| 77 |
} |
| 78 |
|
| 79 |
// SetDroppedAttributesCount replaces the droppedattributescount associated with this InstrumentationScope. |
| 80 |
func (ms InstrumentationScope) SetDroppedAttributesCount(v uint32) { |
| 81 |
ms.getState().AssertMutable() |
| 82 |
ms.getOrig().DroppedAttributesCount = v |
| 83 |
} |
| 84 |
|
| 85 |
// CopyTo copies all properties from the current struct overriding the destination. |
| 86 |
func (ms InstrumentationScope) CopyTo(dest InstrumentationScope) { |
| 87 |
dest.getState().AssertMutable() |
| 88 |
internal.CopyInstrumentationScope(dest.getOrig(), ms.getOrig()) |
| 89 |
} |
| 90 |
|
| 91 |
func (ms InstrumentationScope) getOrig() *internal.InstrumentationScope { |
| 92 |
return internal.GetInstrumentationScopeOrig(internal.InstrumentationScopeWrapper(ms)) |
| 93 |
} |
| 94 |
|
| 95 |
func (ms InstrumentationScope) getState() *internal.State { |
| 96 |
return internal.GetInstrumentationScopeState(internal.InstrumentationScopeWrapper(ms)) |
| 97 |
} |