1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 # if defined DF_EXPORTS
27 # define DF_EXPORT __declspec( dllexport )
29 # define DF_EXPORT __declspec( dllimport )
37 #include <boost/shared_ptr.hpp>
39 template<class T> class df_shared_ptr: public boost::shared_ptr<T>
45 explicit df_shared_ptr(Y * p)
47 boost::shared_ptr<T>::reset(p);
51 df_shared_ptr(df_shared_ptr<Y> const & r):
52 boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
56 df_shared_ptr & operator=(df_shared_ptr<Y> const & r)
58 df_shared_ptr<T>(r).swap(*this);
62 template<class Y> df_shared_ptr& operator()(Y * p) // Y must be complete
64 if(T* pt = dynamic_cast<T*>(p))
65 boost::shared_ptr<T>::reset(pt);
67 boost::throw_exception(std::bad_cast());
73 # if defined(WIN32) && !defined(HAVE_NO_DLL)
75 # ifndef Standard_EXPORT
76 # define Standard_EXPORT __declspec( dllexport )
77 // For global variables :
78 # define Standard_EXPORTEXTERN __declspec( dllexport ) extern
79 # define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
80 # endif /* Standard_EXPORT */
82 # ifndef Standard_IMPORT
83 # define Standard_IMPORT __declspec( dllimport ) extern
84 # define Standard_IMPORTC extern "C" __declspec( dllimport )
85 # endif /* Standard_IMPORT */
89 # ifndef Standard_EXPORT
90 # define Standard_EXPORT
91 // For global variables :
92 # define Standard_EXPORTEXTERN extern
93 # define Standard_EXPORTEXTERNC extern "C"
94 # endif /* Standard_EXPORT */
96 # ifndef Standard_IMPORT
97 # define Standard_IMPORT extern
98 # define Standard_IMPORTC extern "C"
99 # endif /* Standard_IMPORT */
103 # ifndef __Standard_API
106 # define __Standard_API Standard_EXPORT
107 # define __Standard_APIEXTERN Standard_EXPORTEXTERN
109 # define __Standard_API Standard_IMPORT
110 # define __Standard_APIEXTERN Standard_IMPORT
111 # endif // __Standard_DLL
113 //# define __Standard_API
115 # endif // __Standard_API
118 class Standard_EXPORT DFexception
121 DFexception(const char *message) {
122 std::cerr << message << std::endl;