Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Enumerations | Functions | Variables
h_mgr.h File Reference
#include <stdarg.h>
#include "handle.h"
#include "lib/file/vfs/vfs.h"

Go to the source code of this file.

Classes

struct  H_VTbl
 

Macros

#define H_TYPE_DEFINE(type)
 
#define H_USER_DATA(h, type)   (type*)h_user_data(h, H_##type)
 
#define H_DEREF(h, type, var)
 

Typedefs

typedef H_VTblH_Type
 

Enumerations

enum  { RES_NO_CACHE = 0x01, RES_UNIQUE = RES_NO_CACHE|0x10, RES_DISALLOW_RELOAD = 0x20 }
 

Functions

void h_mgr_init ()
 
void h_mgr_shutdown ()
 
Handle h_alloc (H_Type type, const PIVFS &vfs, const VfsPath &pathname, size_t flags=0,...)
 
Status h_free (Handle &h, H_Type type)
 
void h_mgr_free_type (const H_Type type)
 
Handle h_find (H_Type type, uintptr_t key)
 
void * h_user_data (Handle h, H_Type type)
 
VfsPath h_filename (Handle h)
 
Status h_reload (const PIVFS &vfs, const VfsPath &pathname)
 
Status h_force_free (Handle h, H_Type type)
 
void h_add_ref (Handle h)
 
intptr_t h_get_refcnt (Handle h)
 

Variables

const size_t H_STRING_LEN = 256
 

Macro Definition Documentation

#define H_DEREF (   h,
  type,
  var 
)
Value:
/* h already indicates an error - return immediately to pass back*/\
/* that specific error, rather than only ERR::INVALID_HANDLE*/\
if(h < 0)\
type* const var = H_USER_DATA(h, type);\
if(!var)\
const Status INVALID_HANDLE
Definition: status.h:419
i64 Status
Error handling system.
Definition: status.h:171
#define WARN_RETURN(status)
Definition: status.h:255
#define H_USER_DATA(h, type)
Definition: h_mgr.h:334

Definition at line 341 of file h_mgr.h.

#define H_TYPE_DEFINE (   type)
Value:
/* forward decls */\
static void type##_init(type*, va_list);\
static Status type##_reload(type*, const PIVFS&, const VfsPath&, Handle);\
static void type##_dtor(type*);\
static Status type##_validate(const type*);\
static Status type##_to_string(const type*, wchar_t* buf);\
static H_VTbl V_##type =\
{\
(void (*)(void*, va_list))type##_init,\
(Status (*)(void*, const PIVFS&, const VfsPath&, Handle))type##_reload,\
(void (*)(void*))type##_dtor,\
(Status (*)(const void*))type##_validate,\
(Status (*)(const void*, wchar_t*))type##_to_string,\
sizeof(type), /* control block size */\
WIDEN(#type) /* name */\
};\
static H_Type H_##type = &V_##type
shared_ptr< IVFS > PIVFS
Definition: vfs.h:226
Definition: h_mgr.h:294
#define WIDEN(x)
Definition: path.h:75
i64 Status
Error handling system.
Definition: status.h:171
i64 Handle
`handle&#39; representing a reference to a resource (sound, texture, etc.)
Definition: handle.h:41

Definition at line 307 of file h_mgr.h.

#define H_USER_DATA (   h,
  type 
)    (type*)h_user_data(h, H_##type)

Definition at line 334 of file h_mgr.h.

Typedef Documentation

typedef H_VTbl* H_Type

Definition at line 305 of file h_mgr.h.

Enumeration Type Documentation

anonymous enum
Enumerator
RES_NO_CACHE 
RES_UNIQUE 
RES_DISALLOW_RELOAD 

Definition at line 358 of file h_mgr.h.

Function Documentation

void h_add_ref ( Handle  h)

Definition at line 715 of file h_mgr.cpp.

Handle h_alloc ( H_Type  type,
const PIVFS vfs,
const VfsPath pathname,
size_t  flags = 0,
  ... 
)

Definition at line 519 of file h_mgr.cpp.

VfsPath h_filename ( Handle  h)

Definition at line 625 of file h_mgr.cpp.

Handle h_find ( H_Type  type,
uintptr_t  key 
)

Definition at line 679 of file h_mgr.cpp.

Status h_force_free ( Handle  h,
H_Type  type 
)

Definition at line 693 of file h_mgr.cpp.

Status h_free ( Handle h,
H_Type  type 
)

Definition at line 583 of file h_mgr.cpp.

intptr_t h_get_refcnt ( Handle  h)

Definition at line 732 of file h_mgr.cpp.

void h_mgr_free_type ( const H_Type  type)

Definition at line 790 of file h_mgr.cpp.

void h_mgr_init ( )

Definition at line 811 of file h_mgr.cpp.

void h_mgr_shutdown ( )

Definition at line 816 of file h_mgr.cpp.

Status h_reload ( const PIVFS vfs,
const VfsPath pathname 
)

Definition at line 637 of file h_mgr.cpp.

void* h_user_data ( Handle  h,
H_Type  type 
)

Definition at line 607 of file h_mgr.cpp.

Variable Documentation

const size_t H_STRING_LEN = 256

Definition at line 371 of file h_mgr.h.