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

QuidTableRepositoryInFile.h

Go to the documentation of this file.
00001 #ifndef Impala_Persistency_QuidTableRepositoryInFile_h
00002 #define Impala_Persistency_QuidTableRepositoryInFile_h
00003 
00004 #include "Persistency/RepositoryInFileSystem.h"
00005 #include "Core/Table/QuidTable.h"
00006 #include "Persistency/QuidTableLocator.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Persistency
00011 {
00012 
00013 
00014 class QuidTableRepositoryInFile
00015 {
00016 public:
00017 
00018     typedef Core::Table::QuidTable QuidTable;
00019 
00020     QuidTableRepositoryInFile()
00021     {
00022     }
00023 
00024     QuidTable*
00025     Get(const QuidTableLocator& loc)
00026     {
00027         QuidTable* res = new QuidTable();
00028         File file = RepFS().GetFile(loc, loc.GetDir(), loc.GetName(),
00029                                     false, false);
00030         if (!file.Valid())
00031             return 0;
00032         Read(res, file);
00033         return res;
00034     }
00035 
00036     void
00037     Add(const QuidTableLocator& loc, QuidTable* tab)
00038     {
00039         File file = RepFS().GetFile(loc, loc.GetDir(), loc.GetName(),
00040                                     true, false);
00041         Write(tab, file);
00042     }
00043 
00044 private:
00045 
00046     RepositoryInFileSystem&
00047     RepFS()
00048     {
00049         return RepositoryInFileSystem::GetInstance();
00050     }
00051 
00052     ILOG_VAR_DEC;
00053 };
00054 
00055 ILOG_VAR_INIT(QuidTableRepositoryInFile, Impala.Persistency);
00056 
00057 } // namespace Persistency
00058 } // namespace Impala
00059 
00060 #endif

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