file_grabber.h
Go to the documentation of this file.
00001 
00002 /*
00003  * Software License Agreement (BSD License)
00004  *
00005  *  Point Cloud Library (PCL) - www.pointclouds.org
00006  *  Copyright (c) 2010-2011, Willow Garage, Inc.
00007  *  Copyright (c) 2012-, Open Perception, Inc.
00008  *
00009  *  All rights reserved.
00010  *
00011  *  Redistribution and use in source and binary forms, with or without
00012  *  modification, are permitted provided that the following conditions
00013  *  are met:
00014  *
00015  *   * Redistributions of source code must retain the above copyright
00016  *     notice, this list of conditions and the following disclaimer.
00017  *   * Redistributions in binary form must reproduce the above
00018  *     copyright notice, this list of conditions and the following
00019  *     disclaimer in the documentation and/or other materials provided
00020  *     with the distribution.
00021  *   * Neither the name of the copyright holder(s) nor the names of its
00022  *     contributors may be used to endorse or promote products derived
00023  *     from this software without specific prior written permission.
00024  *
00025  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00026  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00027  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00028  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00029  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00030  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00031  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00032  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00033  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00034  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00035  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00036  *  POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  * $Id: file_grabber.h 8413 2013-01-15 08:37:39Z sdmiller $
00039  *
00040  */
00041 
00042 #pragma once
00043 #ifndef PCL_IO_FILE_GRABBER_H_
00044 #define PCL_IO_FILE_GRABBER_H_
00045 
00046 #include <pcl/point_cloud.h>
00047 
00048 namespace pcl
00049 {
00054   template <typename PointT>
00055   class PCL_EXPORTS FileGrabber
00056   {
00057   public:
00058 
00060     virtual ~FileGrabber () {}
00061 
00066     virtual const boost::shared_ptr< const pcl::PointCloud<PointT> >
00067     operator[] (size_t idx) const = 0;
00068 
00070     virtual size_t
00071     size () const = 0;
00072     
00076     virtual const boost::shared_ptr< const pcl::PointCloud<PointT> >
00077     at (size_t idx) const
00078     {
00079       if (idx >= size ())
00080       {
00081         // Throw error 
00082         throw pcl::IOException ("[pcl::FileGrabber] Attempted to access element which is out of bounds!");
00083       }
00084       else
00085       {
00086         return (operator[] (idx));
00087       }
00088     }
00089   };
00090 }
00091 #endif//PCL_IO_FILE_GRABBER_H_
00092 


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