IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
DynamicCopyUtils.h
Go to the documentation of this file.
1 // DynamicCopyUtils.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_DYNAMICCOPYUTILS_H__
16 #define __IPSDKUTIL_DYNAMICCOPYUTILS_H__
17 
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/shared_ptr.hpp>
21 
22 namespace ipsdk {
23 
26 
31 template <typename T>
32 void
33 copyDynamicObjectPtr(const boost::scoped_ptr<T>& pInput,
34  boost::scoped_ptr<T>& pOutput)
35 {
36  pOutput.reset();
37  if (pInput.get() != 0)
38  pOutput.reset(static_cast<T*>(pInput->duplicate()));
39 }
40 
45 template <typename T>
46 void
47 copyDynamicObjectPtr(const boost::shared_ptr<T>& pInput,
48  boost::shared_ptr<T>& pOutput)
49 {
50  pOutput.reset();
51  if (pInput.get() != 0)
52  pOutput.reset(static_cast<T*>(pInput->duplicate()));
53 }
54 
57 
58 } // end of namespace ipsdk
59 
60 #endif // __IPSDKUTIL_DYNAMICCOPYUTILS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition of import/export macro for library.
void copyDynamicObjectPtr(const boost::scoped_ptr< T > &pInput, boost::scoped_ptr< T > &pOutput)
copy of scoped pointer to BaseDynamicObject derived type
Definition: DynamicCopyUtils.h:33