DUNE: Uniform Navigational Environment  2016.09.0
DUNE::System::Resources Class Reference

Public Member Functions

 Resources (void)
 
int getProcessorUsage (void)
 

Static Public Member Functions

static void lockMemory (void)
 
static void unlockMemory (void)
 
static void lockMemory (void *addr, size_t length)
 
static void unlockMemory (const void *addr, size_t length)
 

Constructor & Destructor Documentation

DUNE::System::Resources::Resources ( void  )

Initialize resource monitor.

References getProcessorUsage().

Member Function Documentation

int DUNE::System::Resources::getProcessorUsage ( void  )

Retrieve the percentage of CPU time used by the calling process since the last call to this function or object creation.

On multi CPU systems the CPU time is an average.

Returns
percentage of the CPU time used or -1 if not implemented in the current platform.

Referenced by Resources().

void DUNE::System::Resources::lockMemory ( void  )
static

Make all memory pages mapped by the address space of the current process to be memory-resident until unlocked or until the process exits.

void DUNE::System::Resources::lockMemory ( void *  addr,
size_t  length 
)
static

Make those whole pages containing any part of the address space of the process starting at address 'addr' and continuing for 'length' bytes to be memory-resident until unlocked or until the process exits or execs another process image.

Parameters
[in]addrstarting memory address.
[in]lengthlength of memory.
void DUNE::System::Resources::unlockMemory ( void  )
static

Unlock memory pages.

void DUNE::System::Resources::unlockMemory ( const void *  addr,
size_t  length 
)
static

Unlock memory pages.

Parameters
[in]addrstarting memory address.
[in]lengthlength of memory.
Collaboration diagram for DUNE::System::Resources:
Collaboration graph