-- SPDX-License-Identifier: MIT
-- Copyright (C) 2018-present iced project and contributors

-- ⚠️This file was generated by GENERATOR!🦹‍♂️

---@meta
---@diagnostic disable unused-local

---`MemorySize` enum info, see also `MemorySizeExt`
---
---@class MemorySizeInfo
local MemorySizeInfo = {}

---`MemorySize` enum info, see also `MemorySizeExt`
---
---@param memory_size integer #(A `MemorySize` enum variant) Memory size value
---@return MemorySizeInfo
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:size() == 32)
---```
function MemorySizeInfo.new(memory_size) end

---Gets the `MemorySize` value
---
---@return integer #A `MemorySize` enum variant
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:memory_size() == MemorySize.Packed256_UInt16)
---```
function MemorySizeInfo:memory_size() end

---Gets the size in bytes of the memory location or 0 if it's not accessed or unknown
---
---@return integer
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(info:size() == 4)
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:size() == 32)
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(info:size() == 8)
---```
function MemorySizeInfo:size() end

---Gets the size in bytes of the packed element. If it's not a packed data type, it's equal to `MemorySizeInfo.size()`.
---
---@return integer
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(info:element_size() == 4)
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:element_size() == 2)
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(info:element_size() == 8)
---```
function MemorySizeInfo:element_size() end

---Gets the element type if it's packed data or the type itself if it's not packed data
---
---@return integer #A `MemorySize` enum variant
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(info:element_type() == MemorySize.UInt32)
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:element_type() == MemorySize.UInt16)
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(info:element_type() == MemorySize.UInt64)
---```
function MemorySizeInfo:element_type() end

---Gets the element type if it's packed data or the type itself if it's not packed data
---
---@return MemorySizeInfo
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32):element_type_info()
---assert(info:memory_size() == MemorySize.UInt32)
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16):element_type_info()
---assert(info:memory_size() == MemorySize.UInt16)
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64):element_type_info()
---assert(info:memory_size() == MemorySize.UInt64)
---```
function MemorySizeInfo:element_type_info() end

---`true` if it's signed data (signed integer or a floating point value)
---
---@return boolean
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(not info:is_signed())
---info = MemorySizeInfo.new(MemorySize.Int32)
---assert(info:is_signed())
---info = MemorySizeInfo.new(MemorySize.Float64)
---assert(info:is_signed())
---```
function MemorySizeInfo:is_signed() end

---`true` if it's a broadcast memory type
---
---@return boolean
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(not info:is_broadcast())
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(not info:is_broadcast())
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(info:is_broadcast())
---```
function MemorySizeInfo:is_broadcast() end

---`true` if this is a packed data type, eg. `MemorySize.Packed128_Float32`. See also `MemorySizeInfo.element_count()`
---
---@return boolean
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(not info:is_packed())
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:is_packed())
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(not info:is_packed())
---```
function MemorySizeInfo:is_packed() end

---Gets the number of elements in the packed data type or `1` if it's not packed data (`MemorySizeInfo.is_packed()`)
---
---@return integer
---
---# Examples
---
---```lua
---local MemorySize = require("iced_x86.MemorySize")
---local MemorySizeInfo = require("iced_x86.MemorySizeInfo")
---
---local info = MemorySizeInfo.new(MemorySize.UInt32)
---assert(info:element_count() == 1)
---info = MemorySizeInfo.new(MemorySize.Packed256_UInt16)
---assert(info:element_count() == 16)
---info = MemorySizeInfo.new(MemorySize.Broadcast512_UInt64)
---assert(info:element_count() == 1)
---```
function MemorySizeInfo:element_count() end

return MemorySizeInfo
