Blender V2.61 - r43446
Classes | Typedefs | Functions

MEM_CacheLimiterC-Api.cpp File Reference

#include <cstddef>
#include "MEM_CacheLimiter.h"
#include "MEM_CacheLimiterC-Api.h"

Go to the source code of this file.

Classes

class  MEM_CacheLimiterCClass
class  MEM_CacheLimiterHandleCClass

Typedefs

typedef MEM_CacheLimiterHandle
< MEM_CacheLimiterHandleCClass
handle_t
typedef MEM_CacheLimiter
< MEM_CacheLimiterHandleCClass
cache_t
typedef std::list
< MEM_CacheLimiterHandleCClass
*, MEM_Allocator
< MEM_CacheLimiterHandleCClass * > > 
list_t

Functions

static intptr_t & get_max ()
void MEM_CacheLimiter_set_maximum (intptr_t m)
intptr_t MEM_CacheLimiter_get_maximum ()
static MEM_CacheLimiterCClasscast (MEM_CacheLimiterC *l)
static handle_tcast (MEM_CacheLimiterHandleC *l)
MEM_CacheLimiterCnew_MEM_CacheLimiter (MEM_CacheLimiter_Destruct_Func data_destructor, MEM_CacheLimiter_DataSize_Func data_size)
void delete_MEM_CacheLimiter (MEM_CacheLimiterC *This)
MEM_CacheLimiterHandleCMEM_CacheLimiter_insert (MEM_CacheLimiterC *This, void *data)
void MEM_CacheLimiter_enforce_limits (MEM_CacheLimiterC *This)
void MEM_CacheLimiter_unmanage (MEM_CacheLimiterHandleC *handle)
void MEM_CacheLimiter_touch (MEM_CacheLimiterHandleC *handle)
void MEM_CacheLimiter_ref (MEM_CacheLimiterHandleC *handle)
void MEM_CacheLimiter_unref (MEM_CacheLimiterHandleC *handle)
int MEM_CacheLimiter_get_refcount (MEM_CacheLimiterHandleC *handle)
void * MEM_CacheLimiter_get (MEM_CacheLimiterHandleC *handle)

Detailed Description

Definition in file MEM_CacheLimiterC-Api.cpp.


Typedef Documentation

Definition at line 52 of file MEM_CacheLimiterC-Api.cpp.

Definition at line 49 of file MEM_CacheLimiterC-Api.cpp.

Definition at line 54 of file MEM_CacheLimiterC-Api.cpp.


Function Documentation

static MEM_CacheLimiterCClass* cast ( MEM_CacheLimiterC l) [inline, static]
static handle_t* cast ( MEM_CacheLimiterHandleC l) [inline, static]

Definition at line 140 of file MEM_CacheLimiterC-Api.cpp.

void delete_MEM_CacheLimiter ( MEM_CacheLimiterC This)

Delete MEM_CacheLimiter

Frees the memory of the CacheLimiter but does not touch managed objects!

Parameters:
This"This" pointer

Definition at line 154 of file MEM_CacheLimiterC-Api.cpp.

References cast().

Referenced by IMB_moviecache_destruct().

static intptr_t& get_max ( ) [static]
void MEM_CacheLimiter_enforce_limits ( MEM_CacheLimiterC This)

Free objects until memory constraints are satisfied

Parameters:
This"This" pointer

Definition at line 165 of file MEM_CacheLimiterC-Api.cpp.

References cast(), MEM_CacheLimiter< T >::enforce_limits(), and MEM_CacheLimiterCClass::get_cache().

Referenced by IMB_moviecache_put().

void* MEM_CacheLimiter_get ( MEM_CacheLimiterHandleC handle)

Get pointer to managed object

Parameters:
handleof object

Definition at line 196 of file MEM_CacheLimiterC-Api.cpp.

References cast().

intptr_t MEM_CacheLimiter_get_maximum ( void  )
int MEM_CacheLimiter_get_refcount ( MEM_CacheLimiterHandleC handle)

Get reference counter.

Parameters:
This"This" pointer, handle of object

Definition at line 190 of file MEM_CacheLimiterC-Api.cpp.

References cast().

MEM_CacheLimiterHandleC* MEM_CacheLimiter_insert ( MEM_CacheLimiterC This,
void *  data 
)

Manage object

Parameters:
This"This" pointer, data data object to manage
Returns:
CacheLimiterHandle to ref, unref, touch the managed object

Definition at line 159 of file MEM_CacheLimiterC-Api.cpp.

References cast(), and MEM_CacheLimiterCClass::insert().

Referenced by IMB_moviecache_put().

void MEM_CacheLimiter_ref ( MEM_CacheLimiterHandleC handle)

Increment reference counter. Objects with reference counter != 0 are _not_ deleted.

Parameters:
handleof object

Definition at line 180 of file MEM_CacheLimiterC-Api.cpp.

References cast().

Referenced by IMB_moviecache_put().

void MEM_CacheLimiter_set_maximum ( intptr_t  m)

Definition at line 38 of file MEM_CacheLimiterC-Api.cpp.

References get_max().

Referenced by wm_init_userdef().

void MEM_CacheLimiter_touch ( MEM_CacheLimiterHandleC handle)

Raise priority of object (put it at the tail of the deletion chain)

Parameters:
handleof object

Definition at line 175 of file MEM_CacheLimiterC-Api.cpp.

References cast().

Referenced by IMB_moviecache_get().

void MEM_CacheLimiter_unmanage ( MEM_CacheLimiterHandleC handle)

Unmanage object previously inserted object. Does _not_ delete managed object!

Parameters:
This"This" pointer, handle of object

Definition at line 170 of file MEM_CacheLimiterC-Api.cpp.

References cast().

Referenced by moviecache_valfree().

void MEM_CacheLimiter_unref ( MEM_CacheLimiterHandleC handle)

Decrement reference counter. Objects with reference counter != 0 are _not_ deleted.

Parameters:
handleof object

Definition at line 185 of file MEM_CacheLimiterC-Api.cpp.

References cast().

Referenced by IMB_moviecache_put().

MEM_CacheLimiterC* new_MEM_CacheLimiter ( MEM_CacheLimiter_Destruct_Func  data_destructor,
MEM_CacheLimiter_DataSize_Func  data_size 
)

Create new MEM_CacheLimiter object managed objects are destructed with the data_destructor

Parameters:
data_destructor
Returns:
A new MEM_CacheLimter object

Definition at line 145 of file MEM_CacheLimiterC-Api.cpp.

Referenced by IMB_moviecache_init().