ConnCopyPolicy.h

Go to the documentation of this file.
00001 // ConnCopyPolicy.h: Copy-policy class for converting from connection
00002 // data structure to PIDL
00003 //
00005 
00006 #ifndef CONNCOPYPOLICY_H
00007 #define CONNCOPYPOLICY_H
00008 
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012 
00013 #include "HostPidlManager.h"
00014 
00015 class CConnCopyPolicy  
00016 {
00017 public:
00018         static void init( LPITEMIDLIST* ) { /* No init needed */ }
00019     
00020     static HRESULT copy( LPITEMIDLIST* pTo, const HOSTPIDL *pFrom )
00021     {
00022                 ATLASSERT(SUCCEEDED(m_PidlManager.IsValid((LPITEMIDLIST)pFrom)));
00023                 return m_PidlManager.Create( pFrom->wszLabel, pFrom->wszUser, 
00024                         pFrom->wszHost, pFrom->wszPath, pFrom->uPort, pTo );
00025     }
00026 
00027     static void destroy( LPITEMIDLIST* p ) 
00028     {
00029         m_PidlManager.Delete( *p ); 
00030     }
00031 
00032 private:
00033     static CHostPidlManager m_PidlManager;
00034 };
00035 
00036 typedef CComEnumOnSTL<IEnumIDList, &IID_IEnumIDList, LPITEMIDLIST,
00037                       CConnCopyPolicy, std::vector<HOSTPIDL> >
00038                 CEnumIDListImpl;
00039 
00040 #endif // CONNCOPYPOLICY_H

Generated on Mon Nov 12 22:43:52 2007 for Swish by  doxygen 1.5.3