code/WPILib/Resource.cpp
/**
 * Allocate a resource.
 * When a resource is requested, mark it allocated. In this case, a free resource value
 * within the range is located and returned after it is marked allocated.
 */
Allocate a resource.
When a resource is requested, mark it allocated. In this case, a free resource value
within the range is located and returned after it is marked allocated.
Allocate a resource . When a resource is requested mark it allocated . In this case a free resource value within the range is located and returned after it is marked allocated .
UINT32 Resource::Allocate()
{
	for (UINT32 i=0; i < m_size; i++)
	{
		if ( ! m_isAllocated[i])
		{
			m_isAllocated[i] = true;
			return i;
		}
	}
	wpi_fatal(NoAvailablePorts);
	return ~0ul;
}
UINT32 Resource :: Allocate ( ) { for ( UINT32 i = 0 ; i < m_size ; i ++ ) { if ( ! m_isAllocated [ i ] ) { m_isAllocated [ i ] = true ; return i ; } } wpi_fatal ( NoAvailablePorts ) ; return ~ 0ul ; }
Allocate a resource.
Allocate a resource .