CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxBuffer.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : ctxBuffer.h
3// Description : Managers memory buffers
4// Author : Anders Modén
5// Product : CorTeX 2.0.1
6//
7// Copyright © 2015- Anders Modén, Sweden
8//
9// NOTE: CorTeX is a software development kit (SDK)
10// for neural networks and genetic programming.
11// Licensed by Anders Modén.
12//
13//
14// Revision History...
15//
16// Who Date Description
17//
18// AMO 150708 Created file (1.0.0)
19//
20//******************************************************************************
21#ifndef __CTX_BUFFER_H__
22#define __CTX_BUFFER_H__
23
24
25#include "ctxBase.h"
26#include "ctxBufferType.h"
27
28// ----------------------------------- ctxBufferType ----------------------------------
38
39
40// ----------------------------------- ctxBuffer --------------------------------------
41
42class ctxBuffer : public gzThreadSafeReference
43{
44public:
45
46 GZ_DECLARE_TYPE_INTERFACE_EXPORT(CTX_EXPORT);
47
48 // Public static create interface --------------------
49
50 CTX_EXPORT static ctxBuffer *create(ctxBufferType type, gzUInt32 size);
51
52 // Public virtual interface methods------------------
53
54 virtual gzBool setBufferData(const gzVoid *memory,gzUInt32 size, gzUInt32 offset=0) = 0 ;
55
56 virtual gzBool getBufferData(gzVoid *memory,gzUInt32 size, gzUInt32 offset = 0) const = 0 ;
57
58 virtual ctxBufferType getBufferType() const = 0;
59
60 virtual gzUInt32 getBufferSize() const = 0;
61};
62
63GZ_DECLARE_REFPTR(ctxBuffer);
64
65// ----------------------------------- ctxBufferManager -------------------------------
66
67
68class ctxBufferManager : public gzReference
69{
70public:
71
72 GZ_DECLARE_TYPE_INTERFACE_EXPORT(CTX_EXPORT);
73
74 // Public static interface --------------------
75
76 CTX_EXPORT static ctxBuffer *create(ctxBufferType type,gzUInt32 size);
77
79
80protected:
81
82 virtual ctxBuffer *createBuffer(ctxBufferType type, gzUInt32 size) = 0;
83
84 virtual gzBool initialize() = 0;
85
86 CTX_EXPORT static gzMutex s_locker;
87
88 CTX_EXPORT static gzRefPointer<ctxBufferManager> s_currentManager;
89
90};
91
92
93#endif //__CTX_BUFFER_H__
94
95
virtual gzUInt32 getBufferSize() const =0
static ctxBuffer * create(ctxBufferType type, gzUInt32 size)
virtual gzBool setBufferData(const gzVoid *memory, gzUInt32 size, gzUInt32 offset=0)=0
virtual ctxBufferType getBufferType() const =0
virtual gzBool getBufferData(gzVoid *memory, gzUInt32 size, gzUInt32 offset=0) const =0
static gzMutex s_locker
Definition ctxBuffer.h:86
static gzRefPointer< ctxBufferManager > s_currentManager
Definition ctxBuffer.h:88
static gzBool setBufferManager(ctxBufferManager *manager)
static ctxBuffer * create(ctxBufferType type, gzUInt32 size)
virtual ctxBuffer * createBuffer(ctxBufferType type, gzUInt32 size)=0
virtual gzBool initialize()=0
#define CTX_EXPORT
Definition ctxBase.h:68
ctxDimension
Definition ctxBuffer.h:30
@ CTX_DIM_4
Definition ctxBuffer.h:35
@ CTX_DIM_5
Definition ctxBuffer.h:36
@ CTX_DIM_2
Definition ctxBuffer.h:33
@ CTX_DIM_1
Definition ctxBuffer.h:32
@ CTX_DIM_3
Definition ctxBuffer.h:34
@ CTX_DIM_ITEM_SIZE
Definition ctxBuffer.h:31
ctxBufferType