GeneralNamesCompare.cpp

Go to the documentation of this file.
00001 
00009 #include "GeneralNamesCompare.h"
00010 #include "GeneralName.h"
00011 
00013 
00014 struct GeneralNamesCompareImpl
00015 {
00016     CPKIFGeneralNameList* m_names;
00017 };
00018 
00020 
00028 GeneralNamesCompare::GeneralNamesCompare()
00029   :m_impl (new GeneralNamesCompareImpl)
00030 {
00031 }
00032 
00040 GeneralNamesCompare::GeneralNamesCompare(const GeneralNamesCompare& name)
00041   :m_impl (new GeneralNamesCompareImpl)
00042 {
00043   m_impl->m_names = name.m_impl->m_names;
00044 }
00045 
00053 GeneralNamesCompare::~GeneralNamesCompare()
00054 {
00055     if(m_impl)
00056     {
00057         delete m_impl;
00058         m_impl = 0;
00059     }
00060 }
00061 
00069 bool GeneralNamesCompare::operator ()(const CPKIFGeneralNamePtr& name)
00070 {
00071     CPKIFGeneralNameList::iterator currentNode;
00072     CPKIFGeneralNameList::iterator end = m_impl->m_names->end();
00073     for(currentNode = m_impl->m_names->begin(); currentNode != end; ++currentNode)
00074     {
00075         if(*(*currentNode) == *name)
00076             return true;
00077     }
00078 
00079     //if no such entry was found return false
00080     return false;
00081 }
00089 void GeneralNamesCompare::SetGeneralNames(
00091     CPKIFGeneralNameList* names) 
00092 {
00093     m_impl->m_names = names;
00094 }

Generated on Mon Nov 15 11:15:51 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6