16 #include <wpi/mutex.h>
18 #include "frc/ErrorBase.h"
66 uint32_t
Allocate(
const std::string& resourceDesc);
74 uint32_t
Allocate(uint32_t index,
const std::string& resourceDesc);
83 void Free(uint32_t index);
86 std::vector<bool> m_isAllocated;
87 wpi::mutex m_allocateMutex;
89 static wpi::mutex m_createMutex;
The Resource class is a convenient way to track allocated resources.
Definition: Resource.h:32
Resource(uint32_t size)
Allocate storage for a new instance of Resource.
static void CreateResourceObject(std::unique_ptr< Resource > &r, uint32_t elements)
Factory method to create a Resource allocation-tracker if needed.
Base class for most objects.
Definition: ErrorBase.h:104
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
uint32_t Allocate(const std::string &resourceDesc)
Allocate a resource.
void Free(uint32_t index)
Free an allocated resource.