Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 1162:1ea4094d077c db-changes
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 17 Sep 2014 13:25:37 +0200 |
parents | badc14fee61f |
children | 5b2d8c280ac2 |
comparison
equal
deleted
inserted
replaced
1161:82cbf1480aac | 1162:1ea4094d077c |
---|---|
1630 //LOG(INFO) << "Unstable resource: " << EnumerationToString(type) << " " << id; | 1630 //LOG(INFO) << "Unstable resource: " << EnumerationToString(type) << " " << id; |
1631 } | 1631 } |
1632 | 1632 |
1633 | 1633 |
1634 | 1634 |
1635 void ServerIndex::LookupTagValue(std::list<std::string>& result, | 1635 void ServerIndex::LookupIdentifier(std::list<std::string>& result, |
1636 DicomTag tag, | 1636 const DicomTag& tag, |
1637 const std::string& value, | 1637 const std::string& value, |
1638 ResourceType type) | 1638 ResourceType type) |
1639 { | 1639 { |
1640 result.clear(); | 1640 result.clear(); |
1641 | 1641 |
1642 boost::mutex::scoped_lock lock(mutex_); | 1642 boost::mutex::scoped_lock lock(mutex_); |
1643 | 1643 |
1644 std::list<int64_t> id; | 1644 std::list<int64_t> id; |
1645 db_->LookupTagValue(id, tag, value); | 1645 db_->LookupIdentifier(id, tag, value); |
1646 | 1646 |
1647 for (std::list<int64_t>::const_iterator | 1647 for (std::list<int64_t>::const_iterator |
1648 it = id.begin(); it != id.end(); ++it) | 1648 it = id.begin(); it != id.end(); ++it) |
1649 { | 1649 { |
1650 if (db_->GetResourceType(*it) == type) | 1650 if (db_->GetResourceType(*it) == type) |
1653 } | 1653 } |
1654 } | 1654 } |
1655 } | 1655 } |
1656 | 1656 |
1657 | 1657 |
1658 void ServerIndex::LookupTagValue(std::list<std::string>& result, | 1658 void ServerIndex::LookupIdentifier(std::list<std::string>& result, |
1659 DicomTag tag, | 1659 const DicomTag& tag, |
1660 const std::string& value) | 1660 const std::string& value) |
1661 { | 1661 { |
1662 result.clear(); | 1662 result.clear(); |
1663 | 1663 |
1664 boost::mutex::scoped_lock lock(mutex_); | 1664 boost::mutex::scoped_lock lock(mutex_); |
1665 | 1665 |
1666 std::list<int64_t> id; | 1666 std::list<int64_t> id; |
1667 db_->LookupTagValue(id, tag, value); | 1667 db_->LookupIdentifier(id, tag, value); |
1668 | 1668 |
1669 for (std::list<int64_t>::const_iterator | 1669 for (std::list<int64_t>::const_iterator |
1670 it = id.begin(); it != id.end(); ++it) | 1670 it = id.begin(); it != id.end(); ++it) |
1671 { | 1671 { |
1672 result.push_back(db_->GetPublicId(*it)); | 1672 result.push_back(db_->GetPublicId(*it)); |
1673 } | 1673 } |
1674 } | 1674 } |
1675 | 1675 |
1676 | 1676 |
1677 void ServerIndex::LookupTagValue(std::list< std::pair<ResourceType, std::string> >& result, | 1677 void ServerIndex::LookupIdentifier(std::list< std::pair<ResourceType, std::string> >& result, |
1678 const std::string& value) | 1678 const std::string& value) |
1679 { | 1679 { |
1680 result.clear(); | 1680 result.clear(); |
1681 | 1681 |
1682 boost::mutex::scoped_lock lock(mutex_); | 1682 boost::mutex::scoped_lock lock(mutex_); |
1683 | 1683 |
1684 std::list<int64_t> id; | 1684 std::list<int64_t> id; |
1685 db_->LookupTagValue(id, value); | 1685 db_->LookupIdentifier(id, value); |
1686 | 1686 |
1687 for (std::list<int64_t>::const_iterator | 1687 for (std::list<int64_t>::const_iterator |
1688 it = id.begin(); it != id.end(); ++it) | 1688 it = id.begin(); it != id.end(); ++it) |
1689 { | 1689 { |
1690 result.push_back(std::make_pair(db_->GetResourceType(*it), | 1690 result.push_back(std::make_pair(db_->GetResourceType(*it), |