HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_MemoryClient Class Referenceabstract

Wrapper for a client of a limit memory resource. More...

#include <UT_MemoryResource.h>

+ Inheritance diagram for UT_MemoryClient:

Public Types

enum  RequestSeverity { NORMAL_REQUEST, FATAL_REQUEST }
 The urgency of the memory free request. More...
 
enum  Niceness {
  SCRATCH_FREE, READILY_FREE, NORMAL_FREE, RELUCTANT_FREE,
  CANNOT_FREE, MAX_NICENESS
}
 How willingly a client can free memory for other clients. More...
 

Public Member Functions

 UT_MemoryClient ()
 
virtual ~UT_MemoryClient ()
 
virtual const char * name () const =0
 Printable English name of the client. More...
 
virtual bool freeMemoryRequest (const UT_MemoryResource *resource, RequestSeverity severity, Niceness nice_level, exint size_in_bytes, exint &freed_amount_in_bytes)=0
 
virtual bool memoryUse (const UT_MemoryResource *resource, exint &in_use_size_bytes, exint &cached_size_bytes)
 

Detailed Description

Wrapper for a client of a limit memory resource.

Definition at line 26 of file UT_MemoryResource.h.

Member Enumeration Documentation

How willingly a client can free memory for other clients.

Enumerator
SCRATCH_FREE 
READILY_FREE 
NORMAL_FREE 
RELUCTANT_FREE 
CANNOT_FREE 
MAX_NICENESS 

Definition at line 45 of file UT_MemoryResource.h.

The urgency of the memory free request.

Enumerator
NORMAL_REQUEST 
FATAL_REQUEST 

Definition at line 38 of file UT_MemoryResource.h.

Constructor & Destructor Documentation

UT_MemoryClient::UT_MemoryClient ( )
inline

Definition at line 29 of file UT_MemoryResource.h.

virtual UT_MemoryClient::~UT_MemoryClient ( )
inlinevirtual

Definition at line 30 of file UT_MemoryResource.h.

Member Function Documentation

virtual bool UT_MemoryClient::freeMemoryRequest ( const UT_MemoryResource resource,
RequestSeverity  severity,
Niceness  nice_level,
exint  size_in_bytes,
exint freed_amount_in_bytes 
)
pure virtual

A 'resource' is requesting 'size_in_bytes' amount of memory be freed. If memory is freed, return true and the amount of memory freed in 'freed_amount_in_bytes' 'severity' - severity passed to UT_MemoryResource::requestMemoryFree() 'nice_level' - the current niceness level being asked to free. This will always match once of the niceness levels the client was registered with.

Implemented in CE_RampCache::MemoryClient.

virtual bool UT_MemoryClient::memoryUse ( const UT_MemoryResource resource,
exint in_use_size_bytes,
exint cached_size_bytes 
)
inlinevirtual

Report the amount of memory this client is using from 'resource' 'in_use' refers to memory that is currently being used, where as 'cached' refers to memory that'd being held either for reuse or scratch buffers. Return true if the size can be meaningully reported.

Reimplemented in CE_RampCache::MemoryClient.

Definition at line 74 of file UT_MemoryResource.h.

virtual const char* UT_MemoryClient::name ( ) const
pure virtual

Printable English name of the client.

Implemented in CE_RampCache::MemoryClient.


The documentation for this class was generated from the following file: