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