00001 00010 #include "PKIFLocalCertNode.h" 00011 00012 #include "Certificate.h" 00013 #include "GottaMatch.h" 00014 #include "LDAP_URL_Header.h" 00015 #include "Name.h" 00016 #include "PKIFLDAPRepository.h" 00017 00018 #include <iterator> 00019 00020 using namespace std; 00021 00023 struct CPKIFLocalCertNodeImpl 00024 { 00025 CPKIFCertificateNodeList m_certs; 00026 PathBuildingDirection m_pbd; 00027 }; 00029 00036 CPKIFLocalCertNode::CPKIFLocalCertNode( 00038 PathBuildingDirection pbd) 00039 : m_impl(new CPKIFLocalCertNodeImpl) 00040 { 00041 m_impl->m_pbd = pbd; 00042 } 00050 CPKIFLocalCertNode::~CPKIFLocalCertNode() 00051 { 00052 if(m_impl) delete m_impl; 00053 } 00061 void CPKIFLocalCertNode::GetCertificates( 00063 CPKIFCertificateNodeList& certNodeList, 00065 PathBuildingDirection pbd) 00066 { 00067 if(m_impl->m_pbd == pbd) 00068 copy(m_impl->m_certs.begin(), m_impl->m_certs.end(), back_inserter(certNodeList)); 00069 } 00077 void CPKIFLocalCertNode::AddCertificate( 00079 CPKIFCertificateNodeEntryPtr& cert) 00080 { 00081 GottaMatch<CPKIFCertificateNodeEntryPtr> gm; 00082 gm.SetRHS(cert); 00083 if(m_impl->m_certs.end() == find_if(m_impl->m_certs.begin(), m_impl->m_certs.end(), gm)) 00084 m_impl->m_certs.push_back(cert); 00085 }