00001 // ---------------------------------------------------------------------------- 00002 // CERTI - HLA RunTime Infrastructure 00003 // Copyright (C) 2003 ONERA 00004 // 00005 // This file is part of CERTI-libCERTI 00006 // 00007 // CERTI-libCERTI is free software ; you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License 00009 // as published by the Free Software Foundation ; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this program ; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 // USA 00021 // 00022 // $Id: Extent.hh,v 3.10 2008/12/07 20:16:13 gotthardp Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 #ifndef CERTI_EXTENT_HH 00026 #define CERTI_EXTENT_HH 00027 00028 #include "certi.hh" 00029 #include "Exception.hh" 00030 00031 #include <vector> 00032 #include <utility> 00033 #include <map> 00034 00035 namespace certi { 00036 00037 typedef std::pair<ULong, ULong> Range ; 00038 typedef std::vector<Range> RangeSet ; 00039 00040 // ---------------------------------------------------------------------------- 00047 class CERTI_EXPORT Extent 00048 { 00049 public: 00050 Extent(size_t); 00051 00052 ULong getRangeLowerBound(DimensionHandle) const 00053 throw (ArrayIndexOutOfBounds); 00054 00055 ULong getRangeUpperBound(DimensionHandle) const 00056 throw (ArrayIndexOutOfBounds); 00057 00058 void setRangeUpperBound(DimensionHandle, ULong) 00059 throw (ArrayIndexOutOfBounds); 00060 00061 void setRangeLowerBound(DimensionHandle, ULong) 00062 throw (ArrayIndexOutOfBounds); 00063 00064 bool overlaps(const Extent &) const ; 00065 size_t size() const ; 00066 00067 private: 00068 RangeSet ranges ; 00069 }; 00070 00071 } // namespace certi 00072 00073 #endif // CERTI_EXTENT_HH 00074 00075 // $Id: Extent.hh,v 3.10 2008/12/07 20:16:13 gotthardp Exp $