diff options
author | Gordon Sim <gsim@apache.org> | 2006-09-21 16:19:13 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2006-09-21 16:19:13 +0000 |
commit | 82e07bb30905feb2c11bb6d9f3624f976ab070a5 (patch) | |
tree | c92165d646ea829e4513e78c1bbe483e5b3a152f /cpp/common | |
parent | 99e524975a0d06773623b6124a88219eb8ec0502 (diff) | |
download | qpid-python-82e07bb30905feb2c11bb6d9f3624f976ab070a5.tar.gz |
Use the generated proxy classes rather than constructing frames directly.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@448597 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/common')
-rw-r--r-- | cpp/common/framing/generated/stylesheets/amqp_client.xsl | 26 | ||||
-rw-r--r-- | cpp/common/framing/generated/stylesheets/amqp_server.xsl | 80 |
2 files changed, 69 insertions, 37 deletions
diff --git a/cpp/common/framing/generated/stylesheets/amqp_client.xsl b/cpp/common/framing/generated/stylesheets/amqp_client.xsl index f0fa3d7890..13a912a926 100644 --- a/cpp/common/framing/generated/stylesheets/amqp_client.xsl +++ b/cpp/common/framing/generated/stylesheets/amqp_client.xsl @@ -11,11 +11,11 @@ --> <xsl:template match="amqp" mode="client_h"> <xsl:param name="domain-cpp-table"/> - <xsl:result-document href="AMQP_Client.h" format="textFormat"> + <xsl:result-document href="AMQP_ServerProxy.h" format="textFormat"> <xsl:value-of select="amqp:copyright()"/> <xsl:text> -#ifndef _AMQP_Client_ -#define _AMQP_Client_ +#ifndef _AMQP_ServerProxy_ +#define _AMQP_ServerProxy_ #include "AMQP_ServerOperations.h" #include "FieldTable.h" @@ -24,13 +24,13 @@ namespace qpid { namespace framing { -class AMQP_Client : virtual public AMQP_ServerOperations +class AMQP_ServerProxy : virtual public AMQP_ServerOperations { OutputHandler* out; public: - AMQP_Client(OutputHandler* _out); - virtual ~AMQP_Client() {}

</xsl:text> + AMQP_ServerProxy(OutputHandler* _out); + virtual ~AMQP_ServerProxy() {}

</xsl:text> <xsl:for-each select="class"> <xsl:variable name="class" select="amqp:cpp-class-name(@name)"/> <xsl:if test="doc"> @@ -76,7 +76,7 @@ class AMQP_Client : virtual public AMQP_ServerOperations </xsl:for-each> <xsl:text> }; /* class </xsl:text><xsl:value-of select="$class"/><xsl:text> */
</xsl:text> </xsl:for-each> - <xsl:text>}; /* class AMQP_Client */ + <xsl:text>}; /* class AMQP_ServerProxy */ } /* namespace framing */ } /* namespace qpid */ @@ -94,16 +94,16 @@ class AMQP_Client : virtual public AMQP_ServerOperations --> <xsl:template match="amqp" mode="client_cpp"> <xsl:param name="domain-cpp-table"/> - <xsl:result-document href="AMQP_Client.cpp" format="textFormat"> + <xsl:result-document href="AMQP_ServerProxy.cpp" format="textFormat"> <xsl:value-of select="amqp:copyright()"/> <xsl:text> -#include "AMQP_Client.h" +#include "AMQP_ServerProxy.h" namespace qpid { namespace framing { -AMQP_Client::AMQP_Client(OutputHandler* _out) : +AMQP_ServerProxy::AMQP_ServerProxy(OutputHandler* _out) : out(_out) { }

</xsl:text> @@ -111,15 +111,15 @@ AMQP_Client::AMQP_Client(OutputHandler* _out) : <xsl:variable name="class" select="amqp:cpp-class-name(@name)"/> <xsl:text>
/* ++++++++++ Class: </xsl:text><xsl:value-of select="$class"/><xsl:text> ++++++++++ */ -AMQP_Client::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text><xsl:value-of select="$class"/><xsl:text>(OutputHandler* _out) : +AMQP_ServerProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text><xsl:value-of select="$class"/><xsl:text>(OutputHandler* _out) : out(_out) { } -AMQP_Client::</xsl:text><xsl:value-of select="$class"/><xsl:text>::~</xsl:text><xsl:value-of select="$class"/><xsl:text>() {}

</xsl:text> +AMQP_ServerProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::~</xsl:text><xsl:value-of select="$class"/><xsl:text>() {}

