IMP  2.2.1
The Integrative Modeling Platform
misc_config.h
1 /*
2  * \file IMP/misc/misc_config.h
3  * \brief Provide macros to mark functions and classes as exported
4  * from a DLL/.so, and to set up namespaces
5  *
6  * When building the module, IMPMISC_EXPORTS should be defined, and when
7  * using the module externally, it should not be. Classes and functions
8  * declared in the module's headers should then be marked with
9  * IMPMISCEXPORT if they are intended to be part of the API and
10  * they are not defined entirely in a header.
11  *
12  * The Windows build environment requires applications to mark exports in
13  * this way; we use the same markings to set the visibility of ELF symbols
14  * if we have compiler support.
15  *
16  * All code in this module should live in the IMP::misc namespace.
17  * This is simply achieved by wrapping things with the
18  * IMPMISC_BEGIN_NAMESPACE and IMPMISC_END_NAMESPACE macros.
19  * There are similar macros for module code that is designed to be for
20  * internal use only.
21  *
22  * This header is auto-generated by tools/build/setup_module.py;
23  * it should not be edited manually.
24  *
25  * Copyright 2007-2014 IMP Inventors. All rights reserved.
26  *
27  */
28 
29 #ifndef IMPMISC_CONFIG_H
30 #define IMPMISC_CONFIG_H
31 
32 #include <IMP/base/base_config.h>
33 #include <string>
34 
35 #ifdef _MSC_VER
36 
37 #ifdef IMPMISC_EXPORTS
38 #define IMPMISCEXPORT __declspec(dllexport)
39 #else // EXPORTS
40 #define IMPMISCEXPORT __declspec(dllimport)
41 #endif // EXPORTS
42 
43 #else // _MSC_VER
44 
45 #ifdef GCC_VISIBILITY
46 #define IMPMISCEXPORT __attribute__((visibility("default")))
47 #else // GCC_VISIBILITY
48 #define IMPMISCEXPORT
49 #endif // GCC_VISIBILITY
50 
51 #endif // _MSC_VER
52 
53 #if defined(_MSC_VER) && !defined(SWIG)
54 #ifdef IMPMISC_EXPORTS
55 
56 #define IMPMISC_EXPORT_TEMPLATE(name) \
57  template class __declspec(dllexport) name
58 
59 #else //EXPORTS
60 
61 #define IMPMISC_EXPORT_TEMPLATE(name) \
62  template class __declspec(dllimport) name
63 
64 #endif // EXPORTS
65 
66 #else // MSC and SWIG
67 #define IMPMISC_EXPORT_TEMPLATE(name) IMP_REQUIRE_SEMICOLON_NAMESPACE
68 
69 #endif // MSC and SWIG
70 
71 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
72 
73 #define IMPMISC_BEGIN_NAMESPACE \
74  IMP_COMPILER_ENABLE_WARNINGS namespace IMP{namespace misc {
75 
76 #define IMPMISC_END_NAMESPACE } } \
77 IMP_COMPILER_DISABLE_WARNINGS
78 
79 #define IMPMISC_BEGIN_INTERNAL_NAMESPACE IMPMISC_BEGIN_NAMESPACE \
80  namespace internal {
81 
82 #define IMPMISC_END_INTERNAL_NAMESPACE } IMPMISC_END_NAMESPACE
83 
84 #else // SWIG and DOXYGEN
85 #define IMPMISC_BEGIN_NAMESPACE namespace IMP{namespace misc {
86 
87 #define IMPMISC_END_NAMESPACE } }
88 
89 #define IMPMISC_BEGIN_INTERNAL_NAMESPACE IMPMISC_BEGIN_NAMESPACE\
90  namespace internal {
91 
92 #define IMPMISC_END_INTERNAL_NAMESPACE } IMPMISC_END_NAMESPACE
93 
94 #endif // SWIG AND DOXYGEN
95 
96 #define IMP_MISC_USE_IMP_ALGEBRA
97 #define IMP_MISC_HAS_IMP_ALGEBRA 1
98 #define IMP_MISC_USE_IMP_BASE
99 #define IMP_MISC_HAS_IMP_BASE 1
100 #define IMP_MISC_USE_IMP_CGAL
101 #define IMP_MISC_HAS_IMP_CGAL 1
102 #define IMP_MISC_USE_IMP_CONTAINER
103 #define IMP_MISC_HAS_IMP_CONTAINER 1
104 #define IMP_MISC_USE_IMP_DISPLAY
105 #define IMP_MISC_HAS_IMP_DISPLAY 1
106 #define IMP_MISC_USE_IMP_KERNEL
107 #define IMP_MISC_HAS_IMP_KERNEL 1
108 #define IMP_MISC_USE_IMP_SCORE_FUNCTOR
109 #define IMP_MISC_HAS_IMP_SCORE_FUNCTOR 1
110 #define IMP_MISC_USE_BOOST_FILESYSTEM
111 #define IMP_MISC_HAS_BOOST_FILESYSTEM 1
112 #define IMP_MISC_USE_BOOST_PROGRAMOPTIONS
113 #define IMP_MISC_HAS_BOOST_PROGRAMOPTIONS 1
114 #define IMP_MISC_USE_BOOST_RANDOM
115 #define IMP_MISC_HAS_BOOST_RANDOM 1
116 #define IMP_MISC_USE_BOOST_REGEX
117 #define IMP_MISC_HAS_BOOST_REGEX 1
118 #define IMP_MISC_USE_BOOST_SYSTEM
119 #define IMP_MISC_HAS_BOOST_SYSTEM 1
120 #define IMP_MISC_USE_CGAL
121 #define IMP_MISC_HAS_CGAL 1
122 #define IMP_MISC_USE_HDF5
123 #define IMP_MISC_HAS_HDF5 1
124 
125  // functions are defined explicitly for SWIG
126  namespace IMP {
127  namespace misc {
128 /** \name Standard module methods
129  All \imp modules have a set of standard methods to help get information
130  about the module and about files associated with the module.
131  @{
132  */
133 #if !defined(SWIG)
134  IMPMISCEXPORT std::string get_module_version();
135 #endif
136 
137 #if !defined(SWIG)
138  // SWIG will whine about duplicate definitions of function
139  inline std::string get_module_name() { return "IMP::misc"; }
140 #endif
141 
142  }
143 } //namespace
144 
145 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
146 
147 #include <IMP/base/Showable.h>
148 #include <IMP/base/hash.h>
149 
150 namespace IMP { namespace misc {
151 using ::IMP::base::Showable;
152 using ::IMP::base::operator<<;
153 using ::IMP::base::hash_value;
154 } } // namespace
155 namespace IMP { namespace misc { namespace internal {
156 using ::IMP::base::Showable;
157 using ::IMP::base::operator<<;
158 using ::IMP::base::hash_value;
159 } } } // namespace
160 
161 #endif // !defined(SWIG) && !defined(IMP_DOXYGEN)
162 
163 
164 #if !defined(SWIG)
165  namespace IMP {
166  namespace misc {
167 
168  //! Return the full path to installed data
169  /** Each module has its own data directory, so be sure to use
170  the version of this function in the correct module. To read
171  the data file "data_library" that was placed in the \c data
172  directory of module "mymodule", do something like
173  \code
174  std::ifstream in(IMP::mymodule::get_data_path("data_library"));
175  \endcode
176  This will ensure that the code works when \imp is installed or
177  used via the \c setup_environment.sh script.
178  */
179  IMPMISCEXPORT std::string get_data_path(std::string file_name);
180 
181  //! Return the path to installed example data for this module
182  /** Each module has its own example directory, so be sure to use
183  the version of this function in the correct module. For example
184  to read the file \c example_protein.pdb located in the
185  \c examples directory of the IMP::atom module, do
186  \code
187  IMP::atom::read_pdb(IMP::atom::get_example_path("example_protein.pdb",
188  model));
189  \endcode
190  This will ensure that the code works when \imp is installed or
191  used via the \c setup_environment.sh script.
192  */
193  IMPMISCEXPORT std::string get_example_path(std::string file_name);
194  /** @} */
195 
196  }
197 } // namespace
198 
199 #endif // SWIG
200 
202 
203 #ifdef IMP_DOXYGEN
204 /** \namespace IMP::misc
205  \brief See [IMP.misc](\ref impmisc) for more information.
206  */
207 #endif
208 
209 #endif /* IMPMISC_CONFIG_H */
210 
211 // Here so it is always parsed
212 
213 #ifdef IMPMISC_DEPRECATED_HEADER
214 #undef IMPMISC_DEPRECATED_HEADER
215 #undef IMPMISC_DEPRECATED_VALUE_DEF
216 #undef IMPMISC_DEPRECATED_VALUE_DECL
217 #undef IMPMISC_DEPRECATED_OBJECT_DEF
218 #undef IMPMISC_DEPRECATED_OBJECT_DECL
219 #undef IMPMISC_DEPRECATED_FUNCTION_DEF
220 #undef IMPMISC_DEPRECATED_FUNCTION_DECL
221 #undef IMPMISC_DEPRECATED_METHOD_DEF
222 #undef IMPMISC_DEPRECATED_METHOD_DECL
223 #undef IMPMISC_DEPRECATED_MACRO
224 #undef IMPMISC_SHOW_WARNINGS
225 #endif
226 
227 // the central modules we can update easily, so don't warn in them
228 #if defined( IMPMISC_COMPILATION) \
229  || defined(SWIG) || defined(IMP_SWIG_WRAPPER) \
230  || defined( IMPMISC_ALL) || defined(IMP_DOXYGEN) \
231  || defined(IMPBASE_COMPILATION) || defined(IMPKERNEL_COMPILATION) \
232  || defined(IMPCORE_COMPILATION) || defined(IMPATOM_COMPILATION) \
233  || defined(IMPSTATISTICS_COMPILATION) || defined(IMPDOMINO_COMPILATION) \
234  || defined(IMPCONTAINER_COMPILATION) || defined(IMPDISPLAY_COMPILATION) \
235  || defined(IMPSCOREFUNCTOR_COMPILATION) || defined(IMPRMF_COMPILATION) \
236  || defined(IMPGSL_COMPILATION)
237 #define IMPMISC_SHOW_WARNINGS 0
238 #else
239 #define IMPMISC_SHOW_WARNINGS 1
240 #endif
241 
242 // suppress header warnings with all header, SWIG wrapper and in the module
243 #if IMPMISC_SHOW_WARNINGS
244 #define IMPMISC_DEPRECATED_HEADER(version, help_message) \
245  IMP_PRAGMA(message(__FILE__ " is deprecated: " help_message))
246 #define IMPMISC_DEPRECATED_VALUE_DECL(version) \
247  IMP_DEPRECATED_ATTRIBUTE
248 #define IMPMISC_DEPRECATED_OBJECT_DECL(version) \
249  IMP_DEPRECATED_ATTRIBUTE
250 #define IMPMISC_DEPRECATED_FUNCTION_DECL(version) \
251  IMP_DEPRECATED_ATTRIBUTE
252 #define IMPMISC_DEPRECATED_METHOD_DECL(version) \
253  IMP_DEPRECATED_ATTRIBUTE
254 
255 #else //IMPMISC_SHOW_WARNINGS
256 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
257 #define IMPMISC_DEPRECATED_HEADER(version, help_message) \
258 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
259 #define IMPMISC_DEPRECATED_VALUE_DECL(version)
260 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
261 #define IMPMISC_DEPRECATED_OBJECT_DECL(version)
262 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
263 #define IMPMISC_DEPRECATED_FUNCTION_DECL(version)
264 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
265 #define IMPMISC_DEPRECATED_METHOD_DECL(version)
266 
267 #endif // IMPMISC_SHOW_WARNINGS
268 
269 // only warn about it in the all inclusion to cut down on copies
270 #if !defined(IMP_ALL) || defined(SWIG) || defined(IMP_DOXYGEN) \
271  || defined(IMPBASE_COMPILATION) || defined(IMPKERNEL_COMPILATION) \
272  || defined(IMPCORE_COMPILATION) || defined(IMPATOM_COMPILATION) \
273  || defined(IMPSTATISTICS_COMPILATION) || defined(IMPDOMINO_COMPILATION) \
274  || defined(IMPCONTAINER_COMPILATION) || defined(IMPDISPLAY_COMPILATION) \
275  || defined(IMPSCOREFUNCTOR_COMPILATION)
276 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
277 #define IMPMISC_DEPRECATED_MACRO(version, message)
278 
279 #else
280 #define IMPMISC_DEPRECATED_MACRO(version, message) \
281  IMP_DEPRECATED_MACRO(version, message)
282 #endif
283 
284 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
285 #define IMPMISC_DEPRECATED_VALUE_DEF(version, message) \
286  IMP_DEPRECATED_VALUE_RUNTIME_WARNING(version, message)
287 
288 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
289 #define IMPMISC_DEPRECATED_OBJECT_DEF(version, message) \
290  IMP_DEPRECATED_OBJECT_RUNTIME_WARNING(version, message)
291 
292 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
293 #define IMPMISC_DEPRECATED_FUNCTION_DEF(version, message) \
294  IMP_DEPRECATED_FUNCTION_RUNTIME_WARNING(version, message)
295 
296 /** See [deprecation support](https://github.com/salilab/imp/wiki/Deprecation). */
297 #define IMPMISC_DEPRECATED_METHOD_DEF(version, message) \
298  IMP_DEPRECATED_METHOD_RUNTIME_WARNING(version, message)
299 
300 
302 
303 #if defined(IMP_EXECUTABLE) && !defined(IMP_EXECUTABLE_WARNINGS)
304 IMP_COMPILER_ENABLE_WARNINGS
305 #define IMP_EXECUTABLE_WARNINGS
306 #endif
Various compiler workarounds.
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
std::string get_data_path(std::string file_name)
Return the full path to installed data.
IO support.
IO support.