instantiate.hpp
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Point Cloud Library (PCL) - www.pointclouds.org
00005  *  Copyright (c) 2010, Willow Garage, Inc.
00006  *  Copyright (c) 2012-, Open Perception, Inc.
00007  *
00008  *  All rights reserved.
00009  *
00010  *  Redistribution and use in source and binary forms, with or without
00011  *  modification, are permitted provided that the following conditions
00012  *  are met:
00013  *
00014  *   * Redistributions of source code must retain the above copyright
00015  *     notice, this list of conditions and the following disclaimer.
00016  *   * Redistributions in binary form must reproduce the above
00017  *     copyright notice, this list of conditions and the following
00018  *     disclaimer in the documentation and/or other materials provided
00019  *     with the distribution.
00020  *   * Neither the name of the copyright holder(s) nor the names of its
00021  *     contributors may be used to endorse or promote products derived
00022  *     from this software without specific prior written permission.
00023  *
00024  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00026  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00027  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00028  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00029  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00030  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00031  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00033  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00034  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035  *  POSSIBILITY OF SUCH DAMAGE.
00036  *
00037  */
00038 #ifndef PCL_IMPL_INSTANTIATE_H_
00039 #define PCL_IMPL_INSTANTIATE_H_
00040 
00041 #ifdef __GNUC__
00042 #pragma GCC system_header 
00043 #endif
00044 
00045 #include <pcl/pcl_config.h>
00046 
00047 //#define PCL_POINT_TYPES (bool)(int)(float)(double)
00048 //#define PCL_TEMPLATES (Type)(Othertype)
00049 
00050 //
00051 // PCL_INSTANTIATE: call to instantiate template TEMPLATE for all
00052 // POINT_TYPES
00053 //
00054 
00055 #ifdef PCL_NO_PRECOMPILE
00056 
00057 #define PCL_INSTANTIATE_PRODUCT_IMPL(r, product)
00058 #define PCL_INSTANTIATE_IMPL(r, TEMPLATE, POINT_TYPE) 
00059 #define PCL_INSTANTIATE(TEMPLATE, POINT_TYPES)
00060 #define PCL_INSTANTIATE_PRODUCT_IMPL(r, product)
00061 #define PCL_INSTANTIATE_PRODUCT(TEMPLATE, PRODUCT)
00062 
00063 #else
00064 
00065 #include <boost/preprocessor/seq/for_each.hpp>
00066 #include <boost/preprocessor/seq/for_each_product.hpp>
00067 #include <boost/preprocessor/seq/to_tuple.hpp>
00068 #include <boost/preprocessor/cat.hpp>
00069 #include <boost/preprocessor/expand.hpp>
00070 
00071 #define PCL_INSTANTIATE_IMPL(r, TEMPLATE, POINT_TYPE) \
00072   BOOST_PP_CAT(PCL_INSTANTIATE_, TEMPLATE)(POINT_TYPE)
00073 
00074 #define PCL_INSTANTIATE(TEMPLATE, POINT_TYPES)        \
00075   BOOST_PP_SEQ_FOR_EACH(PCL_INSTANTIATE_IMPL, TEMPLATE, POINT_TYPES)
00076 
00077 
00078 //
00079 // PCL_INSTANTIATE_PRODUCT(templatename, (seq1)(seq2)...(seqN))
00080 //
00081 // instantiate templates
00082 //
00083 // A call to PCL_INSTANTIATE_PRODUCT(T, ((a)(b)) ((d)(e)) ) results in calls
00084 //
00085 //   PCL_INSTANTIATE_T(a, d) 
00086 //   PCL_INSTANTIATE_T(a, e) 
00087 //   PCL_INSTANTIATE_T(b, d) 
00088 //   PCL_INSTANTIATE_T(b, e) 
00089 //
00090 // That is, PCL_INSTANTIATE_T is called for the cartesian product of the sequences seq1 ... seqN
00091 //
00092 // BE CAREFUL WITH YOUR PARENTHESIS!  The argument PRODUCT is a
00093 // sequence of sequences.  e.g. if it were three sequences of,
00094 // 1. letters, 2. numbers, and 3. our favorite transylvanians, it
00095 // would be
00096 //
00097 //    ((x)(y)(z))((1)(2)(3))((dracula)(radu))
00098 //
00099 #ifdef _MSC_VER
00100 #define PCL_INSTANTIATE_PRODUCT_IMPL(r, product) \
00101   BOOST_PP_CAT(PCL_INSTANTIATE_, BOOST_PP_SEQ_HEAD(product)) \
00102           BOOST_PP_EXPAND(BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product))) 
00103 #else
00104 #define PCL_INSTANTIATE_PRODUCT_IMPL(r, product) \
00105   BOOST_PP_EXPAND(BOOST_PP_CAT(PCL_INSTANTIATE_, BOOST_PP_SEQ_HEAD(product)) \
00106                   BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))
00107 #endif
00108 
00109 
00110 #define PCL_INSTANTIATE_PRODUCT(TEMPLATE, PRODUCT) \
00111   BOOST_PP_SEQ_FOR_EACH_PRODUCT(PCL_INSTANTIATE_PRODUCT_IMPL, ((TEMPLATE))PRODUCT)
00112 
00113 #endif
00114 
00115 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:25:02