mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Deprecate Resource (#6952)
This commit is contained in:
@@ -4,8 +4,11 @@
|
||||
|
||||
#include "frc/Resource.h"
|
||||
|
||||
#include <wpi/deprecated.h>
|
||||
|
||||
#include "frc/Errors.h"
|
||||
|
||||
WPI_IGNORE_DEPRECATED
|
||||
using namespace frc;
|
||||
|
||||
wpi::mutex Resource::m_createMutex;
|
||||
@@ -17,6 +20,7 @@ void Resource::CreateResourceObject(std::unique_ptr<Resource>& r,
|
||||
r = std::make_unique<Resource>(elements);
|
||||
}
|
||||
}
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
|
||||
Resource::Resource(uint32_t elements) {
|
||||
m_isAllocated = std::vector<bool>(elements, false);
|
||||
|
||||
@@ -23,8 +23,9 @@ namespace frc {
|
||||
* The Resource class does not allocate the hardware channels or other
|
||||
* resources; it just tracks which indices were marked in use by Allocate and
|
||||
* not yet freed by Free.
|
||||
* @deprecated Use the HandleResource classes instead
|
||||
*/
|
||||
class Resource {
|
||||
class [[deprecated("Use the HandleResource classes instead")]] Resource {
|
||||
public:
|
||||
virtual ~Resource() = default;
|
||||
|
||||
|
||||
@@ -19,7 +19,10 @@ import edu.wpi.first.hal.util.CheckedAllocationException;
|
||||
* created. Then, when the program actually starts - in the Robot constructor, all resources are
|
||||
* initialized. This ensures that the program is restartable in memory without having to
|
||||
* unload/reload.
|
||||
*
|
||||
* @deprecated Will be removed with no replacement.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "2025")
|
||||
public final class Resource {
|
||||
private static Resource resourceList;
|
||||
private final boolean[] m_numAllocated;
|
||||
|
||||
Reference in New Issue
Block a user