gpu_resource.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Kutumov Alexey                                  *
00003  *   ru.pixel@gmail.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00033 #ifndef __gpu_resource__header__
00034 #define __gpu_resource__header__
00035 
00036 
00037 #include "gpucalc/object.h"
00038 
00039 namespace gpucalc
00040 {
00041  
00042  class GPUResource: virtual public Object
00043  {
00044 
00045 
00046   OBJ_DISABLE_COPY(GPUResource)
00047   
00048   
00049   
00050   public:
00051    GPUResource(const std::string & ClassName, const std::string & ObjectName): Object(ClassName, ObjectName),
00052     mNumberOfComponents(0), mSizeX(0), mSizeY(0), mSizeZ(0), mDimension(0), mTypeSize(0), mComponentSize(0),
00053     mActualLengthGPU(0)
00054    {
00055    }
00056 
00057 
00058    virtual ~GPUResource()
00059    {
00060    }
00061 
00062 
00063    virtual size_t getNumberOfComponents() const
00064    {
00065     return mNumberOfComponents;
00066    }
00067 
00068 
00069    virtual int getSizeX() const
00070    {
00071     return mSizeX;
00072    }
00073 
00074 
00075    virtual int getSizeY() const
00076    {
00077     return mSizeY;
00078    }
00079 
00080 
00081    virtual int getSizeZ() const
00082    {
00083     return mSizeZ;
00084    }
00085 
00086 
00087    virtual int getDimension() const
00088    {
00089     return mDimension;
00090    }
00091 
00092 
00093    virtual size_t getTypeSize() const
00094    {
00095     return mTypeSize;
00096    }
00097 
00098 
00099    virtual size_t getComponentSize() const
00100    {
00101     return mComponentSize;
00102    }
00103 
00104 
00105    virtual size_t getActualLengthGPU() const
00106    {
00107     return mActualLengthGPU;
00108    }
00109 
00110 
00111    virtual void uploadToGPU() = 0;
00112 
00113 
00114    virtual bool isUploadedToGPU() const = 0;
00115 
00116 
00117    virtual void initialize() = 0;
00118 
00119 
00120    virtual bool isInitialized() const = 0;
00121 
00122 
00123 
00124   protected:
00125    size_t mNumberOfComponents;
00126    size_t mSizeX;
00127    size_t mSizeY;
00128    size_t mSizeZ;
00129    size_t mDimension;
00130    size_t mTypeSize;
00131    size_t mComponentSize;
00132    size_t mActualLengthGPU;
00133  };
00134  
00135  
00136 }
00137 
00138 #endif

Generated on Thu Mar 5 22:36:42 2009 for gpucalc by  doxygen 1.5.6