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

void Impala::Persistency::SvmRepositoryInFile::Add ( const ModelLocator loc,
Svm svm 
) [inline]

Definition at line 68 of file SvmRepositoryInFile.h.

References Impala::Persistency::File::CopyFrom(), Impala::Persistency::File::Delete(), Impala::FileNameTmp(), Impala::Persistency::ModelLocator::GetConcept(), GetDir(), Impala::Persistency::RepositoryInFileSystem::GetFile(), Impala::Core::Training::Svm::GetModel(), Impala::Persistency::File::GetPath(), Impala::Persistency::Locator::GetProtocol(), ILOG_ERROR, RepFS(), and Impala::Persistency::File::Valid().

00069     {
00070         String dir = GetDir(loc, false);
00071         File file = RepFS().GetFile(loc, dir, loc.GetConcept() + ".model",
00072                                     true, false);
00073         if (!file.Valid())
00074             return;
00075 
00076         if (loc.GetProtocol() == "file")
00077         {
00078             String path = file.GetPath();
00079             if (svm_save_model(path.c_str(), svm->GetModel()) == -1)
00080                 ILOG_ERROR("[Add] Unable to save " << loc);
00081         }
00082         else
00083         {
00084             FileLocator tmpLoc("file", "direct", FileNameTmp());
00085             File tmpFile = RepFS().GetFile(tmpLoc, true, false);
00086             String path = tmpFile.GetPath();
00087             if (svm_save_model(path.c_str(), svm->GetModel()) == -1)
00088                 ILOG_ERROR("[Add] Unable to save " << loc);
00089             file.CopyFrom(tmpFile);
00090             tmpFile.Delete();
00091         }
00092     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:23:50 2011 for ImpalaSrc by  doxygen 1.5.1