automate makeDieImageMap.py processing
g0dil [Wed, 2 Sep 2009 09:28:25 +0000 (09:28 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1370 270642c3-0616-0410-b53a-bc976706d245

Examples/RateStuffer/Mainpage.dox
Examples/RateStuffer/ratestuffer.dia
find-sources.sh
senf/PPI/Mainpage.dox
senf/PPI/classes.dia
senf/Socket/FileHandle.hh
senf/Socket/Mainpage.dox
senf/Socket/SocketPolicy.hh
senf/Socket/SocketProtocol.hh
site_scons/lib/filter.pl
site_scons/lib/makeDiaImageMap.py [moved from doclib/makeDiaImageMap.py with 88% similarity]

index 4a3eda9..fb70e0f 100644 (file)
@@ -20,6 +20,8 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+using namespace senf::ppi::module;
+
 /** \mainpage Example introducing the Packet Processing Infrastructure
 
     This example application implements a simple PPI application: It will read UDP packets from an
 
     \section setup Module setup
 
-    <div class="diamap" name="ratestuffer">
-        <span coords="101,139,220,206">\ref senf::ppi::module::ThrottleBarrier</span>
-        <span coords="241,152,365,219">\ref senf::ppi::module::PassiveQueue</span>
-        <span coords="606,346,748,400">\ref senf::ppi::module::PassiveSocketSink<></span>
-        <span coords="528,190,647,257">\ref RateFilter</span>
-        <span coords="387,165,511,245">\ref senf::ppi::module::PriorityJoin</span>
-        <span coords="0,0,149,53">\ref senf::ppi::module::ActiveSocketSource<></span>
-        <span coords="241,235,365,289">\ref senf::ppi::module::CloneSource</span>
-    </div>
-    \htmlonly <img src="ratestuffer.png" border="0" alt="ratestuffer" usemap="#ratestuffer"> \endhtmlonly
+    \diaimage ratestuffer.dia
 
     Above image depicts the module setup implementing the rate stuffer. A
     senf::ppi::module::ActiveSocketSource reads the incoming UDP packets and sends them into a
index adfa69c..bfdc464 100644 (file)
Binary files a/Examples/RateStuffer/ratestuffer.dia and b/Examples/RateStuffer/ratestuffer.dia differ
index 268aede..ecc3267 100755 (executable)
@@ -23,6 +23,7 @@ find . \
     -name .svn -prune -o \
     -name doc -prune -o \
     -name debian -prune -o \
+    -name dist -prune -o \
     -name "*.a" -o \
     -name "*.o" -o \
     -name "*~" -o \
index fc16dab..47e55fc 100644 (file)
 
     \section ppi_classdiagram Class Diagram
 
-    <div class="diamap" name="classes">
-    <span coords="652,428,796,455">\ref senf::ppi::connector::PassiveConnector</span>
-    <span coords="198,381,316,408">\ref senf::ppi::EventManager</span>
-    <span coords="462,543,571,570">\ref senf::ppi::connector::ActiveOutput</span>
-    <span coords="468,494,564,521">\ref senf::ppi::connector::ActiveInput</span>
-    <span coords="414,36,505,63">\ref senf::ppi::RouteBase</span>
-    <span coords="432,325,529,379">\ref senf::ppi::Route</span>
-    <span coords="194,154,319,181">\ref (some module)</span>
-    <span coords="19,293,252,333">\ref senf::ppi::EventImplementation</span>
-    <span coords="225,36,289,63">\ref senf::ppi::module::Module</span>
-    <span coords="309,331,397,358">\ref senf::ppi::connector::Connector</span>
-    <span coords="597,543,717,570">\ref senf::ppi::connector::PassiveOutput</span>
-    <span coords="66,432,210,459">\ref senf::ppi::detail::EventBindingBase</span>
-    <span coords="378,428,505,455">\ref senf::ppi::connector::InputConnector</span>
-    <span coords="491,124,694,210">\ref senf::ppi::detail::RouteImplementation</span>
-    <span coords="283,464,423,491">\ref senf::ppi::connector::OutputConnector</span>
-    <span coords="512,428,645,455">\ref senf::ppi::connector::ActiveConnector</span>
-    <span coords="85,487,259,527">\ref senf::ppi::detail::EventBinding</span>
-    <span coords="39,216,170,243">\ref senf::ppi::EventDescriptor</span>
-    <span coords="604,494,710,521">\ref senf::ppi::connector::PassiveInput</span>
-    </div>
-    \htmlonly <img src="classes.png" border="0" alt="classes" usemap="#classes"> \endhtmlonly
+    \diaimage classes.dia
  */
 
 
index 379f5fa..36d75a0 100644 (file)
Binary files a/senf/PPI/classes.dia and b/senf/PPI/classes.dia differ
index 6b9bfb9..0667051 100644 (file)
  */
 
 /** \defgroup handle_group The Handle Hierarchy
-
-    <div class="diamap" name="FhHierarchy">
-    <span coords="233,47,438,89">\ref SocketHandle</span>
-    <span coords="32,126,281,168">\ref ClientSocketHandle</span>
-    <span coords="0,187,326,229">\ref ProtocolClientSocketHandle</span>
-    <span coords="350,187,684,229">\ref ProtocolServerSocketHandle</span>
-    <span coords="243,0,343,28">\ref FileHandle</span>
-    <span coords="382,126,638,168">\ref ServerSocketHandle</span>
-    </div>
-    \htmlonly <img src="FhHierarchy.png" border="0" alt="FhHierarchy" usemap="#FhHierarchy"> \endhtmlonly
+    
+    \diaimage FhHierarchy.dia
 
     The senf::FileHandle class is the base of a hierarchy of socket handle classes (realized as
     templates). These classes provide an interface to the complete socket API. While going down the
index 5485c7e..b819521 100644 (file)
@@ -291,48 +291,7 @@ namespace senf {
 
     \section class_diagram Class Diagram
 
-    <div class="diamap" name="SocketLibrary-classes">
-    <span coords="472,667,559,689">\ref IPv4Protocol</span>
-    <span coords="29,773,139,794">\ref WritePolicyBase</span>
-    <span coords="97,939,238,960">\ref SocketBufferingPolicy</span>
-    <span coords="97,390,223,411">\ref NoAddressingPolicy</span>
-    <span coords="97,736,217,758">\ref NotReadablePolicy</span>
-    <span coords="418,609,613,631">\ref AdressableBSDSocketProtocol</span>
-    <span coords="18,895,153,917">\ref BufferingPolicyBase</span>
-    <span coords="22,426,148,447">\ref FramingPolicyBase</span>
-    <span coords="409,0,495,36">\ref FileBody</span>
-    <span coords="97,469,249,491">\ref DatagramFramingPolicy</span>
-    <span coords="97,317,240,339">\ref INet6AddressingPolicy</span>
-    <span coords="453,544,578,566">\ref BSDSocketProtocol</span>
-    <span coords="97,281,240,303">\ref INet4AddressingPolicy</span>
-    <span coords="452,177,706,209">\ref ProtocolServerSocketHandle</span>
-    <span coords="412,259,486,281">\ref PolicyBase</span>
-    <span coords="474,768,557,790">\ref TCPProtocol</span>
-    <span coords="97,700,197,722">\ref ReadablePolicy</span>
-    <span coords="342,249,654,411">\ref SocketPolicy</span>
-    <span coords="0,541,173,563">\ref CommunicationPolicyBase</span>
-    <span coords="640,859,736,881">\ref TCPv6Protocol</span>
-    <span coords="353,428,453,465">\ref SocketProtocol</span>
-    <span coords="97,585,297,606">\ref ConnectedCommunicationPolicy</span>
-    <span coords="172,177,420,209">\ref ProtocolClientSocketHandle</span>
-    <span coords="472,718,559,739">\ref IPv6Protocol</span>
-    <span coords="97,816,192,838">\ref WritablePolicy</span>
-    <span coords="383,62,520,98">\ref SocketBody</span>
-    <span coords="698,888,798,910">\ref PacketProtocol</span>
-    <span coords="97,852,213,874">\ref NotWritablePolicy</span>
-    <span coords="31,657,138,679">\ref ReadPolicyBase</span>
-    <span coords="213,60,369,91">\ref SocketHandle</span>
-    <span coords="197,126,385,158">\ref ClientSocketHandle</span>
-    <span coords="97,621,311,642">\ref UnconnectedCommunicationPolicy</span>
-    <span coords="567,480,786,526">\ref ConcreteSocketProtocol</span>
-    <span coords="582,830,678,852">\ref TCPv4Protocol</span>
-    <span coords="97,505,234,527">\ref StreamFramingPolicy</span>
-    <span coords="13,238,161,259">\ref AddressingPolicyBase</span>
-    <span coords="224,0,294,36">\ref FileHandle</span>
-    <span coords="97,353,222,375">\ref LLAddressingPolicy</span>
-    <span coords="476,126,671,158">\ref ServerSocketHandle</span>
-    </div>
-    \htmlonly <img src="SocketLibrary-classes.png" border="0" alt="SocketLibrary-classes" usemap="#SocketLibrary-classes"> \endhtmlonly
+    \diaimage SocketLibrary-classes.dia
 
     \section impl_notes Arbitrary Implementation Notes
 
index af32b65..256081a 100644 (file)
 
 /** \defgroup policy_group The Policy Framework
 
-    <div class="diamap" name="SocketPolicy">
-    <span coords="39,229,182,257">\ref WritePolicyBase</span>
-    <span coords="17,76,210,105">\ref AddressingPolicyBase</span>
-    <span coords="29,114,194,143">\ref FramingPolicyBase</span>
-    <span coords="368,0,463,28">\ref PolicyBase</span>
-    <span coords="275,2,691,185">\ref SocketPolicy</span>
-    <span coords="0,152,227,181">\ref CommunicationPolicyBase</span>
-    <span coords="41,191,180,219">\ref ReadPolicyBase</span>
-    </div>
-    \htmlonly <img src="SocketPolicy.png" border="0" alt="SocketPolicy" usemap="#SocketPolicy"> \endhtmlonly
+    \diaimage SocketPolicy.dia
 
     \section policy_group_introduction Introduction to the Policy Framework
 
index b41fccb..8538b17 100644 (file)
 
 /** \defgroup protocol_group The Protocol Classes
 
-     <div class="diamap" name="Protocols">
-     <span coords="0,0,118,25">\ref SocketProtocol</span>
-     <span coords="139,381,279,407">\ref UNSocketProtocol</span>
-     <span coords="527,412,693,438">\ref PacketSocketProtocol</span>
-     <span coords="214,49,471,86">\ref ConcreteSocketProtocol</span>
-     <span coords="135,112,283,137">\ref BSDSocketProtocol</span>
-     <span coords="114,258,304,284">\ref DatagramSocketProtocol</span>
-     <span coords="136,320,281,346">\ref TCPSocketProtocol</span>
-     <span coords="395,446,604,472">\ref UNDatagramSocketProtocol</span>
-     <span coords="89,189,329,215">\ref AddressableBSDSocketProtocol</span>
-     <span coords="282,481,444,507">\ref TCPv4SocketProtocol</span>
-     </div>
-     \htmlonly <img src="Protocols.png" border="0" alt="Protocols" usemap="#Protocols"> \endhtmlonly
+    \diaimage Protocols.dia
 
     The socket handle classes and templates only implement the most important socket API methods
     using the policy framework. To access the complete API, the protocol interface is
index 14ad930..c35ae81 100755 (executable)
@@ -1,8 +1,7 @@
 #!/usr/bin/perl -n
 
 BEGIN {
-    ($topdir=$0) =~ s{doclib/.*$}{};
-    print $topdir,"\n";
+    ($libdir=$0) =~ s{/[^/]*$}{};
 }
 
 s/\s*$//;
@@ -16,6 +15,11 @@ elsif (s/^(\s*)<pre>$/$1<pre class="fragment">/ .. /<\/pre>/ && !/^$/) {
     $i=length($1) if /^(\s*)<pre class="fragment">$/;
     print substr($_,$i),"\n";
 } 
+elsif (/\\diaimage\s+(\S+)/) {
+    $dia=$1;
+    ($png=$dia)=~s/\.dia$/.png/;
+    system("python $libdir/makeDiaImageMap.py $dia");
+}
 else {
     print $_,"\n";
 }
similarity index 88%
rename from doclib/makeDiaImageMap.py
rename to site_scons/lib/makeDiaImageMap.py
index db9a9ce..56dfbc3 100755 (executable)
@@ -18,14 +18,21 @@ stylesheet=u"""
   <xsl:template match="text()"/>
 
   <xsl:template match="dia:object[@type='UML - Class']">
-    <xsl:value-of select="dia:attribute[@name='name']/dia:string"/>
+    <xsl:choose>
+      <xsl:when test="dia:attribute[@name='comment']/dia:string!='##'">
+        <xsl:value-of select="dia:attribute[@name='comment']/dia:string"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="dia:attribute[@name='name']/dia:string"/>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:text> </xsl:text>
     <xsl:value-of select="dia:attribute[@name='obj_bb']/dia:rectangle/@val"/>
     <xsl:text>&#x0a;</xsl:text>
   </xsl:template>
 
   <xsl:template match="dia:attribute[@name='obj_bb']/dia:rectangle">
-    <xsl:text>## </xsl:text>
+    <xsl:text>!! </xsl:text>
     <xsl:value-of select="@val"/>
     <xsl:text>&#x0a;</xsl:text>
   </xsl:template>