16 #include <support/mutex.h> 18 #include "ErrorBase.h" 42 uint32_t
Allocate(
const std::string& resourceDesc);
43 uint32_t
Allocate(uint32_t index,
const std::string& resourceDesc);
44 void Free(uint32_t index);
47 std::vector<bool> m_isAllocated;
48 wpi::mutex m_allocateMutex;
50 static wpi::mutex m_createMutex;
Definition: RobotController.cpp:14
The Resource class is a convenient way to track allocated resources.
Definition: Resource.h:32
uint32_t Allocate(const std::string &resourceDesc)
Allocate a resource.
Definition: Resource.cpp:54
Base class for most objects.
Definition: ErrorBase.h:74
void Free(uint32_t index)
Free an allocated resource.
Definition: Resource.cpp:93
static void CreateResourceObject(std::unique_ptr< Resource > &r, uint32_t elements)
Factory method to create a Resource allocation-tracker if needed.
Definition: Resource.cpp:39