I have forgot the attributes
authordeba
Sat, 03 Dec 2005 18:30:31 +0000
changeset 18466b4e38acef1c
parent 1845 f8bbfed86036
child 1847 7cbc12e42482
I have forgot the attributes
lemon/lemon_reader.h
     1.1 --- a/lemon/lemon_reader.h	Sat Dec 03 18:17:29 2005 +0000
     1.2 +++ b/lemon/lemon_reader.h	Sat Dec 03 18:30:31 2005 +0000
     1.3 @@ -425,7 +425,14 @@
     1.4      class ValueReaderBase {
     1.5      public:
     1.6        virtual void read(std::istream&) {};
     1.7 +      ValueReaderBase() { _touched = false; }
     1.8 +
     1.9 +      void touch() { _touched = true; }
    1.10 +      bool touched() const { return _touched; }
    1.11 +
    1.12        virtual ~ValueReaderBase() {}
    1.13 +    private:
    1.14 +      bool _touched;
    1.15      };
    1.16  
    1.17      template <typename _Value, typename _Reader>
    1.18 @@ -1926,8 +1933,17 @@
    1.19  	typename Readers::iterator it = readers.find(id);
    1.20  	if (it != readers.end()) {
    1.21  	  it->second->read(ls);
    1.22 +	  it->second->touch();
    1.23  	}
    1.24        }
    1.25 +      for (typename Readers::iterator it = readers.begin();
    1.26 +	   it != readers.end(); ++it) {
    1.27 +	if (!it->second->touched()) {
    1.28 +	  ErrorMessage msg;
    1.29 +	  msg << "Attribute not found in file: " << it->first;
    1.30 +	  throw IOParameterError(msg.message());
    1.31 +	}	
    1.32 +      }
    1.33      }    
    1.34  
    1.35    private: