creaImageIO_lib
creaImageIO::Synchronizer Class Reference

In charge of the synchronization of the database and the disk state. More...

#include <creaImageIOSynchron.h>

Collaboration diagram for creaImageIO::Synchronizer:

Public Member Functions

 Synchronizer (const std::string &path)
 Ctor. More...
 
virtual ~Synchronizer ()
 Dtor. More...
 
void Initialize ()
 Initializes the database. More...
 
void InsertAddOp (const std::string &path, const std::string &recursive, const std::string &nChildren, const std::string &refdb)
 Inserts an add operation to the database. More...
 
void InsertIgnoreFile (const std::string &addKey, const std::string &path, const std::string &remove, const std::string &time, const std::string &refdb)
 Inserts a file to be ignored. More...
 
void RemoveEntry (const std::string i_table, const std::string i_key)
 Removes an entry that matches the given parameter. More...
 
void RemoveEntries (const std::string i_table, const std::string i_attribute, const std::string i_operand, const std::string i_key)
 Removes several entries. More...
 
void GetFileList (std::vector< AddList > &files, const std::string &refdb)
 Gets the list of AddFiles. More...
 
void GetIgnoredFiles (const std::string &key, std::vector< std::string > &ignoreList)
 Gets the list of ignored files. More...
 
std::string GetAttribute (const std::string &attribute, const std::string &table, const std::string &searchParam, const std::string &searchValue, const std::string &refdb)
 Gets the attribute that matches the parameters. More...
 
void SetAttribute (const std::string &attribute, const std::string &table, const std::string &value, const std::string &searchParam, const std::string &searchValue, const std::string &refdb)
 Sets an attribute to an entry that matches the given parameters. More...
 
void GetList (const std::string i_db)
 
bool isIndexed (const std::string filename)
 
 Synchronizer (TreeHandler *th)
 Ctor. More...
 
 ~Synchronizer ()
 Dtor. More...
 
void SetTreeHandler (TreeHandler *handler)
 Sets the tree handler to use in order to synchronize with a given database. More...
 
std::string Synchronize (bool update)
 
bool FileExists (std::string file)
 Checks if the file given as a parameter exists in the drive. More...
 
void AttributesMatch (bool update, std::string file, std::stringstream &mess)
 

Public Attributes

std::map< std::string, bool > mList
 
std::vector< AddListmAddList
 The current AddList. More...
 
std::vector< RemoveListmIgnoreList
 The current RemoveList. More...
 

Private Member Functions

void CreateDB ()
 Creates a new database. More...
 
void UpdateAddList (const std::string &refdb)
 Updates the AddList. More...
 
void CleanList (const std::string &refdb)
 Cleans the list in case operations are no longer useful (0 added files) More...
 
void CleanName (std::string &str) const
 Cleans the name (changes slashes and backslashes according to the system) More...
 
std::vector< std::string > GetIgnoreList (const std::string &i_key)
 Gets the ignore list. More...
 
const std::string convert (const std::string &i_word)
 
void SynchronizeFile (bool update, std::string file, std::stringstream &message)
 Synchronizes the given file, doing the action required and returning the result on the string supplied. More...
 

Private Attributes

CppSQLite3DBmDB
 The DB. More...
 
std::string pathDB
 Path of the current database. More...
 
TreeHandlermHandler
 The tree handler. More...
 
ImageReader mReader
 The image reader. More...
 

Detailed Description

In charge of the synchronization of the database and the disk state.

Synchronizes a given database with disk.

Definition at line 89 of file creaImageIOSynchron.h.

Constructor & Destructor Documentation

creaImageIO::Synchronizer::Synchronizer ( const std::string &  path)

Ctor.

Definition at line 68 of file creaImageIOSynchron.cpp.

References Initialize(), mDB, and pathDB.

69  {
70  pathDB = path + "maintenance_database.db3";
71  mDB = new CppSQLite3DB;
72  Initialize();
73  }

Here is the call graph for this function:

creaImageIO::Synchronizer::~Synchronizer ( )
virtual

Dtor.

Definition at line 76 of file creaImageIOSynchron.cpp.

References mDB.

77  {
78  delete mDB;
79  }
creaImageIO::Synchronizer::Synchronizer ( TreeHandler th)

Ctor.

Definition at line 39 of file creaImageIOSynchronizer.cpp.

