Skip to content

Commit

Permalink
[wpilib] Deprecate Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Aug 12, 2024
1 parent b057044 commit cce0eae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion wpilibc/src/main/native/cpp/Resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "frc/Errors.h"

using namespace frc;

#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif
wpi::mutex Resource::m_createMutex;

void Resource::CreateResourceObject(std::unique_ptr<Resource>& r,
Expand Down
3 changes: 2 additions & 1 deletion wpilibc/src/main/native/include/frc/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
* 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;
Expand Down

0 comments on commit cce0eae

Please sign in to comment.