X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_Bilat_Graph2D%2FINC%2Fmodel%2Fshared_array.h;fp=WCudaMSE%2FAPI_Bilat_Graph2D%2FINC%2Fmodel%2Fshared_array.h;h=a7fa2fe3e0369b32cfddb728f13b96e3ecfc129d;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/API_Bilat_Graph2D/INC/model/shared_array.h b/WCudaMSE/API_Bilat_Graph2D/INC/model/shared_array.h new file mode 100755 index 0000000..a7fa2fe --- /dev/null +++ b/WCudaMSE/API_Bilat_Graph2D/INC/model/shared_array.h @@ -0,0 +1,40 @@ +#ifndef SHAREDARRAY_H_ +#define SHAREDARRAY_H_ + +// C++11 +#include + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +template +class shared_array: public std::shared_ptr + { + public: + shared_array(T* pointer) : + std::shared_ptr(pointer, std::default_delete()) + { + + } + + T& operator[](int i) + { + return this->get()[i]; + } + + T& operator[](int i) const + { + return this->get()[i]; + } + }; + +#endif + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/