You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by nm...@apache.org on 2006/04/27 23:59:44 UTC

svn commit: r397654 [7/12] - in /incubator/activemq/trunk/openwire-cpp: ./ src/ src/command/ src/gram/ src/gram/java/ src/gram/java/org/ src/gram/java/org/apache/ src/gram/java/org/apache/activemq/ src/gram/java/org/apache/activemq/openwire/ src/gram/j...

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,86 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_SessionId_hpp_
+#define ActiveMQ_SessionId_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/AbstractCommand.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for SessionId
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class SessionId : public AbstractCommand
+{
+protected:
+    p<string> connectionId ;
+    long long value ;
+
+public:
+    const static unsigned char TYPE = 121;
+
+public:
+    SessionId() ;
+    virtual ~SessionId() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual p<string> getConnectionId() ;
+    virtual void setConnectionId(p<string> connectionId) ;
+
+    virtual long long getValue() ;
+    virtual void setValue(long long value) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_SessionId_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,63 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/SessionInfo.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for SessionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+
+unsigned char SessionInfo::getDataStructureType()
+{
+    return SessionInfo::TYPE ; 
+}
+
+        
+p<SessionId> SessionInfo::getSessionId()
+{
+    return sessionId ;
+}
+
+void SessionInfo::setSessionId(p<SessionId> sessionId)
+{
+    this->sessionId = sessionId ;
+}
+
+int SessionInfo::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    size += marshaller->marshalInt(commandId, mode, writer) ;
+    size += marshaller->marshalBoolean(responseRequired, mode, writer) ; 
+    size += marshaller->marshalObject(sessionId, mode, writer) ; 
+    return size ;
+}
+
+void SessionInfo::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    commandId = marshaller->unmarshalInt(mode, reader) ;
+    responseRequired = marshaller->unmarshalBoolean(mode, reader) ; 
+    sessionId = p_cast<SessionId>(marshaller->unmarshalObject(mode, reader)) ; 
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,80 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_SessionInfo_hpp_
+#define ActiveMQ_SessionInfo_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/BaseCommand.hpp"
+#include "activemq/command/SessionId.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for SessionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class SessionInfo : public BaseCommand
+{
+protected:
+    p<SessionId> sessionId ;
+
+public:
+    const static unsigned char TYPE = 4;
+
+public:
+    virtual unsigned char getDataStructureType() ;
+
+    virtual p<SessionId> getSessionId() ;
+    virtual void setSessionId(p<SessionId> sessionId) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_SessionInfo_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,57 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/ShutdownInfo.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for ShutdownInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+ShutdownInfo::ShutdownInfo()
+{
+}
+
+ShutdownInfo::~ShutdownInfo()
+{
+}
+
+unsigned char ShutdownInfo::getDataStructureType()
+{
+    return ShutdownInfo::TYPE ; 
+}
+
+int ShutdownInfo::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    size += marshaller->marshalInt(commandId, mode, writer) ;
+    size += marshaller->marshalBoolean(responseRequired, mode, writer) ; 
+    return size ;
+}
+
+void ShutdownInfo::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    commandId = marshaller->unmarshalInt(mode, reader) ;
+    responseRequired = marshaller->unmarshalBoolean(mode, reader) ; 
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,78 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_ShutdownInfo_hpp_
+#define ActiveMQ_ShutdownInfo_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/BaseCommand.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for ShutdownInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class ShutdownInfo : public BaseCommand
+{
+protected:
+
+public:
+    const static unsigned char TYPE = 11;
+
+public:
+    ShutdownInfo() ;
+    virtual ~ShutdownInfo() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_ShutdownInfo_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,113 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/SubscriptionInfo.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for SubscriptionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+SubscriptionInfo::SubscriptionInfo()
+{
+    this->clientId = NULL ;
+    this->destination = NULL ;
+    this->selector = NULL ;
+    this->subcriptionName = NULL ;
+}
+
+SubscriptionInfo::~SubscriptionInfo()
+{
+}
+
+unsigned char SubscriptionInfo::getDataStructureType()
+{
+    return SubscriptionInfo::TYPE ; 
+}
+
+        
+p<string> SubscriptionInfo::getClientId()
+{
+    return clientId ;
+}
+
+void SubscriptionInfo::setClientId(p<string> clientId)
+{
+    this->clientId = clientId ;
+}
+
+        
+p<ActiveMQDestination> SubscriptionInfo::getDestination()
+{
+    return destination ;
+}
+
+void SubscriptionInfo::setDestination(p<ActiveMQDestination> destination)
+{
+    this->destination = destination ;
+}
+
+        
+p<string> SubscriptionInfo::getSelector()
+{
+    return selector ;
+}
+
+void SubscriptionInfo::setSelector(p<string> selector)
+{
+    this->selector = selector ;
+}
+
+        
+p<string> SubscriptionInfo::getSubcriptionName()
+{
+    return subcriptionName ;
+}
+
+void SubscriptionInfo::setSubcriptionName(p<string> subcriptionName)
+{
+    this->subcriptionName = subcriptionName ;
+}
+
+int SubscriptionInfo::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    size += marshaller->marshalInt(commandId, mode, writer) ;
+    size += marshaller->marshalBoolean(responseRequired, mode, writer) ; 
+    size += marshaller->marshalString(clientId, mode, writer) ; 
+    size += marshaller->marshalObject(destination, mode, writer) ; 
+    size += marshaller->marshalString(selector, mode, writer) ; 
+    size += marshaller->marshalString(subcriptionName, mode, writer) ; 
+    return size ;
+}
+
+void SubscriptionInfo::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    commandId = marshaller->unmarshalInt(mode, reader) ;
+    responseRequired = marshaller->unmarshalBoolean(mode, reader) ; 
+    clientId = p_cast<string>(marshaller->unmarshalString(mode, reader)) ; 
+    destination = p_cast<ActiveMQDestination>(marshaller->unmarshalObject(mode, reader)) ; 
+    selector = p_cast<string>(marshaller->unmarshalString(mode, reader)) ; 
+    subcriptionName = p_cast<string>(marshaller->unmarshalString(mode, reader)) ; 
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,95 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_SubscriptionInfo_hpp_
+#define ActiveMQ_SubscriptionInfo_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/AbstractCommand.hpp"
+#include "activemq/command/ActiveMQDestination.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for SubscriptionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class SubscriptionInfo : public AbstractCommand
+{
+protected:
+    p<string> clientId ;
+    p<ActiveMQDestination> destination ;
+    p<string> selector ;
+    p<string> subcriptionName ;
+
+public:
+    const static unsigned char TYPE = 55;
+
+public:
+    SubscriptionInfo() ;
+    virtual ~SubscriptionInfo() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual p<string> getClientId() ;
+    virtual void setClientId(p<string> clientId) ;
+
+    virtual p<ActiveMQDestination> getDestination() ;
+    virtual void setDestination(p<ActiveMQDestination> destination) ;
+
+    virtual p<string> getSelector() ;
+    virtual void setSelector(p<string> selector) ;
+
+    virtual p<string> getSubcriptionName() ;
+    virtual void setSubcriptionName(p<string> subcriptionName) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_SubscriptionInfo_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,53 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/TransactionId.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for TransactionId
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+TransactionId::TransactionId()
+{
+}
+
+TransactionId::~TransactionId()
+{
+}
+
+unsigned char TransactionId::getDataStructureType()
+{
+    return TransactionId::TYPE ; 
+}
+
+int TransactionId::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    return size ;
+}
+
+void TransactionId::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,78 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_TransactionId_hpp_
+#define ActiveMQ_TransactionId_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/AbstractCommand.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for TransactionId
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class TransactionId : public AbstractCommand
+{
+protected:
+
+public:
+    const static unsigned char TYPE = 0;
+
+public:
+    TransactionId() ;
+    virtual ~TransactionId() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_TransactionId_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,99 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/TransactionInfo.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for TransactionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+TransactionInfo::TransactionInfo()
+{
+    this->connectionId = NULL ;
+    this->transactionId = NULL ;
+    this->type = 0 ;
+}
+
+TransactionInfo::~TransactionInfo()
+{
+}
+
+unsigned char TransactionInfo::getDataStructureType()
+{
+    return TransactionInfo::TYPE ; 
+}
+
+        
+p<ConnectionId> TransactionInfo::getConnectionId()
+{
+    return connectionId ;
+}
+
+void TransactionInfo::setConnectionId(p<ConnectionId> connectionId)
+{
+    this->connectionId = connectionId ;
+}
+
+        
+p<TransactionId> TransactionInfo::getTransactionId()
+{
+    return transactionId ;
+}
+
+void TransactionInfo::setTransactionId(p<TransactionId> transactionId)
+{
+    this->transactionId = transactionId ;
+}
+
+        
+char TransactionInfo::getType()
+{
+    return type ;
+}
+
+void TransactionInfo::setType(char type)
+{
+    this->type = type ;
+}
+
+int TransactionInfo::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    size += marshaller->marshalInt(commandId, mode, writer) ;
+    size += marshaller->marshalBoolean(responseRequired, mode, writer) ; 
+    size += marshaller->marshalObject(connectionId, mode, writer) ; 
+    size += marshaller->marshalObject(transactionId, mode, writer) ; 
+    size += marshaller->marshalByte(type, mode, writer) ; 
+    return size ;
+}
+
+void TransactionInfo::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    commandId = marshaller->unmarshalInt(mode, reader) ;
+    responseRequired = marshaller->unmarshalBoolean(mode, reader) ; 
+    connectionId = p_cast<ConnectionId>(marshaller->unmarshalObject(mode, reader)) ; 
+    transactionId = p_cast<TransactionId>(marshaller->unmarshalObject(mode, reader)) ; 
+    type = (marshaller->unmarshalByte(mode, reader)) ; 
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,92 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_TransactionInfo_hpp_
+#define ActiveMQ_TransactionInfo_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/BaseCommand.hpp"
+#include "activemq/command/ConnectionId.hpp"
+#include "activemq/command/TransactionId.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for TransactionInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class TransactionInfo : public BaseCommand
+{
+protected:
+    p<ConnectionId> connectionId ;
+    p<TransactionId> transactionId ;
+    char type ;
+
+public:
+    const static unsigned char TYPE = 7;
+
+public:
+    TransactionInfo() ;
+    virtual ~TransactionInfo() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual p<ConnectionId> getConnectionId() ;
+    virtual void setConnectionId(p<ConnectionId> connectionId) ;
+
+    virtual p<TransactionId> getTransactionId() ;
+    virtual void setTransactionId(p<TransactionId> transactionId) ;
+
+    virtual char getType() ;
+    virtual void setType(char type) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_TransactionInfo_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,165 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/WireFormatInfo.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for WireFormatInfo
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+WireFormatInfo::WireFormatInfo()
+{    
+    this->magic         = array<char> (8) ;
+    this->version       = 0 ;
+    this->propsByteSize = 0 ;
+    this->properties    = new PropertyMap() ;
+}
+
+unsigned char WireFormatInfo::getDataStructureType()
+{
+    return WireFormatInfo::TYPE ; 
+}
+
+        
+array<char> WireFormatInfo::getMagic()
+{
+    return magic ;
+}
+
+void WireFormatInfo::setMagic(array<char> magic)
+{
+    this->magic = magic ;
+}
+
+        
+int WireFormatInfo::getVersion()
+{
+    return version ;
+}
+
+void WireFormatInfo::setVersion(int version)
+{
+    this->version = version ;
+}
+
+        
+bool WireFormatInfo::getCacheEnabled()
+{
+    return (*properties)["CacheEnabled"].getBoolean() ;
+}
+
+void WireFormatInfo::setCacheEnabled(bool cacheEnabled)
+{
+    (*properties)["CacheEnabled"] = MapItemHolder(cacheEnabled) ;
+}
+
+        
+bool WireFormatInfo::getStackTraceEnabled()
+{
+    return (*properties)["StackTraceEnabled"].getBoolean() ;
+}
+
+void WireFormatInfo::setStackTraceEnabled(bool stackTraceEnabled)
+{
+    (*properties)["StackTraceEnabled"] = MapItemHolder(stackTraceEnabled) ;
+}
+
+        
+bool WireFormatInfo::getTcpNoDelayEnabled()
+{
+    return (*properties)["TcpNoDelayedEnabled"].getBoolean() ;
+}
+
+void WireFormatInfo::setTcpNoDelayEnabled(bool tcpNoDelayEnabled)
+{
+    (*properties)["TcpNoDelayedEnabled"] = MapItemHolder(tcpNoDelayEnabled) ;
+}
+
+
+bool WireFormatInfo::getSizePrefixDisabled()
+{
+    return (*properties)["SizePrefixDisabled"].getBoolean() ;
+}
+
+void WireFormatInfo::setSizePrefixDisabled(bool sizePrefixDisabled)
+{
+    (*properties)["SizePrefixDisabled"] = MapItemHolder(sizePrefixDisabled) ;
+}
+
+        
+bool WireFormatInfo::getTightEncodingEnabled()
+{
+    return (*properties)["TightEncodingEnabled"].getBoolean() ;
+}
+
+void WireFormatInfo::setTightEncodingEnabled(bool tightEncodingEnabled)
+{
+    (*properties)["TightEncodingEnabled"] = MapItemHolder(tightEncodingEnabled) ;
+}
+
+int WireFormatInfo::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    // BUG: Should write array size
+    //size += marshaller->marshalByteArray(magic, mode, writer) ; 
+    size += (int)magic.size() ;
+    
+    if( mode == IMarshaller::MARSHAL_WRITE )
+        writer->write(magic.c_array(), 0, size) ;
+
+    size += marshaller->marshalInt(version, mode, writer) ; 
+    size += marshaller->marshalBoolean( properties != NULL, mode, writer) ;
+
+    if( mode == IMarshaller::MARSHAL_SIZE )
+    {
+        //propsByteSize = sizeof(int) ;
+        propsByteSize += marshaller->marshalMap(properties, mode, writer) ;
+        size += propsByteSize ;
+    }
+    else
+    {
+        size += marshaller->marshalInt(propsByteSize, mode, writer) ; 
+        size += marshaller->marshalMap(properties, mode, writer) ; 
+    }
+    return size ;
+}
+
+void WireFormatInfo::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    bool isNonNullProps ;
+
+    // BUG: Should read array size
+    //magic = marshaller->unmarshalByteArray(mode, reader) ; 
+    reader->read(magic.c_array(), 0, 8) ;
+    version = marshaller->unmarshalInt(mode, reader) ; 
+    isNonNullProps = marshaller->unmarshalBoolean(mode, reader) ;
+    if( isNonNullProps )
+    {
+        propsByteSize = marshaller->unmarshalInt(mode, reader) ;
+        properties = marshaller->unmarshalMap(mode, reader) ; 
+    }
+    else
+        properties = NULL ;
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,98 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_WireFormatInfo_hpp_
+#define ActiveMQ_WireFormatInfo_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include <map>
+#include "activemq/command/AbstractCommand.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/MapItemHolder.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+      using namespace apache::ppr::util;
+
+/*
+ *  Marshalling code for Open Wire Format for WireFormatInfo
+ */
+class WireFormatInfo : public AbstractCommand
+{
+protected:
+    array<char> magic ;
+    int         version,
+                propsByteSize ;
+    p<PropertyMap> properties ;
+
+public:
+    const static unsigned char TYPE = 1;
+
+public:
+    WireFormatInfo() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual array<char> getMagic() ;
+    virtual void setMagic(array<char> magic) ;
+
+    virtual int getVersion() ;
+    virtual void setVersion(int version) ;
+
+    virtual bool getCacheEnabled() ;
+    virtual void setCacheEnabled(bool cacheEnabled) ;
+
+    virtual bool getStackTraceEnabled() ;
+    virtual void setStackTraceEnabled(bool stackTraceEnabled) ;
+
+    virtual bool getTcpNoDelayEnabled() ;
+    virtual void setTcpNoDelayEnabled(bool tcpNoDelayEnabled) ;
+
+    virtual bool getSizePrefixDisabled() ;
+    virtual void setSizePrefixDisabled(bool sizePrefixDisabled) ;
+
+    virtual bool getTightEncodingEnabled() ;
+    virtual void setTightEncodingEnabled(bool tightEncodingEnabled) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_WireFormatInfo_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,95 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "activemq/command/XATransactionId.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for XATransactionId
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+XATransactionId::XATransactionId()
+{
+    this->formatId = 0 ;
+    this->globalTransactionId = NULL ;
+    this->branchQualifier = NULL ;
+}
+
+XATransactionId::~XATransactionId()
+{
+}
+
+unsigned char XATransactionId::getDataStructureType()
+{
+    return XATransactionId::TYPE ; 
+}
+
+        
+int XATransactionId::getFormatId()
+{
+    return formatId ;
+}
+
+void XATransactionId::setFormatId(int formatId)
+{
+    this->formatId = formatId ;
+}
+
+        
+array<char> XATransactionId::getGlobalTransactionId()
+{
+    return globalTransactionId ;
+}
+
+void XATransactionId::setGlobalTransactionId(array<char> globalTransactionId)
+{
+    this->globalTransactionId = globalTransactionId ;
+}
+
+        
+array<char> XATransactionId::getBranchQualifier()
+{
+    return branchQualifier ;
+}
+
+void XATransactionId::setBranchQualifier(array<char> branchQualifier)
+{
+    this->branchQualifier = branchQualifier ;
+}
+
+int XATransactionId::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
+{
+    int size = 0 ;
+
+    size += marshaller->marshalInt(formatId, mode, writer) ; 
+    size += marshaller->marshalByteArray(globalTransactionId, mode, writer) ; 
+    size += marshaller->marshalByteArray(branchQualifier, mode, writer) ; 
+    return size ;
+}
+
+void XATransactionId::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
+{
+    formatId = (marshaller->unmarshalInt(mode, reader)) ; 
+    globalTransactionId = (marshaller->unmarshalByteArray(mode, reader)) ; 
+    branchQualifier = (marshaller->unmarshalByteArray(mode, reader)) ; 
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,90 @@
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ActiveMQ_XATransactionId_hpp_
+#define ActiveMQ_XATransactionId_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include "activemq/command/TransactionId.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace command
+    {
+      using namespace ifr;
+      using namespace std;
+      using namespace apache::activemq;
+      using namespace apache::activemq::protocol;
+      using namespace apache::ppr::io;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for XATransactionId
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class XATransactionId : public TransactionId
+{
+protected:
+    int formatId ;
+    array<char> globalTransactionId ;
+    array<char> branchQualifier ;
+
+public:
+    const static unsigned char TYPE = 112;
+
+public:
+    XATransactionId() ;
+    virtual ~XATransactionId() ;
+
+    virtual unsigned char getDataStructureType() ;
+
+    virtual int getFormatId() ;
+    virtual void setFormatId(int formatId) ;
+
+    virtual array<char> getGlobalTransactionId() ;
+    virtual void setGlobalTransactionId(array<char> globalTransactionId) ;
+
+    virtual array<char> getBranchQualifier() ;
+    virtual void setBranchQualifier(array<char> branchQualifier) ;
+
+    virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+    virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_XATransactionId_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ActiveMQ_IMarshaller_hpp_
+#define ActiveMQ_IMarshaller_hpp_
+
+#include <string>
+#include <map>
+#include "activemq/IDataStructure.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/MapItemHolder.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace protocol
+    {
+      using namespace ifr ;
+      using namespace std ;
+      using namespace apache::activemq;
+      using namespace apache::ppr::io;
+      using namespace apache::ppr::util;
+
+/*
+ * Represents a wire protocol marshaller.
+ */
+struct IMarshaller : Interface
+{
+    // Marshal modes
+    const static int MARSHAL_SIZE  = 1 ;
+    const static int MARSHAL_WRITE = 2 ;
+    const static int MARSHAL_READ  = 3 ;
+
+    virtual int marshalBoolean(bool value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalByte(char value, int mode, p<IOutputStream> writer) throw(IOException) = 0  ;
+    virtual int marshalShort(short value, int mode, p<IOutputStream> writer) throw(IOException) = 0  ;
+    virtual int marshalInt(int value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalLong(long long value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalFloat(float value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalDouble(double value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalString(p<string> value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalObject(p<IDataStructure> object, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalObjectArray(array<IDataStructure> object, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalByteArray(array<char> value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+    virtual int marshalMap(p<PropertyMap> value, int mode, p<IOutputStream> writer) throw(IOException) = 0 ;
+
+    virtual bool unmarshalBoolean(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual char unmarshalByte(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual short unmarshalShort(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual int unmarshalInt(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual long long unmarshalLong(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual float unmarshalFloat(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual double unmarshalDouble(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual p<string> unmarshalString(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual p<IDataStructure> unmarshalObject(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual array<IDataStructure> unmarshalObjectArray(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual array<char> unmarshalByteArray(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+    virtual p<PropertyMap> unmarshalMap(int mode, p<IInputStream> reader) throw(IOException) = 0 ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_IMarshaller_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ActiveMQ_IProtocol_hpp_
+#define ActiveMQ_IProtocol_hpp_
+
+#include "activemq/IDataStructure.hpp"
+#include "activemq/transport/ITransport.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace protocol
+    {
+      using namespace ifr ;
+      using namespace apache::activemq;
+      using namespace apache::activemq::transport;
+      using namespace apache::ppr::io;
+
+/*
+ * Represents the logical protocol layer.
+ */
+struct IProtocol : Interface
+{
+    virtual void handshake(p<ITransport> transport) = 0 ;
+	virtual void marshal(p<IDataStructure> object, p<IOutputStream> writer) throw(IOException) = 0 ;
+	virtual p<IDataStructure> unmarshal(p<IInputStream> reader) throw(IOException) = 0 ;
+} ;
+
+/* namespace */
+    }
+  }
+}
+
+#endif /*ActiveMQ_IProtocol_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,804 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/protocol/openwire/OpenWireMarshaller.hpp"
+
+using namespace apache::activemq::protocol::openwire;
+
+#ifdef MACOSX
+#define BOOLSIZE 1
+#else
+#define BOOLSIZE sizeof(bool)
+#endif
+
+
+// --- Constructors -------------------------------------------------
+
+/*
+ * 
+ */
+OpenWireMarshaller::OpenWireMarshaller(p<WireFormatInfo> formatInfo)
+{
+    this->formatInfo = formatInfo ;
+}
+
+// --- Operation methods --------------------------------------------
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalBoolean(bool value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeBoolean(value) ;
+
+        return (int)BOOLSIZE ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalByte(char value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeByte(value) ;
+
+        return (int)sizeof(char) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalShort(short value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeShort(value) ;
+
+        return (int)sizeof(short) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalInt(int value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeInt(value) ;
+
+        return (int)sizeof(int) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalLong(long long value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeLong(value) ;
+
+        return (int)sizeof(long long) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalFloat(float value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeFloat(value) ;
+
+        return (int)sizeof(float) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalDouble(double value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+            writer->writeDouble(value) ;
+
+        return (int)sizeof(double) ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalString(p<string> value, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( mode == IMarshaller::MARSHAL_WRITE )
+        {
+            writer->writeBoolean( value != NULL ) ; 
+            writer->writeString(value) ;
+        }
+        int size = 0 ;
+
+        // Null marker
+        size += BOOLSIZE ;
+
+        if( value != NULL )
+        {
+            // String char counter and length
+            size += sizeof(short) ;
+            size += (int)value->length() ;
+        }
+        return size ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalObject(p<IDataStructure> object, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        int size = 0 ;
+
+        // Write data structure type
+        if( mode == IMarshaller::MARSHAL_WRITE )
+        {
+            // Null marker
+            writer->writeBoolean( object != NULL ) ;
+
+            // Data structure type
+            if( object != NULL )
+                writer->writeByte( object->getDataStructureType() ) ;
+        }
+
+        // Length of null marker
+        size += BOOLSIZE ;
+
+        if( object != NULL )
+        {
+            // Length of data structure type
+            size += sizeof(char) ;
+
+            // Marshal the command body
+            size += object->marshal(smartify(this), mode, writer) ;
+        }
+        return size ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalObjectArray(array<IDataStructure> objects, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        int size = 0 ;
+
+        // Write length of array
+        if( mode == IMarshaller::MARSHAL_WRITE )
+        {
+            // Null object marker
+            writer->writeBoolean( objects != NULL ) ;
+
+            // Check for NULL array
+            if( objects != NULL )
+                writer->writeShort( (short)objects.size() ) ;
+            else
+                return BOOLSIZE ;
+        }
+        // Check for NULL array
+        if( objects == NULL )
+            return BOOLSIZE ;
+
+        // Add size for null marker and array length
+        size += BOOLSIZE ;
+        size += sizeof(short) ;
+
+        // Write/measure each object in array
+        for( int i = 0; i < (int)objects.size(); i++ )
+            size += objects[i]->marshal(smartify(this), mode, writer) ;
+
+        return size ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalByteArray(array<char> values, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        int size = 0 ;
+
+        // Write length/content of array
+        if( mode == IMarshaller::MARSHAL_WRITE )
+        {
+            // Null marker
+            writer->writeBoolean( values != NULL ) ;
+
+            // Check for NULL array
+            if( values != NULL )
+            {
+                // Array length
+                int length = (int)values.size() ;
+
+                // Length and content
+                writer->writeInt( length ) ;
+                writer->write( values.c_array(), 0, length) ;
+            }
+        }
+        // Check for NULL array
+        if( values == NULL )
+            return BOOLSIZE ;
+
+        // Add size for null marker, array length and content
+        size += BOOLSIZE ;
+        size += sizeof(int) ;
+        size += (int)values.size() ;
+
+        return size ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::marshalMap(p<PropertyMap> object, int mode, p<IOutputStream> writer) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        int size = 0 ;
+
+        // Check for NULL map
+        if( object == NULL )
+            return sizeof(int) ;
+
+        PropertyMap::iterator tempIter ;
+        string        key ;
+        MapItemHolder val ;
+
+        // Add size for map item count
+        size += sizeof(int) ;
+
+        // Calculate size of map
+        if( mode == IMarshaller::MARSHAL_SIZE )
+        {
+            // Loop through map contents
+            for( tempIter = object->begin() ;
+                tempIter != object->end() ;
+                tempIter++ )
+            {
+                array<char> buffer ;
+
+                // Extract key-value
+                key = tempIter->first ;
+                val = tempIter->second ;
+
+                // Add size for key char count, lenght of key and value type
+                size += sizeof(short) ;
+                size += (int)key.length() ;
+                size += sizeof(unsigned char) ;
+
+                // Write the map value
+                switch( val.getType() )
+                {
+                    case MapItemHolder::BOOLEAN:
+                        size += BOOLSIZE ;
+                        break ;
+                    case MapItemHolder::BYTE:
+                        size += sizeof(char) ;
+                        break ;
+                    case MapItemHolder::BYTEARRAY:
+                        buffer = val.getBytes() ;
+                        size += (int)buffer.size() ;
+                        break ;
+                    case MapItemHolder::DOUBLE:
+                        size += sizeof(double) ;
+                        break ;
+                    case MapItemHolder::FLOAT:
+                        size += sizeof(float) ;
+                        break ;
+                    case MapItemHolder::INTEGER:
+                        size += sizeof(int) ;
+                        break ;
+                    case MapItemHolder::LONG:
+                        size += sizeof(long) ;
+                        break ;
+                    case MapItemHolder::SHORT:
+                        size += sizeof(short) ;
+                        break ;
+                    default:
+                        size += (int)val.getString()->size() ;
+                }
+            }
+        }
+
+        // Write size/content of map
+        else if( mode == IMarshaller::MARSHAL_WRITE )
+        {
+            // Write 'null' marker
+            if( object == NULL )
+            {
+                writer->writeInt(-1) ;
+                return size ;
+            }
+
+            // Write map item count
+            writer->writeInt( (int)object->size()) ;
+
+            // Loop through map contents
+            for( tempIter = object->begin() ;
+                tempIter != object->end() ;
+                tempIter++ )
+            {
+                array<char> buffer ;
+
+                // Extract key-value
+                key = tempIter->first ;
+                val = tempIter->second ;
+
+                // Add size for key char count, lenght of key and value type
+                size += sizeof(short) ;
+                size += (int)key.length() ;
+                size += sizeof(unsigned char) ;
+
+                // Write the map key
+                writer->writeString( p<string>( new string(tempIter->first) ) ) ;
+
+                // Write the map value
+                switch( val.getType() )
+                {
+                    case MapItemHolder::BOOLEAN:
+                        writer->writeByte( TYPE_BOOLEAN ) ;
+                        writer->writeBoolean( val.getBoolean() ) ;
+                        size += BOOLSIZE ;
+                        break ;
+                    case MapItemHolder::BYTE:
+                        writer->writeByte( TYPE_BYTE ) ;
+                        writer->writeByte( val.getByte() ) ;
+                        size += sizeof(char) ;
+                        break ;
+                    case MapItemHolder::BYTEARRAY:
+                        writer->writeByte( TYPE_BYTEARRAY ) ;
+                        buffer = val.getBytes() ;
+                        writer->writeInt( (int)buffer.size() ) ;
+                        writer->write(buffer.c_array(), 0, (int)buffer.size()) ;
+                        size += (int)buffer.size() ;
+                        break ;
+                    case MapItemHolder::DOUBLE:
+                        writer->writeByte( TYPE_DOUBLE ) ;
+                        writer->writeDouble( val.getDouble() ) ;
+                        size += sizeof(double) ;
+                        break ;
+                    case MapItemHolder::FLOAT:
+                        writer->writeByte( TYPE_FLOAT ) ;
+                        writer->writeFloat( val.getFloat() ) ;
+                        size += sizeof(float) ;
+                        break ;
+                    case MapItemHolder::INTEGER:
+                        writer->writeByte( TYPE_INTEGER ) ;
+                        writer->writeInt( val.getInt() ) ;
+                        size += sizeof(int) ;
+                        break ;
+                    case MapItemHolder::LONG:
+                        writer->writeByte( TYPE_LONG ) ;
+                        writer->writeLong( val.getLong() ) ;
+                        size += sizeof(long) ;
+                        break ;
+                    case MapItemHolder::SHORT:
+                        writer->writeByte( TYPE_SHORT ) ;
+                        writer->writeShort( val.getShort() ) ;
+                        size += sizeof(short) ;
+                        break ;
+                    case MapItemHolder::STRING:
+                        writer->writeByte( TYPE_STRING ) ;
+                        writer->writeString( val.getString() ) ;
+                        size += (int)val.getString()->size() ;
+                        break ;
+                    default:
+                        writer->writeByte( TYPE_NULL ) ;
+                }
+            }
+        }
+        return size ;
+    }
+    else
+    {
+        // Not yet implemented (tight marshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+bool OpenWireMarshaller::unmarshalBoolean(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readBoolean() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+char OpenWireMarshaller::unmarshalByte(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readByte() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+/*
+ * 
+ */
+short OpenWireMarshaller::unmarshalShort(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readShort() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+int OpenWireMarshaller::unmarshalInt(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readInt() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+long long OpenWireMarshaller::unmarshalLong(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readLong() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+float OpenWireMarshaller::unmarshalFloat(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readFloat() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+double OpenWireMarshaller::unmarshalDouble(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        return reader->readFloat() ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return 0 ;
+}
+
+/*
+ * 
+ */
+p<string> OpenWireMarshaller::unmarshalString(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        if( reader->readBoolean() )
+            return reader->readString() ;
+        else
+            return NULL ;
+    }
+    else
+    {
+        // Not yet implemented (loose unmarshalling)
+    }
+    return NULL ;
+}
+
+/*
+ * 
+ */
+p<IDataStructure> OpenWireMarshaller::unmarshalObject(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        // Null marker
+        if( !reader->readBoolean() )
+            return NULL ;
+
+        // Read data structure
+        unsigned char dataType = reader->readByte() ;
+
+        // Create command object
+        p<IDataStructure> object = AbstractCommand::createObject(dataType) ;
+        if( object == NULL )
+            throw IOException("Unmarshal failed; unknown data structure type %d, at %s line %d", dataType, __FILE__, __LINE__) ;
+
+        // Finally, unmarshal command body
+        object->unmarshal(smartify(this), IMarshaller::MARSHAL_READ, reader) ;
+        return object ;
+    }
+    else
+    {
+        // Not yet implemented (tight unmarshalling)
+    }
+    return NULL ;
+}
+
+/*
+ * 
+ */
+array<IDataStructure> OpenWireMarshaller::unmarshalObjectArray(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        // Null marker
+        if( !reader->readBoolean() )
+            return NULL ;
+
+        int length = reader->readShort() ;
+
+        // Check for NULL array
+        if( length == 0 )
+        {
+            return NULL;
+        }
+
+        // Create array
+        array<IDataStructure> objects (length) ;
+
+        // Unmarshal each item in array
+        for( int i = 0 ; i < length ; i++ )
+            objects[i] = unmarshalObject(mode, reader) ;
+
+        return objects ;
+    }
+    else
+    {
+        // Not yet implemented (loose unmarshalling)
+    }
+    return NULL;
+}
+
+/*
+ * 
+ */
+array<char> OpenWireMarshaller::unmarshalByteArray(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        // Null marker
+        if( !reader->readBoolean() )
+            return NULL ;
+
+        int length = reader->readInt() ;
+
+        // Check for NULL array
+        if( length == 0 )
+            return NULL ;
+
+        // Create array
+        array<char> value (length);
+
+        // Unmarshal all bytes in array
+        reader->read(value.c_array(), 0, length) ;
+
+        return value ;
+    }
+    else
+    {
+        // Not yet implemented (loose unmarshalling)
+    }
+    return NULL ;
+}
+
+/*
+ * 
+ */
+p<PropertyMap> OpenWireMarshaller::unmarshalMap(int mode, p<IInputStream> reader) throw(IOException)
+{
+    if( !formatInfo->getTightEncodingEnabled() )
+    {
+        // Get size of map
+        int size = reader->readInt() ;
+
+        // Check for NULL map
+        if( size < 0 )
+            return NULL ;
+
+        // Create map
+        p<PropertyMap> object = new PropertyMap() ;
+        p<string>      key ;
+        MapItemHolder  val ;
+        array<char>    buffer ;
+        unsigned char  type ;
+        int            length ;
+
+        // Loop through and read all key-values
+        for( int i = 0 ; i < size ; i++ )
+        {
+            // Get next key
+            key = reader->readString() ;
+            
+            // Get the primitive type
+            type = reader->readByte() ;
+
+            // Depending on type read next value
+            switch( type )
+            {
+                case TYPE_BOOLEAN:
+                    val = MapItemHolder( reader->readBoolean() ) ;
+                    break ;
+                case TYPE_BYTE:
+                    val = MapItemHolder( reader->readByte() ) ;
+                    break ;
+                case TYPE_BYTEARRAY:
+                    length = reader->readInt() ;
+                    buffer = array<char> (length) ;
+                    reader->read(buffer.c_array(), 0, length) ;
+                    val = MapItemHolder( buffer ) ;
+                    break ;
+                case TYPE_DOUBLE:
+                    val = MapItemHolder( reader->readDouble() ) ;
+                    break ;
+                case TYPE_FLOAT:
+                    val = MapItemHolder( reader->readFloat() ) ;
+                    break ;
+                case TYPE_INTEGER:
+                    val = MapItemHolder( reader->readInt() ) ;
+                    break ;
+                case TYPE_LONG:
+                    val = MapItemHolder( reader->readLong() ) ;
+                    break ;
+                case TYPE_SHORT:
+                    val = MapItemHolder( reader->readShort() ) ;
+                    break ;
+                case TYPE_STRING:
+                    val = MapItemHolder( reader->readString() ) ;
+                    break ;
+                default:
+                    val = MapItemHolder() ;
+            }
+            // Insert value into property map
+            (*object)[key->c_str()] = val ;
+        }
+        return object ;
+    }
+    else
+    {
+        // Not yet implemented (loose unmarshalling)
+    }
+    return NULL;
+}

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ActiveMQ_OpenWireMarshaller_hpp_
+#define ActiveMQ_OpenWireMarshaller_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <string>
+#include <map>
+#include "activemq/IDataStructure.hpp"
+#include "activemq/command/AbstractCommand.hpp"
+#include "activemq/command/WireFormatInfo.hpp"
+#include "activemq/protocol/IMarshaller.hpp"
+#include "activemq/protocol/openwire/OpenWireProtocol.hpp"
+#include "ppr/io/DataOutputStream.hpp"
+#include "ppr/io/DataInputStream.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/MapItemHolder.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace protocol
+    {
+      namespace openwire
+      {
+        using namespace ifr ;
+        using namespace apache::activemq;
+        using namespace apache::activemq::command;
+        using namespace apache::activemq::protocol;
+        using namespace apache::ppr::io;
+        using namespace apache::ppr::util;
+
+/*
+ * A helper class with marshalling methods for the OpenWire protocol.
+ */
+class OpenWireMarshaller : public IMarshaller
+{
+private:
+    p<WireFormatInfo> formatInfo ;
+
+public:
+    // Primitive types
+    static const unsigned char TYPE_NULL      = 0 ;
+    static const unsigned char TYPE_BOOLEAN   = 1 ;
+    static const unsigned char TYPE_BYTE      = 2 ;
+    static const unsigned char TYPE_CHAR      = 3 ;
+    static const unsigned char TYPE_SHORT     = 4 ;
+    static const unsigned char TYPE_INTEGER   = 5 ;
+    static const unsigned char TYPE_LONG      = 6 ;
+    static const unsigned char TYPE_DOUBLE    = 7 ;
+    static const unsigned char TYPE_FLOAT     = 8 ;
+    static const unsigned char TYPE_STRING    = 9 ;
+    static const unsigned char TYPE_BYTEARRAY = 10 ;
+
+public:
+    OpenWireMarshaller(p<WireFormatInfo> formatInfo) ;
+
+    virtual int marshalBoolean(bool value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalByte(char value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalShort(short value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalInt(int value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalLong(long long value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalFloat(float value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalDouble(double value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalString(p<string> value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalObject(p<IDataStructure> object, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalObjectArray(array<IDataStructure> object, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalByteArray(array<char> value, int mode, p<IOutputStream> writer) throw(IOException) ;
+    virtual int marshalMap(p<PropertyMap> value, int mode, p<IOutputStream> writer) throw(IOException) ;
+
+    virtual bool unmarshalBoolean(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual char unmarshalByte(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual short unmarshalShort(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual int unmarshalInt(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual long long unmarshalLong(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual float unmarshalFloat(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual double unmarshalDouble(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual p<string> unmarshalString(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual p<IDataStructure> unmarshalObject(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual array<IDataStructure> unmarshalObjectArray(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual array<char> unmarshalByteArray(int mode, p<IInputStream> reader) throw(IOException) ;
+    virtual p<PropertyMap> unmarshalMap(int mode, p<IInputStream> reader) throw(IOException) ;
+} ;
+
+/* namespace */
+      }
+    }
+  }
+}
+
+#endif /*ActiveMQ_OpenWireMarshaller_hpp_*/

Added: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp?rev=397654&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp (added)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp Thu Apr 27 14:59:28 2006
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/protocol/openwire/OpenWireProtocol.hpp"
+#include "activemq/protocol/openwire/OpenWireMarshaller.hpp"
+
+using namespace apache::activemq::protocol::openwire;
+
+// --- Static initialization ----------------------------------------
+
+const char OpenWireProtocol::MAGIC[8]         = { 'A', 'c', 't', 'i', 'v', 'e', 'M', 'Q' } ;
+const int  OpenWireProtocol::PROTOCOL_VERSION = 1 ;
+const char OpenWireProtocol::NULL_TYPE        = 0 ;
+
+
+/*
+ * 
+ */
+OpenWireProtocol::OpenWireProtocol()
+{
+    array<char> magic (8);
+    memcpy (magic.c_array(), "ActiveMQ", 8);
+
+    // Create and configure wire format
+    wireFormatInfo = new WireFormatInfo() ;
+    wireFormatInfo->setMagic( magic ) ;
+    wireFormatInfo->setVersion( PROTOCOL_VERSION ) ;
+    wireFormatInfo->setStackTraceEnabled(true) ;
+    wireFormatInfo->setTcpNoDelayEnabled(true) ;
+    wireFormatInfo->setSizePrefixDisabled(false) ;
+    wireFormatInfo->setTightEncodingEnabled(false) ;
+
+    // Create wire marshaller
+    wireMarshaller = new OpenWireMarshaller(wireFormatInfo) ;
+}
+
+/*
+ * 
+ */
+p<WireFormatInfo> OpenWireProtocol::getWireFormatInfo()
+{
+    return wireFormatInfo ;
+}
+
+/*
+ * 
+ */
+bool OpenWireProtocol::getStackTraceEnabled()
+{
+    return wireFormatInfo->getStackTraceEnabled() ;
+}
+
+/*
+ * 
+ */
+void OpenWireProtocol::handshake(p<ITransport> transport)
+{
+    // Send the wireformat we're using
+    transport->oneway( getWireFormatInfo() ) ;
+}
+
+/*
+ * 
+ */
+void OpenWireProtocol::marshal(p<IDataStructure> object, p<IOutputStream> writer) throw(IOException)
+{
+    int size = 0 ;
+
+    // Was a non-NULL object supplied
+    if( object != NULL )
+    {
+        unsigned char dataType = object->getDataStructureType() ;
+
+        // Calculate size to be marshalled if configured
+        if( !wireFormatInfo->getSizePrefixDisabled() )
+        {
+            size  = 1 ; // data structure type
+            size += object->marshal(wireMarshaller, IMarshaller::MARSHAL_SIZE, writer) ;
+
+            // Write size header
+            writer->writeInt(size) ;
+        }
+        // Finally, write command type and body
+        writer->writeByte(dataType) ;
+        object->marshal(wireMarshaller, IMarshaller::MARSHAL_WRITE, writer) ;
+    }
+    else   // ...NULL object
+    {
+        // Calculate size to be marshalled if configured
+        if( !wireFormatInfo->getSizePrefixDisabled() )
+        {
+            // Calculate size to be marshalled
+            size = 1 ; // data structure type
+
+            // Write size header
+            writer->writeInt(size) ;
+        }
+        // Write NULL command type and empty body
+        writer->writeByte(NULL_TYPE) ;
+    }
+}
+
+/*
+ * 
+ */
+p<IDataStructure> OpenWireProtocol::unmarshal(p<IInputStream> reader) throw(IOException)
+{
+    int size = 0 ;
+
+    // Read packet size if configured
+    if( !wireFormatInfo->getSizePrefixDisabled() )
+        size = reader->readInt() ;
+
+    // First byte is the data structure type
+    unsigned char dataType = reader->readByte() ;
+
+    // Check for NULL type
+    if( dataType == NULL_TYPE )
+        return NULL ;
+
+    // Create command object
+    p<IDataStructure> object = AbstractCommand::createObject(dataType) ;
+    if( object == NULL )
+        throw IOException("Unmarshal failed; unknown data structure type %d, at %s line %d", dataType, __FILE__, __LINE__) ;
+
+    // Finally, unmarshal command body
+    object->unmarshal(wireMarshaller, IMarshaller::MARSHAL_READ, reader) ;
+    return object ;
+}