product.hh

Go to the documentation of this file.
00001 /*************************************************************************
00002 
00003 Copyright Rice University, 2004, 2005, 2006.
00004 All rights reserved.
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a
00007 copy of this software and associated documentation files (the "Software"),
00008 to deal in the Software without restriction, including without limitation
00009 the rights to use, copy, modify, merge, publish, distribute, and/or sell
00010 copies of the Software, and to permit persons to whom the Software is
00011 furnished to do so, provided that the above copyright notice(s) and this
00012 permission notice appear in all copies of the Software and that both the
00013 above copyright notice(s) and this permission notice appear in supporting
00014 documentation.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
00019 RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
00020 NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
00021 DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
00022 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
00023 ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
00024 THIS SOFTWARE.
00025 
00026 Except as contained in this notice, the name of a copyright holder shall
00027 not be used in advertising or otherwise to promote the sale, use or other
00028 dealings in this Software without prior written authorization of the
00029 copyright holder.
00030 
00031 **************************************************************************/
00032 
00033 #ifndef __RVL_PROD
00034 #define __RVL_PROD
00035 
00036 #include "utility.hh"
00037 #include "except.hh"
00038 
00039 namespace RVL {
00040 
00043   template<class T>
00044   class Product {
00045 
00046   public:
00047     
00048     Product() {}
00049     Product(const Product<T> &) {}
00050     virtual ~Product() {}
00051 
00052     virtual size_t getSize() const = 0;
00053 
00054     virtual T & operator[](size_t i) = 0;
00055     virtual T const & operator[](size_t i) const = 0;
00056 
00057   };
00058 
00061   template<class T>
00062   class ROProduct {
00063 
00064   public:
00065     
00066     ROProduct() {}
00067     ROProduct(const ROProduct<T> &) {}
00068     virtual ~ROProduct() {}
00069 
00070     virtual size_t getSize() const = 0;
00071     virtual T const & operator[](size_t i) const = 0;
00072 
00073   };
00074 }
00075 
00076 #endif

Generated on 5 Jan 2017 for RVL by  doxygen 1.4.7