00001 /* This file is part of Cloudy and is copyright (C)1978-2010 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 00004 #ifndef PREDCONT_H_ 00005 #define PREDCONT_H_ 00006 00007 /* predcont.h */ 00008 00009 #include "energy.h" 00010 00012 class t_PredCont : public Singleton<t_PredCont> 00013 { 00014 friend class Singleton<t_PredCont>; 00015 protected: 00016 t_PredCont(); 00017 private: 00018 vector<EnergyEntry> p_val; 00019 // the offset of the nFnu entries in the line stack. 00020 long p_offset; 00021 public: 00022 long find(double energy, const char* unit = "Ryd") const; 00023 long add(double energy, const char* unit = "Ryd"); 00024 EnergyEntry& operator[] ( size_t i ) 00025 { 00026 return p_val[i]; 00027 } 00028 size_t size() const 00029 { 00030 return p_val.size(); 00031 } 00032 void set_offset(long offset) 00033 { 00034 p_offset = offset; 00035 } 00036 long offset() const 00037 { 00038 return p_offset; 00039 } 00040 }; 00041 00042 #endif /* PREDCONT_H_ */