comparison OrthancServer/DatabaseWrapper.cpp @ 1300:919dfb2fb3fe

DANGEROUS refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Feb 2015 15:30:46 +0100
parents 4ce47e8ed0d2
children 5d56cfa49f68
comparison
equal deleted inserted replaced
1299:4ce47e8ed0d2 1300:919dfb2fb3fe
571 571
572 572
573 void DatabaseWrapper::LogChange(int64_t internalId, 573 void DatabaseWrapper::LogChange(int64_t internalId,
574 const ServerIndexChange& change) 574 const ServerIndexChange& change)
575 { 575 {
576 if (change.GetChangeType() <= ChangeType_INTERNAL_LastLogged) 576 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO Changes VALUES(NULL, ?, ?, ?, ?)");
577 { 577 s.BindInt(0, change.GetChangeType());
578 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO Changes VALUES(NULL, ?, ?, ?, ?)"); 578 s.BindInt64(1, internalId);
579 s.BindInt(0, change.GetChangeType()); 579 s.BindInt(2, change.GetResourceType());
580 s.BindInt64(1, internalId); 580 s.BindString(3, change.GetDate());
581 s.BindInt(2, change.GetResourceType()); 581 s.Run();
582 s.BindString(3, change.GetDate());
583 s.Run();
584 }
585
586 assert(listener_ != NULL);
587 listener_->SignalChange(change);
588 } 582 }
589 583
590 584
591 void DatabaseWrapper::GetChangesInternal(std::list<ServerIndexChange>& target, 585 void DatabaseWrapper::GetChangesInternal(std::list<ServerIndexChange>& target,
592 bool& done, 586 bool& done,