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

DatabaseReadNative.h

Go to the documentation of this file.
00001 #ifndef Impala_Util_DatabaseReadNative_h
00002 #define Impala_Util_DatabaseReadNative_h
00003 
00004 #include <vector>
00005 #include "Util/Database.h"
00006 #include "Basis/Endian.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Util
00011 {
00012 
00013 
00014 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00015     // Replaced with File::ReadNative
00016 template<class BackInsertIterator>
00017 inline void
00018 DatabaseReadNative(BackInsertIterator bi, IOBuffer* buf)
00019 {
00020     typedef typename BackInsertIterator::container_type::value_type elem_type;
00021 
00022     if (! (buf && buf->Valid()))
00023         return;
00024 
00025     while (buf->Available() > 0)
00026     {
00027         elem_type d;
00028         buf->Read(&d, sizeof(d));
00029         EndianSwap(&d);
00030         *bi++ = d;
00031     }
00032 }
00033 #endif // REPOSITORY_USED
00034 
00035 // SK, Oct.'08: Reduced complexity in anticip. of major refactoring
00036 //template<class BackInsertIterator>
00037 //inline void
00038 //DatabaseReadNative(BackInsertIterator bi, String fileName, Database* db)
00039 //{
00040 //    IOBuffer* buf = db->GetIOBuffer(fileName, true, true, "");
00041 //
00042 //    DatabaseReadNative(bi, buf);
00043 //    
00044 //    delete buf;
00045 //}
00046 
00047 
00048 } // namespace Util
00049 } // namespace Impala
00050 
00051 #endif

Generated on Fri Mar 19 09:31:46 2010 for ImpalaSrc by  doxygen 1.5.1