xmscore  1.0
boost_defines.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 // 3. Standard Library Headers
11 
12 // 4. External Library Headers
13 #include <boost/scoped_ptr.hpp>
14 #include <boost/shared_ptr.hpp>
15 
16 // 5. Shared Headers
17 
18 // 6. Non-shared Headers
19 
20 //----- Namespace declaration --------------------------------------------------
21 
22 namespace xms
23 {
24 #ifndef BSHP
25 #define BSHP boost::shared_ptr
26 #endif
27 
28 #define BSCP boost::scoped_ptr
29 
30 #define BDPC boost::dynamic_pointer_cast
31 #define BSPC boost::static_pointer_cast
32 
33 #define BWP boost::weak_ptr
34 // If we want to add stuff for scoped pointers or weak pointers or other
35 // boost things, we could add them here.
36 
40 template <typename T>
41 BSHP<T> CopyBSHP(const BSHP<T>& a_in)
42 {
43  BSHP<T> out;
44  if (a_in)
45  {
46  out.reset(new T(*a_in.get()));
47  }
48  return out;
49 }
50 
51 // Use BOOST_FOREACH as FOREACH
52 #define FOREACH BOOST_FOREACH
53 
54 } // namespace xms
BSHP< T > CopyBSHP(const BSHP< T > &a_in)
utility function
Definition: boost_defines.h:41