</xsl:text> <xsl:for-each select="method"> <xsl:if test="chassis[@name='server']"> - <xsl:text>void AMQP_Client::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text> + <xsl:text>void AMQP_ServerProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text> <xsl:value-of select="amqp:cpp-name(@name)"/><xsl:text>( u_int16_t channel</xsl:text><xsl:if test="field"> <xsl:text>,
 </xsl:text> <xsl:for-each select="field"> diff --git a/cpp/common/framing/generated/stylesheets/amqp_server.xsl b/cpp/common/framing/generated/stylesheets/amqp_server.xsl index 4ad29a4b95..5ff8994888 100644 --- a/cpp/common/framing/generated/stylesheets/amqp_server.xsl +++ b/cpp/common/framing/generated/stylesheets/amqp_server.xsl @@ -11,11 +11,10 @@ --> <xsl:template match="amqp" mode="server_h"> <xsl:param name="domain-cpp-table"/> - <xsl:result-document href="AMQP_Server.h" format="textFormat"> + <xsl:result-document href="AMQP_ClientProxy.h" format="textFormat"> <xsl:value-of select="amqp:copyright()"/> - <xsl:text> -#ifndef _AMQP_Server_ -#define _AMQP_Server_ +#ifndef _AMQP_ClientProxy_ +#define _AMQP_ClientProxy_ #include "AMQP_ClientOperations.h" #include "FieldTable.h" @@ -24,14 +23,15 @@ namespace qpid { namespace framing { -class AMQP_Server : virtual public AMQP_ClientOperations +class AMQP_ClientProxy : virtual public AMQP_ClientOperations { - OutputHandler* out; - public: - AMQP_Server(OutputHandler* _out); - virtual ~AMQP_Server() {}

</xsl:text> - <xsl:for-each select="class"> + + AMQP_ClientProxy(OutputHandler* _out); + virtual ~AMQP_ClientProxy() {}; + + <!-- inner classes --> + <xsl:for-each select="class"> <xsl:variable name="class" select="amqp:cpp-class-name(@name)"/> <xsl:if test="doc"> <xsl:text>
/**
===== Class: </xsl:text><xsl:value-of select="$class"/><xsl:text> =====
</xsl:text> @@ -74,15 +74,32 @@ class AMQP_Server : virtual public AMQP_ClientOperations <xsl:text> );
</xsl:text> </xsl:if> </xsl:for-each> - <xsl:text> }; /* class </xsl:text><xsl:value-of select="$class"/><xsl:text> */
</xsl:text> + <xsl:text> }; /* class </xsl:text><xsl:value-of select="$class"/> */ </xsl:for-each> - <xsl:text>}; /* class AMQP_Server */ + + <!-- Accessors for each nested class instance --> + <xsl:for-each select="class"> + <xsl:value-of select="concat(amqp:cpp-class-name(@name), '& get', amqp:cpp-class-name(@name), '()')"/>; + </xsl:for-each> + + private: + + OutputHandler* out; + + <!-- An instance of each nested class --> + <xsl:for-each select="class"> + <xsl:value-of select="concat(amqp:cpp-class-name(@name), ' ', amqp:cpp-name(@name))"/>; + </xsl:for-each> + + + + }; /* class AMQP_ClientProxy */ } /* namespace framing */ } /* namespace qpid */ -#endif
</xsl:text> - </xsl:result-document> +#endif +</xsl:result-document> </xsl:template> @@ -94,32 +111,39 @@ class AMQP_Server : virtual public AMQP_ClientOperations --> <xsl:template match="amqp" mode="server_cpp"> <xsl:param name="domain-cpp-table"/> - <xsl:result-document href="AMQP_Server.cpp" format="textFormat"> + <xsl:result-document href="AMQP_ClientProxy.cpp" format="textFormat"> <xsl:value-of select="amqp:copyright()"/> - <xsl:text> -#include "AMQP_Server.h" +#include "AMQP_ClientProxy.h" namespace qpid { namespace framing { -AMQP_Server::AMQP_Server(OutputHandler* _out) : - out(_out) +AMQP_ClientProxy::AMQP_ClientProxy(OutputHandler* _out) : + out(_out), + <!-- Initialisation of each nested class instance --> + <xsl:for-each select="class"> + <xsl:value-of select="concat(amqp:cpp-name(@name), '(_out)')"/> + <xsl:if test="position()!=last()">, + </xsl:if> + </xsl:for-each> + { -}

</xsl:text> +} + <xsl:for-each select="class"> <xsl:variable name="class" select="amqp:cpp-class-name(@name)"/> <xsl:text>
/* ++++++++++ Class: </xsl:text><xsl:value-of select="$class"/><xsl:text> ++++++++++ */ -AMQP_Server::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text><xsl:value-of select="$class"/><xsl:text>(OutputHandler* _out) : +AMQP_ClientProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text><xsl:value-of select="$class"/><xsl:text>(OutputHandler* _out) : out(_out) { } -AMQP_Server::</xsl:text><xsl:value-of select="$class"/><xsl:text>::~</xsl:text><xsl:value-of select="$class"/><xsl:text>() {}

</xsl:text> +AMQP_ClientProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::~</xsl:text><xsl:value-of select="$class"/><xsl:text>() {}

</xsl:text> <xsl:for-each select="method"> <xsl:if test="chassis[@name='client']"> - <xsl:text>void AMQP_Server::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text> + <xsl:text>void AMQP_ClientProxy::</xsl:text><xsl:value-of select="$class"/><xsl:text>::</xsl:text> <xsl:value-of select="amqp:cpp-name(@name)"/><xsl:text>( u_int16_t channel</xsl:text><xsl:if test="field"> <xsl:text>,
 </xsl:text> <xsl:for-each select="field"> @@ -145,8 +169,16 @@ AMQP_Server::</xsl:text><xsl:value-of select="$class"/><xsl:text>::~</xsl:text>< </xsl:if> </xsl:for-each> </xsl:for-each> - <xsl:text> + <!-- Accessors for each nested class instance --> + <xsl:for-each select="class"> + <xsl:value-of select="concat('AMQP_ClientProxy::', amqp:cpp-class-name(@name), '& AMQP_ClientProxy::get', amqp:cpp-class-name(@name), '()')"/>{ + <xsl:value-of select="concat(' return ', amqp:cpp-name(@name))"/>; + } + + </xsl:for-each> + + <xsl:text> } /* namespace framing */ } /* namespace qpid */
</xsl:text> </xsl:result-document> |