HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
OP_Cache.h
Go to the documentation of this file.
1
#ifndef _OP_Cache_
2
#define _OP_Cache_
3
4
#include "
OP_API.h
"
5
#include "
OP_Context.h
"
6
#include <
UT/UT_NonCopyable.h
>
7
#include <
UT/UT_StringHolder.h
>
8
#include <
UT/UT_Array.h
>
9
10
class
OP_Node
;
11
class
OP_CacheInfo
;
12
class
op_CacheEntry;
13
14
class
OP_API
OP_Cache
:
public
UT_NonCopyable
15
{
16
public
:
17
OP_Cache
(
OP_Node
*client,
18
const
char
*cop2_name,
19
const
char
*
cache_name
);
20
virtual
~
OP_Cache
();
21
22
void
setSize(
int
size
);
23
int
getSize
()
const
24
{
return
( myMaxSize ); }
25
26
void
*getData(
const
OP_Context
&context);
27
28
void
putData(
void
*
data
,
const
OP_Context
&
c
);
29
void
updateContextDeps(
const
DEP_ContextOptionDeps
&deps);
30
31
bool
ownsData(
void
*);
// Does the cache own the data
32
void
clear();
// Deletes all data in the cache.
33
34
// These are public; however, they're meant for diagnostics
35
void
print
(FILE *);
36
const
void
*getDataPtr(
int
idx);
37
const
OP_Context
*getContextPtr(
int
idx);
38
39
virtual
int64
getMemoryUsage
(
bool
inclusive)
const
40
{
41
int64
mem = inclusive ?
sizeof
(*this) : 0;
42
mem += myCacheData.getMemoryUsage(
false
);
43
mem += myOpName.getMemoryUsage(
false
);
44
mem += myCacheName.getMemoryUsage(
false
);
45
return
mem;
46
}
47
48
private
:
49
void
deleteData(op_CacheEntry *entry)
const
;
50
bool
deleteReference(
void
*);
51
52
OP_Node
*myClient;
53
UT_StringHolder
myOpName;
54
UT_StringHolder
myCacheName;
55
UT_Array<op_CacheEntry *>
myCacheData;
56
int
myMaxSize;
57
};
58
59
#endif
DEP_ContextOptionDeps
UT_ConcurrentSet< UT_StringHolder > DEP_ContextOptionDeps
Definition:
DEP_ContextOptions.h:23
GT_Names::cache_name
GT_API const UT_StringHolder cache_name
UT_Array.h
OP_API.h
UT_Array< op_CacheEntry * >
OP_Cache::getSize
int getSize() const
Definition:
OP_Cache.h:23
OP_Context
Definition:
OP_Context.h:44
UT_StringHolder
Definition:
UT_StringHolder.h:999
OP_Node
Definition:
OP_Node.h:503
int64
long long int64
Definition:
SYS_Types.h:116
UT_NonCopyable.h
OP_Cache
Definition:
OP_Cache.h:14
OP_Context.h
size
GLsizeiptr size
Definition:
glcorearb.h:664
UT_StringHolder.h
OP_API
#define OP_API
Definition:
OP_API.h:10
nanovdb::io::c
c
Definition:
IO.h:328
UT_NonCopyableNS::UT_NonCopyable
Definition:
UT_NonCopyable.h:17
OP_CacheInfo
Definition:
OP_CacheInfo.h:6
OP_Cache::getMemoryUsage
virtual int64 getMemoryUsage(bool inclusive) const
Definition:
OP_Cache.h:39
print
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
Definition:
core.h:2976
data
Definition:
format.h:895
OP
OP_Cache.h
Generated on Sun Nov 17 2024 03:01:33 for HDK by
1.8.6