00001 /* Copyright 2004 00002 Stanford University 00003 00004 This file is part of the DSR PDB Library. 00005 00006 The DSR PDB Library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation; either version 2.1 of the License, or (at your 00009 option) any later version. 00010 00011 The DSR PDB Library is distributed in the hope that it will be useful, but 00012 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00013 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00014 License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with the DSR PDB Library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00019 MA 02111-1307, USA. */ 00020 00021 #ifndef DSR_PDB_LABEL_H 00022 #define DSR_PDB_LABEL_H 00023 00024 #include <cassert> 00025 00026 namespace dsrpdb { 00027 template <class Type> 00028 struct label { 00029 typedef labeled_index<Type> This; 00030 00031 label(int i): i_(i) { 00032 } 00033 label():i_(-1){} 00034 00035 int value() const { 00036 assert(!null()); 00037 } 00038 00039 bool operator==(This o) const { 00040 return i_== o.i_; 00041 } 00042 00043 int i_; 00044 }; 00045 } 00046 00047 #endif