Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

ArrayListExport.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_ArrayListExport_h
00002 #define Impala_Core_Array_ArrayListExport_h
00003 
00004 #include <vector>
00005 #include "Core/Array/Arrays.h"
00006 #include "Core/Array/Set.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace Array
00013 {
00014 
00015 
00016 template<class ArrayT>
00017 inline typename ArrayT::StorType*
00018 ArrayListExport(const std::vector<ArrayT*>& list)
00019 {
00020     typedef typename ArrayT::StorType StorT;
00021 
00022     int cw = list[0]->CW();
00023     int ch = list[0]->CH();
00024     int nr = list.size();
00025     int nc = cw * ch;
00026     StorT* data = new StorT[nr*nc];
00027     ArrayT* wrapper = ArrayCreate<ArrayT>(cw, ch, 0, 0, data, true);
00028     for (int i=0 ; i<list.size() ; i++)
00029     {
00030         Set(wrapper, list[i]);
00031         wrapper->mData += nc * ArrayT::ElemSize();
00032     }
00033     delete wrapper;
00034     return data;
00035 }
00036 
00037 } // namespace Array
00038 } // namespace Core
00039 } // namespace Impala
00040 
00041 #endif

Generated on Fri Mar 19 09:30:43 2010 for ImpalaSrc by  doxygen 1.5.1