[cig-commits] r13745 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Dec 17 02:32:54 PST 2008


Author: luis
Date: 2008-12-17 02:32:54 -0800 (Wed, 17 Dec 2008)
New Revision: 13745

Modified:
   cs/cigma/trunk/src/core_args.cpp
   cs/cigma/trunk/src/core_args.h
Log:
Added empty() method for convenience

Modified: cs/cigma/trunk/src/core_args.cpp
===================================================================
--- cs/cigma/trunk/src/core_args.cpp	2008-12-17 10:32:53 UTC (rev 13744)
+++ cs/cigma/trunk/src/core_args.cpp	2008-12-17 10:32:54 UTC (rev 13745)
@@ -31,6 +31,10 @@
     return p_mesh || p_nc || p_eb || (cell_type_name != "");
 }
 
+bool MeshInfo::empty() const
+{
+    return !(*this);
+}
 
 std::ostream& operator<<(std::ostream& os, const MeshInfo& mesh_info)
 {
@@ -76,6 +80,11 @@
     return p_quadrature || p_weights || p_points || (cell_type_name != "");
 }
 
+bool QuadratureInfo::empty() const
+{
+    return !(*this);
+}
+
 std::ostream& operator<<(std::ostream& os, const QuadratureInfo& q_info)
 {
     if (q_info)
@@ -121,6 +130,11 @@
     return q_info || p_fe_basis || p_fe_basis_jet;
 }
 
+bool FE_Info::empty() const
+{
+    return !(*this);
+}
+
 std::ostream& operator<<(std::ostream& os, const FE_Info& fe_info)
 {
     if (fe_info)
@@ -159,6 +173,11 @@
     return p_field || fe_info || mesh_info;
 }
 
+bool FieldInfo::empty() const
+{
+    return !(*this);
+}
+
 std::ostream& operator<<(std::ostream& os, const FieldInfo& field_info)
 {
     if (field_info)

Modified: cs/cigma/trunk/src/core_args.h
===================================================================
--- cs/cigma/trunk/src/core_args.h	2008-12-17 10:32:53 UTC (rev 13744)
+++ cs/cigma/trunk/src/core_args.h	2008-12-17 10:32:54 UTC (rev 13745)
@@ -23,6 +23,7 @@
         MeshInfo(const MeshInfo& other);
         MeshInfo& operator=(const MeshInfo& other);
         operator bool() const;
+        bool empty() const;
     };
 
 
@@ -38,6 +39,7 @@
         QuadratureInfo(const QuadratureInfo& other);
         QuadratureInfo& operator=(const QuadratureInfo& other);
         operator bool() const;
+        bool empty() const;
     };
 
 
@@ -52,6 +54,7 @@
         FE_Info(const FE_Info& other);
         FE_Info& operator=(const FE_Info& other);
         operator bool() const;
+        bool empty() const;
     };
 
 
@@ -66,6 +69,7 @@
         FieldInfo(const FieldInfo& other);
         FieldInfo& operator=(const FieldInfo& other);
         operator bool() const;
+        bool empty() const;
     };
 
     struct FunctionInfo
@@ -77,6 +81,7 @@
         ~FunctionInfo();
         FunctionInfo(const FunctionInfo& other);
         FunctionInfo& operator=(const FunctionInfo& other);
+        bool empty() const;
     };
 
 }



More information about the CIG-COMMITS mailing list