40  : mHandler(th)
41  {
42 
43  }
creaImageIO::Synchronizer::~Synchronizer ( )

Dtor.

Member Function Documentation

void creaImageIO::Synchronizer::AttributesMatch ( bool  update,
std::string  file,
std::stringstream &  mess 
)

Checks if the attributes of the node given as a parameter matchwith it correspondent file in disk NB: This method doesn't check the existence of the file, so FileExists should be called before.

Definition at line 114 of file creaImageIOSynchronizer.cpp.

References creaImageIO::tree::Descriptor::BuildAttributeMap(), creaImageIO::TreeHandler::GetAttribute(), creaImageIO::tree::Tree::GetAttributeDescriptorList(), creaImageIO::tree::Tree::GetDescriptor(), creaImageIO::tree::Tree::GetNumberOfLevels(), creaImageIO::TreeHandler::GetTree(), mHandler, mReader, creaImageIO::ImageReader::ReadAttributes(), and creaImageIO::TreeHandler::SetAttribute().

Referenced by SynchronizeFile().

115  {
116  std::map< std::string, std::string> attr;
118  mReader.ReadAttributes(file,attr);
120  tree::LevelDescriptor::AttributeDescriptorListType::const_iterator a;
121  for (a = adl.begin();a!=adl.end();++a)
122  {
123  std::string databaseVal;
124  mHandler->GetAttribute("Image","FullFileName",file,a->GetKey(),databaseVal);
125  std::string fileVal=attr.find(a->GetKey())->second;
126  if ( a->GetFlags()==0 && databaseVal.compare(fileVal)!=0 )
127  {
128  if(update)
129  {
130  mHandler->SetAttribute("Image",a->GetKey(),fileVal,"FullFileName", file);
131  mess<<file<<" has been updated in the DB"<<std::endl;
132  }
133  else
134  {
135  mess<<file<<" State: Attributes differ"<<std::endl;
136  }
137  }
138  }
139  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::CleanList ( const std::string &  refdb)
private

Cleans the list in case operations are no longer useful (0 added files)

Definition at line 211 of file creaImageIOSynchron.cpp.

References mAddList, RemoveEntry(), and UpdateAddList().

Referenced by GetFileList().

212  {
213  mAddList.clear();
214  UpdateAddList(refdb);
215  std::vector<AddList>::iterator it_add = mAddList.begin();
216  for(;it_add <mAddList.end(); ++it_add)
217  {
218  if(it_add->nbFiles == "0")
219  {
220  RemoveEntry("ADD_OPS", it_add->key);
221  RemoveEntry("IGNORED_FILES", it_add->key);
222 
223  }
224  }
225  mAddList.clear();
226  UpdateAddList(refdb);
227  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::CleanName ( std::string &  str) const
private

Cleans the name (changes slashes and backslashes according to the system)

Definition at line 135 of file creaImageIOSynchron.cpp.

Referenced by GetAttribute(), InsertAddOp(), InsertIgnoreFile(), and SetAttribute().

136  {
137  size_t pos;
138  do
139  {
140  pos = str.find('\\');
141  if (pos!=-1)
142  {
143  str.replace(pos, 1, "/");
144  }
145  }
146  while (pos!=-1);
147  }

Here is the caller graph for this function:

const std::string creaImageIO::Synchronizer::convert ( const std::string &  i_word)
private

Definition at line 476 of file creaImageIOSynchron.cpp.

Referenced by GetAttribute(), InsertAddOp(), InsertIgnoreFile(), and SetAttribute().

477  {
478  std::string temp = i_word;
479  boost::algorithm::replace_all(temp,"'","''");
480 
481  return temp.c_str();
482  }

Here is the caller graph for this function:

void creaImageIO::Synchronizer::CreateDB ( )
private

Creates a new database.

Definition at line 108 of file creaImageIOSynchron.cpp.

References mDB, CppSQLite3DB::open(), pathDB, and UPDATESYNCDB.

Referenced by Initialize().

109  {
110  mDB->open(pathDB.c_str());
111  // CREATING TABLES
112  std::string command;
113  command = "CREATE TABLE ";
114  command += "ADD_OPS";
115  command += "\n(\nADD_KEY INTEGER PRIMARY KEY";
116  command += ",\nPATH text";
117  command += ",\nRECURSIVE boolean";
118  command += ",\nFILES_ADDED int";
119  command += ",\nREFERENCEDDB text";
120  command += "\n)";
121  UPDATESYNCDB(command);
122 
123  command = "CREATE TABLE ";
124  command += "IGNORED_FILES";
125  command += "\n(\nID INTEGER PRIMARY KEY";
126  command += ",\nADD_KEY integer";
127  command += ",\nPATH text";
128  command += ",\nREMOVE boolean";
129  command += ",\nTIME datetext";
130  command += "\n)";
131  UPDATESYNCDB(command);
132  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool creaImageIO::Synchronizer::FileExists ( std::string  file)

Checks if the file given as a parameter exists in the drive.

Definition at line 101 of file creaImageIOSynchronizer.cpp.

References GimmickDebugMessage.

Referenced by SynchronizeFile().

102  {
103  GimmickDebugMessage(4,"Verifying if file "<<file<<" exists"<<std::endl);
104  bool exists=true;
105  if ( !fs::exists( file ) )
106  {
107  exists=false;
108  }
109  return exists;
110  }

Here is the caller graph for this function:

std::string creaImageIO::Synchronizer::GetAttribute ( const std::string &  attribute,
const std::string &  table,
const std::string &  searchParam,
const std::string &  searchValue,
const std::string &  refdb 
)

Gets the attribute that matches the parameters.

Definition at line 342 of file creaImageIOSynchron.cpp.

References CleanName(), convert(), CppSQLite3Query::eof(), CppSQLite3Query::getStringField(), CppSQLite3Query::nextRow(), and QUERYSYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory(), creaImageIO::TreeHandlerImageAdder::AddFiles(), creaImageIO::TreeHandlerImageAdder::CopyFiles(), InsertIgnoreFile(), creaImageIO::TreeHandlerImageAdder::remove(), and creaImageIO::TreeHandlerImageAdder::Synchronize().

347  {
348  std::stringstream query;
349  std::string result;
350  std::string sVal=convert(searchValue.c_str());
351  CleanName(sVal);
352  query<<"SELECT "<<attribute<<" FROM "<<table<<" WHERE "<<searchParam<<" = '"<<sVal;
353  if(table.compare("ADD_OPS")==0)
354  {
355  query<<"' AND REFERENCEDDB = '"<<refdb<<"';";
356  }
357  else
358  {
359  query<<"';";
360  }
361  CppSQLite3Query res;
362  QUERYSYNCDB(query.str(), res);
363  while (!res.eof())
364  {
365  result=res.getStringField(0);
366  res.nextRow();
367  }
368  return result;
369  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::GetFileList ( std::vector< AddList > &  files,
const std::string &  refdb 
)

Gets the list of AddFiles.

Definition at line 150 of file creaImageIOSynchron.cpp.

References CleanList(), and mAddList.

Referenced by creaImageIO::TreeHandlerImageAdder::Synchronize().

151  {
152  CleanList(refdb);
153  list=mAddList;
154  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::GetIgnoredFiles ( const std::string &  key,
std::vector< std::string > &  ignoreList 
)

Gets the list of ignored files.

Definition at line 157 of file creaImageIOSynchron.cpp.

References GetIgnoreList().

Referenced by creaImageIO::TreeHandlerImageAdder::Synchronize().

158  {
159  ignoreList=GetIgnoreList(key);
160  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > creaImageIO::Synchronizer::GetIgnoreList ( const std::string &  i_key)
private

Gets the ignore list.

Definition at line 308 of file creaImageIOSynchron.cpp.

References CppSQLite3Query::eof(), mIgnoreList, CppSQLite3Query::nextRow(), QUERYSYNCDB, and creaImageIO::RemoveList::remove.

Referenced by GetIgnoredFiles().

309  {
310  mIgnoreList.clear();
311  std::vector<std::string> i_names;
312  std::string query = "SELECT * FROM IGNORED_FILES WHERE ADD_KEY = ";
313  query+=i_key;
314  CppSQLite3Query res;
315  QUERYSYNCDB(query, res);
316  while (!res.eof())
317  {
318  RemoveList temp = RemoveList(res);
319  if(temp.remove.compare("0")==0)
320  {
321  mIgnoreList.push_back(temp);
322  }
323  res.nextRow();
324  }
325  std::vector<RemoveList>::iterator it;
326 
327  for(it = mIgnoreList.begin();it != mIgnoreList.end(); ++it)
328  {
329  i_names.push_back((*it).path);
330  }
331  return i_names;
332  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::GetList ( const std::string  i_db)

Definition at line 417 of file creaImageIOSynchron.cpp.

References CppSQLite3Query::eof(), CppSQLite3Query::getStringField(), mList, CppSQLite3Query::nextRow(), and QUERYSYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory(), and creaImageIO::TreeHandlerImageAdder::AddFiles().

418  {
419  mList.clear();
420  std::vector<std::string> i_names;
421  std::vector<std::string> keys;
422  CppSQLite3Query res;
423  std::string query ="SELECT ADD_KEY, REFERENCEDDB FROM ADD_OPS";
424  QUERYSYNCDB(query, res);
425  keys.clear();
426  while (!res.eof())
427  {
428  std::string key(res.getStringField(0));
429  std::string db(res.getStringField(1));
430  if (db == i_db)
431  {
432  keys.push_back(key);
433  }
434  res.nextRow();
435  }
436  query = "SELECT PATH, REMOVE FROM IGNORED_FILES WHERE";
437  if(keys.size() > 0)
438  {
439  for (int i=0; i < keys.size(); i++)
440  {
441  query += " ADD_KEY = " + keys[i];
442  query += " AND";
443  }
444  query = query.substr(0,query.size() - 4);
445  }
446  else
447  {
448  query += " ADD_KEY = -1";
449  }
450  QUERYSYNCDB(query, res);
451  while (!res.eof())
452  {
453  std::string file(res.getStringField(0));
454  std::string ignore(res.getStringField(1));
455  mList[file] = ignore == "0"? true : false;
456  res.nextRow();
457  }
458  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::Initialize ( )

Initializes the database.

Definition at line 82 of file creaImageIOSynchron.cpp.

References CreateDB(), CppSQLite3Exception::errorCode(), CppSQLite3Exception::errorMessage(), GimmickError, mDB, CppSQLite3DB::open(), and pathDB.

Referenced by Synchronizer().

83  {
84  if (!boost::filesystem::exists(pathDB))
85  {
86  CreateDB();
87  }
88 
89  // OPENING
90  else
91  {
92  try
93  {
94  mDB->open(pathDB.c_str());
95  }
96  catch (CppSQLite3Exception& e)
97  {
98  GimmickError("Opening '"<<pathDB<<"' : "
99  << e.errorCode() << ":"
100  << e.errorMessage());
101  }
102  }
103  // get the ADD operations List
104  //UpdateAddList(pathDB);
105  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::InsertAddOp ( const std::string &  path,
const std::string &  recursive,
const std::string &  nChildren,
const std::string &  refdb 
)

Inserts an add operation to the database.

Definition at line 237 of file creaImageIOSynchron.cpp.

References CleanName(), convert(), and UPDATESYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory(), creaImageIO::TreeHandlerImageAdder::AddFiles(), and creaImageIO::TreeHandlerImageAdder::CopyFiles().

238  {
239  std::string insert;
240  std::string pat=path.c_str();
241  CleanName(pat);
242  insert="INSERT INTO ADD_OPS (PATH,RECURSIVE,FILES_ADDED,REFERENCEDDB) VALUES('";
243  insert+=convert(pat)+"','";
244  insert+=recursive+"',";
245  insert+=nChildren+",'";
246  insert+=refdb+"');";
247  UPDATESYNCDB(insert);
248  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::InsertIgnoreFile ( const std::string &  addKey,
const std::string &  path,
const std::string &  remove,
const std::string &  time,
const std::string &  refdb 
)

Inserts a file to be ignored.

Definition at line 259 of file creaImageIOSynchron.cpp.

References CleanName(), convert(), GetAttribute(), SetAttribute(), and UPDATESYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectoryRecursor(), creaImageIO::TreeHandlerImageAdder::AddFiles(), creaImageIO::TreeHandlerImageAdder::CopyFiles(), and creaImageIO::TreeHandlerImageAdder::Synchronize().

260  {
261  std::string pat=path.c_str();
262  CleanName(pat);
263  std::string id=GetAttribute("ID","IGNORED_FILES","PATH",pat,refdb);
264  if(id.compare("")==0)
265  {
266  std::string insert;
267  insert="INSERT INTO IGNORED_FILES (ADD_KEY,PATH,REMOVE,TIME) VALUES('";
268  insert+=addKey+"','";
269  insert+=convert(pat)+"','";
270  insert+=remove+"',";
271  insert+=time+");";
272  UPDATESYNCDB(insert);
273  }
274  else
275  {
276  //Gets the add key
277  std::string ak=GetAttribute("ADD_KEY","IGNORED_FILES","ID",id,refdb);
278  //gets the parent database to check if the file has been added to the current database
279  std::string parentDB=GetAttribute("*","ADD_OPS","ADD_KEY",ak,refdb);
280  //If there is no such entry, add it
281  if(parentDB.compare("")==0)
282  {
283  std::string insert;
284  insert="INSERT INTO IGNORED_FILES (ADD_KEY,PATH,REMOVE,TIME) VALUES('";
285  insert+=addKey+"','";
286  insert+=convert(pat)+"','";
287  insert+=remove+"',";
288  insert+=time+");";
289  UPDATESYNCDB(insert);
290  }
291  else
292  {
293  //Sets the new add key attribute for the file
294  SetAttribute("ADD_KEY","IGNORED_FILES",addKey,"ID", id,refdb);
295  //Sets the new remove attribute for the file
296  SetAttribute("REMOVE","IGNORED_FILES",remove,"ID", id,refdb);
297  //Sets the new time attribute for the file
298  SetAttribute("TIME","IGNORED_FILES",time,"ID", id,refdb);
299  }
300  }
301  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool creaImageIO::Synchronizer::isIndexed ( const std::string  filename)

Definition at line 460 of file creaImageIOSynchron.cpp.

References mList.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectoryRecursor(), and creaImageIO::TreeHandlerImageAdder::AddFiles().

461  {
462  bool valid = true;
463  std::string name(filename);
464  boost::algorithm::replace_all( name,"\\" , "/");
465  std::map <std::string, bool>::iterator it_list = mList.begin();
466  for(;it_list != mList.end(); it_list++)
467  {
468  if(it_list->first == name)
469  {
470  valid = false;
471  break;
472  }
473  }
474  return valid;
475  }

Here is the caller graph for this function:

void creaImageIO::Synchronizer::RemoveEntries ( const std::string  i_table,
const std::string  i_attribute,
const std::string  i_operand,
const std::string  i_key 
)

Removes several entries.

Definition at line 196 of file creaImageIOSynchron.cpp.

References UPDATESYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::DeleteDriveFromOtherDB().

200  {
201  std::stringstream query;
202  query<<"DELETE FROM "<<i_table<<" WHERE "<<i_attribute<<" "<<i_operand<<" '"<<i_val<<"'";
203  UPDATESYNCDB(query.str());
204  }

Here is the caller graph for this function:

void creaImageIO::Synchronizer::RemoveEntry ( const std::string  i_table,
const std::string  i_key 
)

Removes an entry that matches the given parameter.

Definition at line 182 of file creaImageIOSynchron.cpp.

References UPDATESYNCDB.

Referenced by CleanList().

183  {
184  std::string query = "DELETE FROM " + i_table + " WHERE ADD_KEY = '" + i_key +"'";
185  UPDATESYNCDB(query);
186  }

Here is the caller graph for this function:

void creaImageIO::Synchronizer::SetAttribute ( const std::string &  attribute,
const std::string &  table,
const std::string &  value,
const std::string &  searchParam,
const std::string &  searchValue,
const std::string &  refdb 
)

Sets an attribute to an entry that matches the given parameters.

Definition at line 380 of file creaImageIOSynchron.cpp.

References CleanName(), convert(), and UPDATESYNCDB.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory(), creaImageIO::TreeHandlerImageAdder::CopyFiles(), InsertIgnoreFile(), creaImageIO::TreeHandlerImageAdder::remove(), and creaImageIO::TreeHandlerImageAdder::Synchronize().

386  {
387  std::string val=value.c_str();
388  std::string sVal=convert(searchValue.c_str());
389  CleanName(val);
390  CleanName(sVal);
391  std::string sql = "UPDATE ";
392  sql+=table;
393  sql+=" SET ";
394  sql += attribute;
395  sql += " = '";
396  sql += val;
397  sql += "' WHERE ";
398  sql += searchParam;
399  sql += " = '";
400  sql += sVal;
401  if(table.compare("ADD_OPS")==0)
402  {
403  sql += "' AND REFERENCEDDB = '";
404  sql += refdb;
405  }
406  sql += "';";
407  UPDATESYNCDB(sql);
408  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::SetTreeHandler ( TreeHandler handler)
inline

Sets the tree handler to use in order to synchronize with a given database.

Definition at line 48 of file creaImageIOSynchronizer.h.

References mHandler.

48 {mHandler=handler;}
std::string creaImageIO::Synchronizer::Synchronize ( bool  update)

Synchronizes the database in the current tree handler with disk by doing the passed action. If it is true, the database will be updated, otherwise a warning message will be returned.

Definition at line 54 of file creaImageIOSynchronizer.cpp.

References creaImageIO::TreeHandler::GetAttribute(), GimmickMessage, mHandler, and SynchronizeFile().

55  {
56  GimmickMessage(1,"Synchronizing "<<std::endl);
57  int id=1;
58  std::stringstream mess;
59  std::string file;
60  mHandler->GetAttribute("Image","","","FullFileName",file);
61  size_t ini=0;
62  size_t fin=0;
63  while(fin<file.size()-1)
64  {
65  fin=file.find('#',ini);
66  SynchronizeFile(update,file.substr(ini,fin-ini),mess);
67  ini=fin+1;
68  }
69  if(mess.str()=="")
70  {
71  mess<<"Database up to date"<<std::endl;
72  }
73  GimmickMessage(1,mess.str());
74  return mess.str();
75  }

Here is the call graph for this function:

void creaImageIO::Synchronizer::SynchronizeFile ( bool  update,
std::string  file,
std::stringstream &  message 
)
private

Synchronizes the given file, doing the action required and returning the result on the string supplied.

Definition at line 79 of file creaImageIOSynchronizer.cpp.

References AttributesMatch(), creaImageIO::TreeHandler::DeleteTuple(), FileExists(), and mHandler.

Referenced by Synchronize().

80  {
81  if(!FileExists(file))
82  {
83  if(update)
84  {
85  mHandler->DeleteTuple("Image","FullFileName",file);
86  mess<<file<<" has been removed from the DB"<<std::endl;
87  }
88  else
89  {
90  mess<<file<<" State: Non existant"<<std::endl;
91  }
92  }
93  else
94  {
95  AttributesMatch(update,file,mess);
96  }
97  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::Synchronizer::UpdateAddList ( const std::string &  refdb)
private

Updates the AddList.

Definition at line 163 of file creaImageIOSynchron.cpp.

References CppSQLite3Query::eof(), mAddList, CppSQLite3Query::nextRow(), and QUERYSYNCDB.

Referenced by CleanList().

164  {
165  std::string query = "SELECT * FROM ADD_OPS WHERE REFERENCEDDB = '"+refdb+"';";
166  CppSQLite3Query res;
167  QUERYSYNCDB(query, res);
168  while (!res.eof())
169  {
170  AddList temp = AddList(res);
171  mAddList.push_back(temp);
172  res.nextRow();
173  }
174  }

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<AddList> creaImageIO::Synchronizer::mAddList

The current AddList.

Definition at line 140 of file creaImageIOSynchron.h.

Referenced by CleanList(), GetFileList(), and UpdateAddList().

CppSQLite3DB* creaImageIO::Synchronizer::mDB
private

The DB.

Definition at line 146 of file creaImageIOSynchron.h.

Referenced by CreateDB(), Initialize(), Synchronizer(), and ~Synchronizer().

TreeHandler* creaImageIO::Synchronizer::mHandler
private

The tree handler.

Definition at line 61 of file creaImageIOSynchronizer.h.

Referenced by AttributesMatch(), SetTreeHandler(), Synchronize(), and SynchronizeFile().

std::vector<RemoveList> creaImageIO::Synchronizer::mIgnoreList

The current RemoveList.

Definition at line 142 of file creaImageIOSynchron.h.

Referenced by GetIgnoreList().

std::map<std::string, bool> creaImageIO::Synchronizer::mList

Definition at line 138 of file creaImageIOSynchron.h.

Referenced by GetList(), and isIndexed().

ImageReader creaImageIO::Synchronizer::mReader
private

The image reader.

Definition at line 63 of file creaImageIOSynchronizer.h.

Referenced by AttributesMatch().

std::string creaImageIO::Synchronizer::pathDB
private

Path of the current database.

Definition at line 148 of file creaImageIOSynchron.h.

Referenced by CreateDB(), Initialize(), and Synchronizer().


The documentation for this class was generated from the following files: