2
* Copyright 2011, Blender Foundation.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
#ifndef _COM_MemoryProxy_h_
27
#define _COM_MemoryProxy_h_
28
#include "COM_ExecutionGroup.h"
33
* @brief A MemoryProxy is a unique identifier for a memory buffer.
34
* A single MemoryProxy is used among all chunks of the same buffer,
35
* the MemoryBuffer only stores the data of a single chunk.
41
* @brief reference to the ouput operation of the executiongroup
43
WriteBufferOperation *m_writeBufferOperation;
46
* @brief reference to the executor. the Execution group that can fill a chunk
48
ExecutionGroup *m_executor;
51
* @brief datatype of this MemoryProxy
53
/* DataType m_datatype; */ /* UNUSED */
56
* @brief channel information of this buffer
58
/* ChannelInfo m_channelInfo[COM_NUMBER_OF_CHANNELS]; */ /* UNUSED */
61
* @brief the allocated memory
63
MemoryBuffer *m_buffer;
69
* @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
70
* @param group the ExecutionGroup to set
72
void setExecutor(ExecutionGroup *executor) { this->m_executor = executor; }
75
* @brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
77
ExecutionGroup *getExecutor() { return this->m_executor; }
80
* @brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
83
void setWriteBufferOperation(WriteBufferOperation *operation) { this->m_writeBufferOperation = operation; }
86
* @brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
87
* @return WriteBufferOperation
89
WriteBufferOperation *getWriteBufferOperation() { return this->m_writeBufferOperation; }
92
* @brief allocate memory of size width x height
94
void allocate(unsigned int width, unsigned int height);
97
* @brief free the allocated memory
102
* @brief get the allocated memory
104
inline MemoryBuffer *getBuffer() { return this->m_buffer; }
106
#ifdef WITH_CXX_GUARDEDALLOC
107
MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryProxy")