Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Friends | List of all members
CacheAllocator Class Reference
Inheritance diagram for CacheAllocator:
Cache DataStream PageManager

Public Types

enum  {
  kDefaultItemAlignment = 4*KB,
  kFileSizeBytes = 4*GB,
  kFileSizeItems = kFileSizeBytes/kDefaultItemAlignment
}
 

Public Member Functions

virtual INodeUint32 get_id () const
 
virtual const CoreStringget_name () const
 
virtual INodeUint64 get_data_alignment () const
 
const CoreStringget_folder_path () const
 
void print (const char *msg)
 
void discard (CacheTag &tag)
 
virtual bool read (CacheTag &tag, void *data, INodeUint64 nbytes)
 
virtual bool write (CacheTag &tag, const void *data, INodeUint64 nbytes)
 
virtual bool reserve_write (CacheTag &cache_tag, INodeUint64 nbytes)
 
virtual bool write_reserved (CacheTag &cache_tag, const void *data, INodeUint64 nbytes)
 
virtual bool reserve_read (CacheTag &cache_tag)
 
virtual bool read_reserved (CacheTag &cache_tag, void *dst, INodeUint64 nbytes)
 
CoreString get_cache_file_path (INodeUint32 idx)
 
- Public Member Functions inherited from PageManager
void print (const char *msg="")
 
void print_page (INodeUint32 page, const char *msg="")
 
INodeUint32 get_page_count () const
 
INodeUint32 get_active_page_count () const
 
INodeUint32 get_page_min_size () const
 
INodeUint32 get_page_max_size () const
 
INodeUint64 get_peak_usage () const
 
INodeUint64 get_current_usage () const
 
INodeUint64 get_item_alignment () const
 
INodeUint32 get_item_count (INodeUint64 nbytes) const
 
INodeUint64 get_byte_count (INodeUint64 nitems) const
 
INodeUint64 get_page_size_bytes (INodeUint32 page) const
 
INodeUint64 get_page_size_used_bytes (INodeUint32 page) const
 
const CoreStringget_description () const
 
bool is_page_monolithic (INodeUint32 page) const
 
bool is_page_full (INodeUint32 page) const
 
bool is_page_empty (INodeUint32 page) const
 
INodeUint64 get_page_size (INodeUint32 page) const
 
INodeUint64 get_page_size_used (INodeUint32 page) const
 

Friends

class CacheManager
 

Additional Inherited Members

- Static Public Member Functions inherited from Cache
static Cacheget_owner (const CacheTag &tag)
 
static Cacheget_temporary (const CoreString &name)
 
static Cacheget_persistent (const CoreString &name)
 
static bool read (CacheTag &cache_tag, void *data, INodeUint64 nbytes, DataSerialize *serial=0, void *user_data=0)
 
static bool write (Cache *cache, CacheTag &cache_tag, void *data, INodeUint64 nbytes, DataSerialize *serial=0, void *user_data=0)
 
static void destroy (CacheTag &cache_tag)
 
- Protected Member Functions inherited from PageManager
 PageManager (const CoreString &_description, INodeUint32 item_alignment, INodeUint64 page_min_bytes, INodeUint64 page_max_bytes)
 
int take_span_new_page (INodeUint32 required_size, INodeUint32 new_page_size)
 
Slot take_span (INodeUint32 required_size)
 
void release_span (Slot slot, INodeUint32 size)
 
void release_span_lazy (Slot slot, INodeUint32 size)
 
void inc_item_usage (INodeUint32 nitems)
 
void dec_item_usage (INodeUint32 nitems)
 
Pageget_pages ()
 
Pageget_page (INodeUint32 i)
 
const Pageget_page (INodeUint32 i) const
 
void add_page_to_bucket (int page, int bucket)
 
void remove_page_from_bucket (int page, int bucket_idx)
 
void remove_page_from_bucket_conditional (int page, int bucket_idx)
 
void destroy_page_image (INodeUint32 i)