lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5229] Specialize reconstitutors more finely (VS)


From: Greg Chicares
Subject: [lmi-commits] [5229] Specialize reconstitutors more finely (VS)
Date: Fri, 05 Aug 2011 00:28:32 +0000

Revision: 5229
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5229
Author:   chicares
Date:     2011-08-05 00:28:32 +0000 (Fri, 05 Aug 2011)
Log Message:
-----------
Specialize reconstitutors more finely (VS)

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/input.hpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2011-08-03 23:40:19 UTC (rev 5228)
+++ lmi/trunk/ChangeLog 2011-08-05 00:28:32 UTC (rev 5229)
@@ -28131,3 +28131,9 @@
 When a cell is added, select it (VS). See:
   http://lists.nongnu.org/archive/html/lmi/2011-08/msg00003.html
 
+20110805T0028Z <address@hidden> [637]
+
+  input.hpp
+Specialize reconstitutors more finely (VS). See:
+  http://lists.nongnu.org/archive/html/lmi/2011-03/msg00005.html
+

Modified: lmi/trunk/input.hpp
===================================================================
--- lmi/trunk/input.hpp 2011-08-03 23:40:19 UTC (rev 5228)
+++ lmi/trunk/input.hpp 2011-08-05 00:28:32 UTC (rev 5229)
@@ -488,21 +488,29 @@
 };
 
 /// Specialization of struct template reconstitutor for this Model
-/// and the base class that all its UDTs share.
+/// and the base class that all its input sequences share.
 
-template<> struct reconstitutor<datum_base, Input>
+template<> struct reconstitutor<datum_sequence, Input>
 {
-    typedef datum_base DesiredType;
+    typedef datum_sequence DesiredType;
     static DesiredType* reconstitute(any_member<Input>& m)
         {
         DesiredType* z = 0;
-        z = exact_cast<ce_product_name         >(m); if(z) return z;
-        z = exact_cast<datum_string            >(m); if(z) return z;
-        // Sequences.
-        z = exact_cast<datum_sequence          >(m); if(z) return z;
         z = exact_cast<mode_sequence           >(m); if(z) return z;
         z = exact_cast<payment_sequence        >(m); if(z) return z;
-        // mc- types.
+        return z;
+        }
+};
+
+/// Specialization of struct template reconstitutor for this Model
+/// and the base class that all its mc_enum types share.
+
+template<> struct reconstitutor<mc_enum_base, Input>
+{
+    typedef mc_enum_base DesiredType;
+    static DesiredType* reconstitute(any_member<Input>& m)
+        {
+        DesiredType* z = 0;
         z = exact_cast<mce_gen_basis           >(m); if(z) return z;
         z = exact_cast<mce_class               >(m); if(z) return z;
         z = exact_cast<mce_country             >(m); if(z) return z;
@@ -534,7 +542,19 @@
         z = exact_cast<mce_to_point            >(m); if(z) return z;
         z = exact_cast<mce_uw_basis            >(m); if(z) return z;
         z = exact_cast<mce_yes_or_no           >(m); if(z) return z;
-        // tnr- types.
+        return z;
+        }
+};
+
+/// Specialization of struct template reconstitutor for this Model
+/// and the base class that all its tn_range types share.
+
+template<> struct reconstitutor<tn_range_base, Input>
+{
+    typedef tn_range_base DesiredType;
+    static DesiredType* reconstitute(any_member<Input>& m)
+        {
+        DesiredType* z = 0;
         z = exact_cast<tnr_age                 >(m); if(z) return z;
         z = exact_cast<tnr_corridor_factor     >(m); if(z) return z;
         z = exact_cast<tnr_date                >(m); if(z) return z;
@@ -549,16 +569,23 @@
 };
 
 /// Specialization of struct template reconstitutor for this Model
-/// and the base class that all its input sequences share.
+/// and the base class that all its UDTs share.
 
-template<> struct reconstitutor<datum_sequence, Input>
+template<> struct reconstitutor<datum_base, Input>
 {
-    typedef datum_sequence DesiredType;
+    typedef datum_base DesiredType;
     static DesiredType* reconstitute(any_member<Input>& m)
         {
         DesiredType* z = 0;
-        z = exact_cast<mode_sequence           >(m); if(z) return z;
-        z = exact_cast<payment_sequence        >(m); if(z) return z;
+        z = exact_cast<ce_product_name         >(m); if(z) return z;
+        z = exact_cast<datum_string            >(m); if(z) return z;
+        // As long as type datum_sequence is used directly (and not
+        // only as a base class), the following line is necessary,
+        // even though datum_sequence's reconstitutor is called.
+        z = exact_cast<datum_sequence          >(m); if(z) return z;
+        z = reconstitutor<datum_sequence,Input>::reconstitute(m); if(z) return 
z;
+        z = reconstitutor<mc_enum_base  ,Input>::reconstitute(m); if(z) return 
z;
+        z = reconstitutor<tn_range_base ,Input>::reconstitute(m); if(z) return 
z;
         return z;
         }
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]