1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # if defined DF_EXPORTS
25 # define DF_EXPORT __declspec( dllexport )
27 # define DF_EXPORT __declspec( dllimport )
35 #include <boost/shared_ptr.hpp>
37 template<class T> class df_shared_ptr: public boost::shared_ptr<T>
43 explicit df_shared_ptr(Y * p)
45 boost::shared_ptr<T>::reset(p);
49 df_shared_ptr(df_shared_ptr<Y> const & r):
50 boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
54 df_shared_ptr & operator=(df_shared_ptr<Y> const & r)
56 df_shared_ptr<T>(r).swap(*this);
60 template<class Y> df_shared_ptr& operator()(Y * p) // Y must be complete
62 if(T* pt = dynamic_cast<T*>(p))
63 boost::shared_ptr<T>::reset(pt);
65 boost::throw_exception(std::bad_cast());
71 # if defined(WIN32) && !defined(HAVE_NO_DLL)
73 # ifndef Standard_EXPORT
74 # define Standard_EXPORT __declspec( dllexport )
75 // For global variables :
76 # define Standard_EXPORTEXTERN __declspec( dllexport ) extern
77 # define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
78 # endif /* Standard_EXPORT */
80 # ifndef Standard_IMPORT
81 # define Standard_IMPORT __declspec( dllimport ) extern
82 # define Standard_IMPORTC extern "C" __declspec( dllimport )
83 # endif /* Standard_IMPORT */
87 # ifndef Standard_EXPORT
88 # define Standard_EXPORT
89 // For global variables :
90 # define Standard_EXPORTEXTERN extern
91 # define Standard_EXPORTEXTERNC extern "C"
92 # endif /* Standard_EXPORT */
94 # ifndef Standard_IMPORT
95 # define Standard_IMPORT extern
96 # define Standard_IMPORTC extern "C"
97 # endif /* Standard_IMPORT */
101 # ifndef __Standard_API
104 # define __Standard_API Standard_EXPORT
105 # define __Standard_APIEXTERN Standard_EXPORTEXTERN
107 # define __Standard_API Standard_IMPORT
108 # define __Standard_APIEXTERN Standard_IMPORT
109 # endif // __Standard_DLL
111 //# define __Standard_API
113 # endif // __Standard_API
116 class Standard_EXPORT DFexception
119 DFexception(const char *message) {
120 std::cerr << message << std::endl;