<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: opentelemetry/proto/profiles/v1development/profiles.proto

namespace Opentelemetry\Proto\Profiles\V1development;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Describes function and line table debug information.
 *
 * Generated from protobuf message <code>opentelemetry.proto.profiles.v1development.Location</code>
 */
class Location extends \Google\Protobuf\Internal\Message
{
    /**
     * Reference to mapping in ProfilesDictionary.mapping_table.
     * It can be unset / set to 0 if the mapping is unknown or not applicable for
     * this profile type, as mapping_table[0] is always a 'null' default mapping.
     *
     * Generated from protobuf field <code>int32 mapping_index = 1;</code>
     */
    protected $mapping_index = 0;
    /**
     * The instruction address for this location, if available.  It
     * should be within [Mapping.memory_start...Mapping.memory_limit]
     * for the corresponding mapping. A non-leaf address may be in the
     * middle of a call instruction. It is up to display tools to find
     * the beginning of the instruction if necessary.
     *
     * Generated from protobuf field <code>uint64 address = 2;</code>
     */
    protected $address = 0;
    /**
     * Multiple line indicates this location has inlined functions,
     * where the last entry represents the caller into which the
     * preceding entries were inlined.
     * E.g., if memcpy() is inlined into printf:
     *    line[0].function_name == "memcpy"
     *    line[1].function_name == "printf"
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Line line = 3;</code>
     */
    private $line;
    /**
     * References to attributes in ProfilesDictionary.attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 4;</code>
     */
    private $attribute_indices;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $mapping_index
     *           Reference to mapping in ProfilesDictionary.mapping_table.
     *           It can be unset / set to 0 if the mapping is unknown or not applicable for
     *           this profile type, as mapping_table[0] is always a 'null' default mapping.
     *     @type int|string $address
     *           The instruction address for this location, if available.  It
     *           should be within [Mapping.memory_start...Mapping.memory_limit]
     *           for the corresponding mapping. A non-leaf address may be in the
     *           middle of a call instruction. It is up to display tools to find
     *           the beginning of the instruction if necessary.
     *     @type \Opentelemetry\Proto\Profiles\V1development\Line[]|\Google\Protobuf\Internal\RepeatedField $line
     *           Multiple line indicates this location has inlined functions,
     *           where the last entry represents the caller into which the
     *           preceding entries were inlined.
     *           E.g., if memcpy() is inlined into printf:
     *              line[0].function_name == "memcpy"
     *              line[1].function_name == "printf"
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $attribute_indices
     *           References to attributes in ProfilesDictionary.attribute_table. [optional]
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Opentelemetry\Proto\Profiles\V1Development\Profiles::initOnce();
        parent::__construct($data);
    }

    /**
     * Reference to mapping in ProfilesDictionary.mapping_table.
     * It can be unset / set to 0 if the mapping is unknown or not applicable for
     * this profile type, as mapping_table[0] is always a 'null' default mapping.
     *
     * Generated from protobuf field <code>int32 mapping_index = 1;</code>
     * @return int
     */
    public function getMappingIndex()
    {
        return $this->mapping_index;
    }

    /**
     * Reference to mapping in ProfilesDictionary.mapping_table.
     * It can be unset / set to 0 if the mapping is unknown or not applicable for
     * this profile type, as mapping_table[0] is always a 'null' default mapping.
     *
     * Generated from protobuf field <code>int32 mapping_index = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMappingIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->mapping_index = $var;

        return $this;
    }

    /**
     * The instruction address for this location, if available.  It
     * should be within [Mapping.memory_start...Mapping.memory_limit]
     * for the corresponding mapping. A non-leaf address may be in the
     * middle of a call instruction. It is up to display tools to find
     * the beginning of the instruction if necessary.
     *
     * Generated from protobuf field <code>uint64 address = 2;</code>
     * @return int|string
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * The instruction address for this location, if available.  It
     * should be within [Mapping.memory_start...Mapping.memory_limit]
     * for the corresponding mapping. A non-leaf address may be in the
     * middle of a call instruction. It is up to display tools to find
     * the beginning of the instruction if necessary.
     *
     * Generated from protobuf field <code>uint64 address = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAddress($var)
    {
        GPBUtil::checkUint64($var);
        $this->address = $var;

        return $this;
    }

    /**
     * Multiple line indicates this location has inlined functions,
     * where the last entry represents the caller into which the
     * preceding entries were inlined.
     * E.g., if memcpy() is inlined into printf:
     *    line[0].function_name == "memcpy"
     *    line[1].function_name == "printf"
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Line line = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLine()
    {
        return $this->line;
    }

    /**
     * Multiple line indicates this location has inlined functions,
     * where the last entry represents the caller into which the
     * preceding entries were inlined.
     * E.g., if memcpy() is inlined into printf:
     *    line[0].function_name == "memcpy"
     *    line[1].function_name == "printf"
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Line line = 3;</code>
     * @param \Opentelemetry\Proto\Profiles\V1development\Line[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLine($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Profiles\V1development\Line::class);
        $this->line = $arr;

        return $this;
    }

    /**
     * References to attributes in ProfilesDictionary.attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAttributeIndices()
    {
        return $this->attribute_indices;
    }

    /**
     * References to attributes in ProfilesDictionary.attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 4;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAttributeIndices($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->attribute_indices = $arr;

        return $this;
    }

}

