[cig-commits] r14871 - in short/3D/PyLith/trunk/doc: . developer

brad at geodynamics.org brad at geodynamics.org
Tue May 5 11:32:29 PDT 2009


Author: brad
Date: 2009-05-05 11:32:29 -0700 (Tue, 05 May 2009)
New Revision: 14871

Added:
   short/3D/PyLith/trunk/doc/developer/
   short/3D/PyLith/trunk/doc/developer/SWIG
   short/3D/PyLith/trunk/doc/developer/general
Log:
Added some general developer notes.

Added: short/3D/PyLith/trunk/doc/developer/SWIG
===================================================================
--- short/3D/PyLith/trunk/doc/developer/SWIG	                        (rev 0)
+++ short/3D/PyLith/trunk/doc/developer/SWIG	2009-05-05 18:32:29 UTC (rev 14871)
@@ -0,0 +1,31 @@
+Notes on using SWIG for interfacing C++ with SWIG.
+
+The SWIG interface (.i) files are simply stripped down versions of the
+C++ header files.
+
+* Remove unnecessary stuff.
+
+  The SWIG interface files only need the methods that should be
+  included in the interface and any virtual methods (even if they are
+  private). Remove all data members.
+
+* Namespaces
+
+  (1) The class definition must appear within any namespace blocks.
+
+      Use
+        namespace pylith {
+          class Foo {
+          ...
+          };
+        }
+      instead of forward declaring the class and using
+        class pylith::Foo {
+        ...
+        };
+
+   (2) The full class name must be given for method arguments unless
+   the class is in the same namespace. In other words, use
+   pylith::topology::Mesh instead of topology::Mesh.
+
+ 
\ No newline at end of file

Added: short/3D/PyLith/trunk/doc/developer/general
===================================================================
--- short/3D/PyLith/trunk/doc/developer/general	                        (rev 0)
+++ short/3D/PyLith/trunk/doc/developer/general	2009-05-05 18:32:29 UTC (rev 14871)
@@ -0,0 +1,15 @@
+Guiding Principles for PyLith code
+
+1. Document your header files in Doxygen format. Include a description
+for EVERY method, member, and argument to a member function.
+
+2. Class definitions go in header files (.hh), class implementations
+go in .cc files, and inline methods go in .icc files. Use an include
+directive in header files for inline methods.
+
+3. Files checked in to the repository trunk should at least compile.
+
+4. C++ and Python classes should have corresponding unit tests in
+libtests and pytests. High-level functionality should be verified
+using a full-scale test.
+



More information about the CIG-COMMITS mailing list