00001 00009 #include "CIssuerDomainMappingList.h" 00010 #include "PolicyMapping.h" 00011 #include "PolicyInformation.h" 00012 #include "OID.h" 00013 00014 #include "BasicChecksUtils.h" 00015 00016 //#ifdef _DEBUG_PATH_POL 00017 #include <iostream> 00025 CIssuerDomainMappingList::~CIssuerDomainMappingList() 00026 { 00027 struct IssuerDomainMappingList* cur = m_list, *next = NULL; 00028 while(NULL != cur) 00029 { 00030 next = cur->m_next; 00031 delete cur; 00032 cur = next; 00033 } 00034 } 00035 00036 //changed to & - 7/28/2004 00044 void CIssuerDomainMappingList::AddMapping( 00046 CPKIFPolicyMappingPtr& mapping) 00047 { 00048 struct IssuerDomainMappingList* cur = m_list; 00049 while(NULL != cur) 00050 { 00051 if(*cur->m_issuerDomain->PolicyOID() == *mapping->IssuerDomain()) 00052 { 00053 CPKIFPolicyInformationPtr tmp(new CPKIFPolicyInformation(mapping->SubjectDomain())); 00054 cur->m_subjectDomains.push_back(tmp); 00055 return; 00056 } 00057 cur = cur->m_next; 00058 } 00059 00060 cur = new IssuerDomainMappingList; 00061 CPKIFPolicyInformationPtr tmp2(new CPKIFPolicyInformation(mapping->IssuerDomain())); 00062 cur->m_issuerDomain = tmp2; 00063 00064 CPKIFPolicyInformationPtr tmp(new CPKIFPolicyInformation(mapping->SubjectDomain())); 00065 cur->m_subjectDomains.push_back(tmp); 00066 00067 if(NULL == m_list) 00068 m_list = cur; 00069 else 00070 { 00071 //attach to end 00072 IssuerDomainMappingList* tmpCur = m_list; 00073 while(NULL != tmpCur->m_next) 00074 tmpCur = tmpCur->m_next; 00075 00076 tmpCur->m_next = cur; 00077 } 00078 00079 } 00087 CIssuerDomainMappingList::CIssuerDomainMappingList() {m_list = NULL;} 00095 struct IssuerDomainMappingList* CIssuerDomainMappingList::GetList() {return m_list;}