code/WPILib/Resource.cpp
/**
 * Allocate a specific resource value.
 * The user requests a specific resource value, i.e. channel number and it is verified
 * unallocated, then returned.
 */
Allocate a specific resource value.
The user requests a specific resource value, i.e. channel number and it is verified
unallocated, then returned.
Allocate a specific resource value . The user requests a specific resource value i . e . channel number and it is verified unallocated then returned .
UINT32 Resource::Allocate(UINT32 index)
{
	if (index >= m_size)
	{
		wpi_fatal(IndexOutOfRange);
		return ~0ul;
	}
	if ( m_isAllocated[index] )
	{
		wpi_fatal(ResourceAlreadyAllocated);
		return ~0ul;
	}
	m_isAllocated[index] = true;
	return index;
}
UINT32 Resource :: Allocate ( UINT32 index ) { if ( index >= m_size ) { wpi_fatal ( IndexOutOfRange ) ; return ~ 0ul ; } if ( m_isAllocated [ index ] ) { wpi_fatal ( ResourceAlreadyAllocated ) ; return ~ 0ul ; } m_isAllocated [ index ] = true ; return index ; }
Allocate a specific resource value.
Allocate a specific resource value .