[Lemon-commits] [lemon_svn] deba: r2405 - hugo/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:52:24 CET 2006


Author: deba
Date: Sat Dec  3 19:30:31 2005
New Revision: 2405

Modified:
   hugo/trunk/lemon/lemon_reader.h

Log:
I have forgot the attributes



Modified: hugo/trunk/lemon/lemon_reader.h
==============================================================================
--- hugo/trunk/lemon/lemon_reader.h	(original)
+++ hugo/trunk/lemon/lemon_reader.h	Sat Dec  3 19:30:31 2005
@@ -425,7 +425,14 @@
     class ValueReaderBase {
     public:
       virtual void read(std::istream&) {};
+      ValueReaderBase() { _touched = false; }
+
+      void touch() { _touched = true; }
+      bool touched() const { return _touched; }
+
       virtual ~ValueReaderBase() {}
+    private:
+      bool _touched;
     };
 
     template <typename _Value, typename _Reader>
@@ -1926,8 +1933,17 @@
 	typename Readers::iterator it = readers.find(id);
 	if (it != readers.end()) {
 	  it->second->read(ls);
+	  it->second->touch();
 	}
       }
+      for (typename Readers::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second->touched()) {
+	  ErrorMessage msg;
+	  msg << "Attribute not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
+	}	
+      }
     }    
 
   private:



More information about the Lemon-commits mailing list