From 49e16c539fc7c1e50b358e323ca9421a3ff4a6c8 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Thu, 15 Dec 2011 09:44:09 +0000 Subject: [PATCH] Header and boost fixes for Debian --- saml/binding/ArtifactMap.h | 1 + saml/binding/SecurityPolicy.h | 1 + saml/profile/impl/IgnoreRule.cpp | 1 + .../metadata/impl/AbstractMetadataProvider.cpp | 21 +++++++-------------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/saml/binding/ArtifactMap.h b/saml/binding/ArtifactMap.h index 36bdc23..6c7465c 100644 --- a/saml/binding/ArtifactMap.h +++ b/saml/binding/ArtifactMap.h @@ -30,6 +30,7 @@ #include #include +#include #include namespace xmltooling { diff --git a/saml/binding/SecurityPolicy.h b/saml/binding/SecurityPolicy.h index 72e0233..5d0ba22 100644 --- a/saml/binding/SecurityPolicy.h +++ b/saml/binding/SecurityPolicy.h @@ -31,6 +31,7 @@ #include #include +#include #include #if defined (_MSC_VER) diff --git a/saml/profile/impl/IgnoreRule.cpp b/saml/profile/impl/IgnoreRule.cpp index a9673db..68a736e 100644 --- a/saml/profile/impl/IgnoreRule.cpp +++ b/saml/profile/impl/IgnoreRule.cpp @@ -28,6 +28,7 @@ #include "exceptions.h" #include "binding/SecurityPolicyRule.h" +#include #include #include #include diff --git a/saml/saml2/metadata/impl/AbstractMetadataProvider.cpp b/saml/saml2/metadata/impl/AbstractMetadataProvider.cpp index 40180f4..6cd7273 100644 --- a/saml/saml2/metadata/impl/AbstractMetadataProvider.cpp +++ b/saml/saml2/metadata/impl/AbstractMetadataProvider.cpp @@ -319,13 +319,10 @@ const Credential* AbstractMetadataProvider::resolve(const CredentialCriteria* cr Lock lock(m_credentialLock.get()); const credmap_t::mapped_type& creds = resolveCredentials(metacrit->getRole()); - // Indirect iterator derefs the pointers in the vector to pass to the matches() method by reference. - credmap_t::mapped_type::const_iterator c = find_if( - creds.begin(), creds.end(), lambda::bind(&CredentialCriteria::matches, metacrit, boost::ref(*_1)) - ); - if (c != creds.end()) - return *c; - return nullptr; + for (credmap_t::mapped_type::const_iterator c = creds.begin(); c!=creds.end(); ++c) + if (metacrit->matches(*(*c))) + return *c; +return nullptr; } vector::size_type AbstractMetadataProvider::resolve( @@ -339,13 +336,9 @@ vector::size_type AbstractMetadataProvider::resolve( Lock lock(m_credentialLock.get()); const credmap_t::mapped_type& creds = resolveCredentials(metacrit->getRole()); - // Add matching creds to results array. - static void (vector::* push_back)(const Credential* const &) = &vector::push_back; - for_each( - creds.begin(), creds.end(), - if_(lambda::bind(&CredentialCriteria::matches, metacrit, boost::ref(*_1)))[lambda::bind(push_back, boost::ref(results), _1)] - ); - + for (credmap_t::mapped_type::const_iterator c = creds.begin(); c!=creds.end(); ++c) + if (metacrit->matches(*(*c))) + results.push_back(*c); return results.size(); } -- 2.1.4