Files
o3de/Code/Framework/AzNetworking/AzNetworking/DataStructures/IBitset.h
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

41 lines
1.3 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <stdint.h>
namespace AzNetworking
{
//! @class IBitset
//! @brief Interface for a structure optimized for representing an array of bits.
class IBitset
{
public:
virtual ~IBitset() = default;
//! Sets the specified bit to the provided value.
//! @param index index of the bit to set
//! @param value value to set the bit to
virtual void SetBit(uint32_t index, bool value) = 0;
//! Gets the current value of the specified bit.
//! @param index index of the bit to retrieve the value of
//! @return boolean true if the bit is set, false otherwise
virtual bool GetBit(uint32_t index) const = 0;
//! Returns true if any bit is raised, false otherwise.
//! @return boolean true if any bit is raised, false if all bits are lowered
virtual bool AnySet() const = 0;
//! Returns the number of bits that are represented in this fixed size bitset.
//! @return the number of bits that are represented in this fixed size bitset
virtual uint32_t GetValidBitCount() const = 0;
};
}