You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2006/07/31 11:36:51 UTC
svn commit: r427057 [17/22] - in /incubator/activemq/trunk/amazon: ./
amq_brokersession/ amq_corelib/ amq_examples/ amq_examples/bs_async_recv/
amq_examples/bs_send/ amq_examples/bs_sync_recv/ amq_examples/cl_send/
amq_transport/ command/ marshal/
Added: incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BaseCommandMarshaller_h_
+#define BaseCommandMarshaller_h_
+
+#include <string>
+#include <memory>
+
+#include "command/IDataStructure.h"
+
+/* auto-generated! */
+/* we could cut this down - for now include all possible headers */
+#include "command/BrokerId.h"
+#include "command/ConnectionId.h"
+#include "command/ConsumerId.h"
+#include "command/ProducerId.h"
+#include "command/SessionId.h"
+#include "command/BaseCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+
+#include "marshal/BaseDataStreamMarshaller.h"
+
+#include "marshal/ProtocolFormat.h"
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ class BaseCommandMarshaller : public BaseDataStreamMarshaller
+ {
+ public:
+ BaseCommandMarshaller();
+ virtual ~BaseCommandMarshaller();
+
+ virtual auto_ptr<ActiveMQ::Command::IDataStructure> createCommand() = 0;
+ virtual char getDataStructureType() = 0;
+
+ virtual void unmarshal(ProtocolFormat& wireFormat,
+ ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual size_t marshal1(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual void marshal2(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut,
+ ActiveMQ::IO::BooleanStream& bs);
+ };
+ }
+}
+#endif /*BaseCommandMarshaller_h_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BaseCommandMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,442 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "marshal/BaseDataStreamMarshaller.h"
+#include "marshal/BrokerIdMarshaller.h"
+#include "marshal/BrokerInfoMarshaller.h"
+#include "command/AbstractCommand.h"
+
+#include "command/BrokerId.h"
+#include "command/BrokerInfo.h"
+#include "command/IDataStructure.h"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+shared_ptr<BrokerError>
+BaseDataStreamMarshaller::unmarshalBrokerError(ProtocolFormat& wireFormat,
+ BinaryReader& dataIn,
+ BooleanStream& bs) {
+ return shared_ptr<BrokerError>();
+}
+
+auto_ptr<IDataStructure>
+BaseDataStreamMarshaller::unmarshalCachedObject(ProtocolFormat& wireFormat,
+ BinaryReader& dataIn,
+ BooleanStream& bs) {
+ return unmarshalNestedObject(wireFormat, dataIn, bs);
+}
+
+auto_ptr<IDataStructure>
+BaseDataStreamMarshaller::unmarshalNestedObject(ProtocolFormat& wireFormat,
+ BinaryReader& dataIn,
+ BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ unsigned char type = dataIn.readByte();
+ BaseDataStreamMarshaller *marsh = wireFormat.getMarshaller(type);
+ if (marsh == NULL)
+ return auto_ptr<IDataStructure>(NULL);
+
+ auto_ptr<IDataStructure> ret(marsh->createCommand());
+ BaseCommand *test = dynamic_cast<BaseCommand*>(ret.get());
+ if (test && test->isMarshalAware())
+ bs.readBoolean(); // don't care what this is; should always be false since we don't do caching
+ marsh->unmarshal(wireFormat,
+ *ret,
+ dataIn,
+ bs);
+ return ret;
+ }
+ else
+ return auto_ptr<IDataStructure>(NULL);
+}
+
+size_t
+BaseDataStreamMarshaller::marshal1BrokerError(ProtocolFormat& wireFormat,
+ const shared_ptr<const BrokerError>& o,
+ BooleanStream& bs) {
+ return 0;
+}
+
+void
+BaseDataStreamMarshaller::marshal2BrokerError(ProtocolFormat& wireFormat,
+ const shared_ptr<const BrokerError>& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+}
+
+size_t
+BaseDataStreamMarshaller::marshal1CachedObject(ProtocolFormat& wireFormat,
+ const AbstractCommand& o,
+ BooleanStream& bs) {
+
+ return marshal1NestedObject(wireFormat, o, bs);
+}
+
+void
+BaseDataStreamMarshaller::marshal2CachedObject(ProtocolFormat& wireFormat,
+ const AbstractCommand& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ marshal2NestedObject(wireFormat, o, dataOut, bs);
+}
+
+size_t
+BaseDataStreamMarshaller::marshal1NestedObject(ProtocolFormat& wireFormat,
+ const AbstractCommand& o,
+ BooleanStream& bs) {
+ bs.writeBoolean(true);
+ return 1 + wireFormat.getMarshaller(o.getCommandType())->marshal1(wireFormat,
+ o,
+ bs);
+}
+
+void
+BaseDataStreamMarshaller::marshal2NestedObject(ProtocolFormat& wireFormat,
+ const AbstractCommand& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ unsigned char type = o.getCommandType();
+ dataOut.write(&type, 1);
+
+ wireFormat.getMarshaller(type)->marshal2(wireFormat,
+ o,
+ dataOut,
+ bs);
+ }
+}
+
+
+size_t
+BaseDataStreamMarshaller::marshal1CachedObject(ProtocolFormat& wireFormat,
+ const shared_ptr<const IDataStructure>& o,
+ BooleanStream& bs) {
+
+ return marshal1NestedObject(wireFormat, o, bs);
+}
+
+void
+BaseDataStreamMarshaller::marshal2CachedObject(ProtocolFormat& wireFormat,
+ const shared_ptr<const IDataStructure>& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ marshal2NestedObject(wireFormat, o, dataOut, bs);
+}
+
+size_t
+BaseDataStreamMarshaller::marshal1NestedObject(ProtocolFormat& wireFormat,
+ const shared_ptr<const IDataStructure>& o,
+ BooleanStream& bs) {
+
+ bs.writeBoolean(o != NULL);
+ if (o != NULL) {
+ return 1 + wireFormat.getMarshaller(o->getCommandType())->marshal1(wireFormat,
+ *o,
+ bs);
+ }
+
+ return 0;
+}
+
+void
+BaseDataStreamMarshaller::marshal2NestedObject(ProtocolFormat& wireFormat,
+ const shared_ptr<const IDataStructure>& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ if (bs.readBoolean()) {
+ unsigned char type = o->getCommandType();
+ dataOut.write(&type, 1);
+ wireFormat.getMarshaller(type)->marshal2(wireFormat,
+ *o,
+ dataOut,
+ bs);
+ }
+}
+
+
+size_t
+BaseDataStreamMarshaller::marshal1CachedObject(ProtocolFormat& wireFormat,
+ const IDataStructure& o,
+ BooleanStream& bs) {
+ return marshal1NestedObject(wireFormat, o, bs);
+}
+
+void
+BaseDataStreamMarshaller::marshal2CachedObject(ProtocolFormat& wireFormat,
+ const IDataStructure& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ marshal2NestedObject(wireFormat, o, dataOut, bs);
+}
+
+size_t
+BaseDataStreamMarshaller::marshal1NestedObject(ProtocolFormat& wireFormat,
+ const IDataStructure& o,
+ BooleanStream& bs) {
+ return marshal1NestedObject(wireFormat, o, bs);
+}
+
+void
+BaseDataStreamMarshaller::marshal2NestedObject(ProtocolFormat& wireFormat,
+ const IDataStructure& o,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+ marshal2NestedObject(wireFormat, o, dataOut, bs);
+}
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ template<>
+ void
+ BaseDataStreamMarshaller::marshal2ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const BrokerId> >& arr,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ dataOut.writeShort(arr.size());
+ for (vector<shared_ptr<const BrokerId> >::const_iterator i = arr.begin();
+ i != arr.end();
+ ++i)
+ marshal2NestedObject(wireFormat,
+ *i,
+ dataOut,
+ bs);
+ }
+ }
+
+ template<>
+ void
+ BaseDataStreamMarshaller::marshal2ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const IDataStructure> >& arr,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ if (bs.readBoolean()) {
+ dataOut.writeShort(arr.size());
+ for (vector<shared_ptr<const IDataStructure> >::const_iterator i = arr.begin();
+ i != arr.end();
+ ++i)
+ marshal2NestedObject(wireFormat,
+ *i,
+ dataOut,
+ bs);
+ }
+ }
+
+ template<>
+ void
+ BaseDataStreamMarshaller::marshal2ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const BrokerInfo> >& arr,
+ BinaryWriter& dataOut,
+ BooleanStream& bs) {
+
+ if (bs.readBoolean()) {
+ dataOut.writeShort(arr.size());
+ for (vector<shared_ptr<const BrokerInfo> >::const_iterator i = arr.begin();
+ i != arr.end();
+ ++i)
+ marshal2NestedObject(wireFormat,
+ *i,
+ dataOut,
+ bs);
+ }
+ }
+
+ template<>
+ size_t
+ BaseDataStreamMarshaller::marshal1ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const BrokerId> >& arr,
+ BooleanStream& bs) {
+
+ unsigned int ret = 0;
+ if (!arr.empty()) {
+ bs.writeBoolean(true);
+ ret += 2;
+
+ for (vector<shared_ptr<const BrokerId> >::const_iterator i = arr.begin();
+ i != arr.end(); ++i) {
+ ret += marshal1NestedObject(wireFormat, *i, bs);
+ }
+ }
+ else
+ bs.writeBoolean(false);
+
+ return ret;
+ }
+
+ template<>
+ size_t
+ BaseDataStreamMarshaller::marshal1ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const IDataStructure> >& arr,
+ BooleanStream& bs) {
+
+ return 0;
+ }
+
+ template<>
+ size_t
+ BaseDataStreamMarshaller::marshal1ObjectArray(ProtocolFormat& wireFormat,
+ const vector<shared_ptr<const BrokerInfo> >& arr,
+ BooleanStream& bs) {
+
+
+ unsigned int ret = 0;
+ if (!arr.empty()) {
+ bs.writeBoolean(true);
+ ret += 2;
+
+ for (vector<shared_ptr<const BrokerInfo> >::const_iterator i = arr.begin();
+ i != arr.end(); ++i) {
+ ret += marshal1NestedObject(wireFormat, *(*i), bs);
+ }
+ }
+ else
+ bs.writeBoolean(false);
+
+ return ret;
+ }
+
+ };
+};
+
+int64_t
+BaseDataStreamMarshaller::unmarshalLong(ProtocolFormat& wireFormat, BinaryReader& dataIn, BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ if (bs.readBoolean()) {
+ return dataIn.readLong();
+ }
+ else {
+ return (int64_t)dataIn.readInt();
+ }
+ }
+ else {
+ if (bs.readBoolean()) {
+ return (int64_t)dataIn.readShort();
+ }
+ else
+ return 0;
+ }
+}
+
+size_t
+BaseDataStreamMarshaller::writeLong1(int64_t o, BooleanStream& bs) {
+ if( o == 0 ) {
+ bs.writeBoolean(false);
+ bs.writeBoolean(false);
+ return 0;
+ } else if ( (o & 0xFFFFFFFFFFFF0000LL ) == 0 ) {
+ bs.writeBoolean(false);
+ bs.writeBoolean(true);
+ return 2;
+ } else if ( (o & 0xFFFFFFFF00000000LL ) == 0) {
+ bs.writeBoolean(true);
+ bs.writeBoolean(false);
+ return 4;
+ } else {
+ bs.writeBoolean(true);
+ bs.writeBoolean(true);
+ return 8;
+ }
+}
+
+void
+BaseDataStreamMarshaller::writeLong2(int64_t o, BinaryWriter& dataOut, BooleanStream& bs) {
+ if( bs.readBoolean() ) {
+ if( bs.readBoolean() ) {
+ dataOut.writeLong(o);
+ } else {
+ dataOut.writeInt((int) o);
+ }
+ } else {
+ if( bs.readBoolean() ) {
+ dataOut.writeShort((int) o);
+ }
+ }
+}
+
+size_t
+BaseDataStreamMarshaller::writeString1(const std::string& str, BooleanStream& bs) {
+ size_t rc = 0;
+
+ if (!str.empty()) {
+ bs.writeBoolean(true);
+ rc += 2;
+ rc += str.length();
+ bs.writeBoolean(true);
+ }
+ else
+ bs.writeBoolean(false);
+ return rc;
+}
+
+void
+BaseDataStreamMarshaller::writeString2(const std::string& str, BinaryWriter& dataOut,
+ BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ if (bs.readBoolean()) {
+ dataOut.writeString(str);
+ }
+ }
+}
+
+vector<uint8_t>
+BaseDataStreamMarshaller::unmarshalConstByteSequence(ProtocolFormat& wf,
+ BinaryReader& dataIn,
+ BooleanStream& bs,
+ size_t num) {
+ vector<uint8_t> ret;
+ ret.resize(num);
+ dataIn.read(&(ret[0]), num);
+ return ret;
+}
+
+vector<uint8_t>
+BaseDataStreamMarshaller::unmarshalByteSequence(ProtocolFormat& wf,
+ BinaryReader& dataIn,
+ BooleanStream& bs) {
+ vector<uint8_t> ret;
+ if (bs.readBoolean()) {
+ int size = dataIn.readInt();
+ ret.resize(size);
+ dataIn.read(&(ret[0]), size);
+ }
+ return ret;
+}
+
+std::string
+BaseDataStreamMarshaller::unmarshalString(ProtocolFormat& wireFormat,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs) {
+ if (bs.readBoolean()) {
+ bs.readBoolean(); // don't care about UTFness for now
+ return dataIn.readString();
+ }
+ else
+ return "";
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,138 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BaseDataStreamMarshaller_hpp_
+#define BaseDataStreamMarshaller_hpp_
+
+#include "command/IDataStructure.h"
+#include "command/BrokerError.h"
+#include "command/AbstractCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+#include "marshal/BooleanStream.h"
+
+#include <inttypes.h>
+
+#include <exception>
+#include <iostream>
+#include <memory>
+#include <boost/shared_ptr.hpp>
+
+using namespace std;
+
+namespace ActiveMQ {
+ namespace Marshalling {
+ class ProtocolFormat;
+
+ class BaseDataStreamMarshaller
+ {
+ public:
+ BaseDataStreamMarshaller() {};
+ virtual ~BaseDataStreamMarshaller() {};
+
+ virtual std::auto_ptr<ActiveMQ::Command::IDataStructure> createCommand() = 0;
+ virtual char getDataStructureType() = 0;
+
+ virtual void unmarshal(ProtocolFormat& wireFormat, ActiveMQ::Command::IDataStructure& o, ActiveMQ::IO::BinaryReader& dataIn, ActiveMQ::IO::BooleanStream& bs) = 0;
+ virtual size_t marshal1(ProtocolFormat& wireFormat, const ActiveMQ::Command::IDataStructure& o, ActiveMQ::IO::BooleanStream& bs) = 0;
+ virtual void marshal2(ProtocolFormat& wireFormat, const ActiveMQ::Command::IDataStructure& o, ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs) = 0;
+
+ static std::string unmarshalString(ProtocolFormat& wireFormat,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t writeString1(const std::string& str, ActiveMQ::IO::BooleanStream& bs);
+ static void writeString2(const std::string& str, ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static int64_t unmarshalLong(ProtocolFormat& wireFormat, ActiveMQ::IO::BinaryReader& dataIn, ActiveMQ::IO::BooleanStream& bs);
+ static size_t writeLong1(int64_t i, ActiveMQ::IO::BooleanStream& bs);
+ static void writeLong2(int64_t i, ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static std::auto_ptr<ActiveMQ::Command::IDataStructure> unmarshalCachedObject(ProtocolFormat& wireFormat, ActiveMQ::IO::BinaryReader& dataIn, ActiveMQ::IO::BooleanStream& bs);
+ static std::auto_ptr<ActiveMQ::Command::IDataStructure> unmarshalNestedObject(ProtocolFormat& wireFormat, ActiveMQ::IO::BinaryReader& dataIn, ActiveMQ::IO::BooleanStream& bs);
+ static size_t marshal1BrokerError(ProtocolFormat& wireFormat, const boost::shared_ptr<const ActiveMQ::Command::BrokerError>& be, ActiveMQ::IO::BooleanStream& bs);
+ static void marshal2BrokerError(ProtocolFormat& wireFormat, const boost::shared_ptr<const ActiveMQ::Command::BrokerError>& be, ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+ static boost::shared_ptr<ActiveMQ::Command::BrokerError> unmarshalBrokerError(ProtocolFormat& wireFormat, ActiveMQ::IO::BinaryReader& dataIn, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1CachedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::AbstractCommand& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2CachedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::AbstractCommand& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1NestedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::AbstractCommand& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2NestedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::AbstractCommand& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1CachedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2CachedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1NestedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2NestedObject(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1CachedObject(ProtocolFormat& wireFormat,
+ const boost::shared_ptr<const ActiveMQ::Command::IDataStructure>& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2CachedObject(ProtocolFormat& wireFormat,
+ const boost::shared_ptr<const ActiveMQ::Command::IDataStructure>& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static size_t marshal1NestedObject(ProtocolFormat& wireFormat,
+ const boost::shared_ptr<const ActiveMQ::Command::IDataStructure>& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ static void marshal2NestedObject(ProtocolFormat& wireFormat,
+ const boost::shared_ptr<const ActiveMQ::Command::IDataStructure>& o,
+ ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ template<class T> size_t marshal1ObjectArray(ProtocolFormat& wireFormat, const std::vector<boost::shared_ptr<T> >& arr, ActiveMQ::IO::BooleanStream& bs);
+ template<class T> void marshal2ObjectArray(ProtocolFormat& wireFormat, const std::vector<boost::shared_ptr<T> >& arr, ActiveMQ::IO::BinaryWriter& dataOut, ActiveMQ::IO::BooleanStream& bs);
+
+ static std::vector<uint8_t> unmarshalConstByteSequence(ProtocolFormat& wireFormat,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs,
+ size_t num);
+
+ static std::vector<uint8_t> unmarshalByteSequence(ProtocolFormat& wireFormat,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ };
+ }
+}
+
+#endif /*BaseDataStreamMarshaller_hpp_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BaseDataStreamMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,107 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "marshal/BinaryReader.h"
+
+#include <netinet/in.h>
+
+using namespace ActiveMQ::IO;
+using namespace std;
+
+uint8_t BinaryReader::readByte()
+{
+ uint8_t value;
+
+ // Read a single byte
+ read(&value, sizeof(uint8_t));
+ return value;
+}
+
+bool BinaryReader::readBoolean()
+{
+ bool value;
+
+ // Read a boolean
+ read((uint8_t*)&value, sizeof(bool));
+ return value;
+}
+
+double BinaryReader::readDouble()
+{
+ double value;
+
+ read((uint8_t*)&value, sizeof(double) );
+ return value;
+}
+
+float BinaryReader::readFloat()
+{
+ float value;
+
+ read((uint8_t*)&value, sizeof(float));
+ return value;
+}
+
+short BinaryReader::readShort()
+{
+ short value;
+
+ // Read a short and convert from big endian to little endian if necessary
+ read((uint8_t*)&value, sizeof(short));
+ return ntohs(value);
+}
+
+int BinaryReader::readInt()
+{
+ int value;
+
+ // Read an int and convert from big endian to little endian if necessary
+ read((uint8_t*)&value, sizeof(int));
+ return ntohl(value);
+}
+
+int64_t BinaryReader::readLong()
+{
+ int64_t value;
+
+ // Read a int64_t and convert from big endian to little endian if necessary
+ read((uint8_t*)&value, sizeof(int64_t));
+ return value;
+}
+
+string BinaryReader::readString()
+{
+ string value;
+ char* buffer;
+ short length;
+
+ // Read length of string
+ length = readShort();
+ buffer = new char[ntohl(length)+1];
+
+ // Read string bytes
+ read((uint8_t *)buffer, length);
+ *(buffer+length) = '\0';
+
+ // Create string class
+ value.assign(buffer);
+
+ delete[] buffer;
+
+ return value;
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryReader.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BinaryReader.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BinaryReader.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BinaryReader.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BinaryReader.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,57 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BinaryReader_hpp_
+#define BinaryReader_hpp_
+
+#include <string>
+#include <vector>
+#include "IReader.h"
+
+namespace ActiveMQ {
+ namespace IO {
+
+ /*
+ * The BinaryReader class reads primitive C++ data types from an
+ * underlying input stream in a Java compatible way. Strings are
+ * read as raw bytes, no character decoding is performed.
+ *
+ * All numeric data types are assumed to be available in big
+ * endian (network byte order) and are converted automatically
+ * to little endian if needed by the platform.
+ */
+ class BinaryReader : public IReader
+ {
+ public:
+ virtual ~BinaryReader() {}
+
+ virtual void close() = 0;
+ virtual int read(uint8_t* buffer, size_t size) = 0;
+ virtual uint8_t readByte();
+ virtual bool readBoolean();
+ virtual double readDouble();
+ virtual float readFloat();
+ virtual short readShort();
+ virtual int readInt();
+ virtual int64_t readLong();
+ virtual std::string readString();
+ };
+ }
+}
+
+#endif /*BinaryReader_hpp_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryReader.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryReader.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,77 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "BinaryWriter.h"
+
+#include <netinet/in.h>
+
+using namespace ActiveMQ::IO;
+
+void BinaryWriter::writeByte(uint8_t value)
+{
+ // Write a single byte
+ write((uint8_t *)&value, sizeof(char));
+}
+
+void BinaryWriter::writeBoolean(bool value)
+{
+ // Write a boolean
+ write((uint8_t *)&value, sizeof(bool));
+}
+
+void BinaryWriter::writeDouble(double value)
+{
+ write((uint8_t *)&value, sizeof(double));
+}
+
+void BinaryWriter::writeFloat(float value)
+{
+ write((uint8_t *)&value, sizeof(float));
+}
+
+void BinaryWriter::writeShort(short value)
+{
+ // Write a short, convert from little endian to big endian if necessary
+ short v = htons(value);
+ write((uint8_t *)&v, sizeof(short));
+}
+
+void BinaryWriter::writeInt(int value)
+{
+ // Write an int, convert from little endian to big endian if necessary
+ int v = htonl(value);
+ write((uint8_t *)&v, sizeof(int));
+}
+
+void BinaryWriter::writeLong(int64_t value)
+{
+ // Write a int64_t, convert from little endian to big endian if necessary
+ //int64_t v = htonl(value);
+ write((uint8_t *)&value, sizeof(int64_t));
+}
+
+void BinaryWriter::writeString(const std::string& value)
+{
+ // Write length of string
+ short length = (short)value.length();
+ writeShort( length );
+
+ // Write string contents
+ write((uint8_t*)value.c_str(), length);
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryWriter.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BinaryWriter.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BinaryWriter.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BinaryWriter.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BinaryWriter.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,58 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BinaryWriter_hpp_
+#define BinaryWriter_hpp_
+
+#include "marshal/IWriter.h"
+
+namespace ActiveMQ {
+ namespace IO {
+
+ /*
+ * The BinaryWriter class writes primitive C++ data types to an
+ * underlying output stream in a Java compatible way. Strings
+ * are written as raw bytes, no character encoding is performed.
+ *
+ * All numeric data types are written in big endian (network byte
+ * order) and if the platform is little endian they are converted
+ * automatically.
+ *
+ * Should any error occur an IOException will be thrown.
+ */
+ class BinaryWriter : public IWriter
+ {
+ public:
+ virtual ~BinaryWriter() {}
+
+ virtual void close() = 0;
+ virtual void flush() = 0;
+ virtual int write(const uint8_t* buffer, size_t size) = 0;
+ virtual void writeByte(uint8_t v);
+ virtual void writeBoolean(bool v);
+ virtual void writeDouble(double v);
+ virtual void writeFloat(float v);
+ virtual void writeShort(short v);
+ virtual void writeInt(int v);
+ virtual void writeLong(int64_t v);
+ virtual void writeString(const std::string& v);
+ };
+ }
+}
+
+#endif /*BinaryWriter_hpp_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryWriter.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BinaryWriter.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,124 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 <math.h>
+
+#include <bitset>
+#include <iostream>
+
+#include "marshal/BooleanStream.h"
+
+using namespace ActiveMQ::IO;
+using namespace std;
+
+BooleanStream::BooleanStream() : pos_(0)
+ {}
+
+BooleanStream::BooleanStream(IReader& i) : pos_(0) {
+ unsigned char sizemarker = i.readByte();
+ short numbytes = 0;
+ if (sizemarker == 0xC0) {
+ numbytes = i.readByte();
+ }
+ else if (sizemarker == 0x80) {
+ numbytes = i.readShort();
+ }
+ else {
+ numbytes = sizemarker;
+ }
+ for (int j = 0; j < numbytes; j++) {
+ unsigned char thisbyte = i.readByte();
+ bitset<8> bs(thisbyte);
+ for (int k = 0; k < 8; k++) {
+ writeBoolean(bs[k]);
+ }
+ }
+}
+
+bool
+BooleanStream::readBoolean() {
+ return bools_[pos_++];
+}
+
+void
+BooleanStream::writeBoolean(bool val) {
+ bools_.push_back(val);
+}
+
+size_t
+BooleanStream::getMarshalledSize() {
+ size_t ret = 0;
+
+ int size = bools_.size();
+ short numtotalbytes = (short)(ceil((double)size / 8.0));
+ unsigned char inchar = (unsigned char)numtotalbytes;
+ if (numtotalbytes < 64)
+ ++ret;
+ else if (numtotalbytes < 256)
+ ret += 2;
+ else
+ ret += 3;
+
+ int numtowrite = size;
+ int tmp = 0;
+ while (numtowrite > 0) {
+ bitset<8> byte;
+ int i = 0;
+ while (i < 8 && tmp != bools_.size())
+ byte.set(i++,bools_[tmp++]);
+ unsigned long tosend = byte.to_ulong();
+ unsigned char thebyte = (unsigned char)tosend;
+ ++ret;
+ numtowrite -= i;
+ }
+ return ret;
+}
+
+void
+BooleanStream::marshal(BinaryWriter& dataOut) {
+ int size = bools_.size();
+ short numtotalbytes = (short)(ceil((double)size / 8.0));
+ unsigned char inchar = (unsigned char)numtotalbytes;
+ if (numtotalbytes < 64) {
+ dataOut.write(&inchar, 1);
+ }
+ else if (numtotalbytes < 256) {
+ unsigned char tmp = 0xC0;
+ dataOut.write(&tmp, 1);
+ dataOut.write(&inchar, 1);
+ }
+ else {
+ unsigned char tmp = 0x80;
+ dataOut.write(&tmp, 1);
+ dataOut.writeShort(numtotalbytes);
+ }
+
+ int numtowrite = size;
+ int tmp = 0;
+ while (numtowrite > 0) {
+ bitset<8> byte;
+ int i = 0;
+ while (i < 8 && tmp != bools_.size())
+ byte.set(i++,bools_[tmp++]);
+ unsigned long tosend = byte.to_ulong();
+ unsigned char thebyte = (unsigned char)tosend;
+ dataOut.write(&thebyte, 1);
+ numtowrite -= i;
+ }
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BooleanStream.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BooleanStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BooleanStream.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BooleanStream.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BooleanStream.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,47 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BooleanStream_hpp_
+#define BooleanStream_hpp_
+
+#include <deque>
+
+#include "marshal/BinaryWriter.h"
+#include "marshal/IReader.h"
+
+namespace ActiveMQ {
+ namespace IO {
+
+ class BooleanStream
+ {
+ private:
+ std::deque<bool> bools_;
+ size_t pos_;
+
+ public:
+ BooleanStream();
+ BooleanStream(IReader& i);
+ bool readBoolean();
+ void writeBoolean(bool val);
+ size_t getMarshalledSize();
+ void marshal(BinaryWriter& dataOut);
+ };
+ }
+}
+
+#endif
Propchange: incubator/activemq/trunk/amazon/marshal/BooleanStream.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BooleanStream.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,94 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "netinet/in.h"
+#include "marshal/BrokerIdMarshaller.h"
+#include "command/BrokerId.h"
+#include "boost/shared_ptr.hpp"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+/*
+ * Marshalling code for Open Wire Format for BrokerId
+ *
+ * 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
+ */
+
+BrokerIdMarshaller::BrokerIdMarshaller()
+{
+ // no-op
+}
+
+BrokerIdMarshaller::~BrokerIdMarshaller()
+{
+ // no-op
+}
+
+auto_ptr<IDataStructure> BrokerIdMarshaller::createCommand()
+{
+ return auto_ptr<IDataStructure>(new BrokerId());
+}
+
+char BrokerIdMarshaller::getDataStructureType()
+{
+ return BrokerId::TYPE;
+}
+
+/*
+ * Un-marshal an object instance from the data input stream
+ */
+void
+BrokerIdMarshaller::unmarshal(ProtocolFormat& wireFormat, IDataStructure& o, BinaryReader& dataIn, BooleanStream& bs)
+{
+
+ BrokerId& info = (BrokerId&) o;
+ info.setValue( unmarshalString(wireFormat, dataIn, bs) );
+
+}
+
+/*
+ * Write the booleans that this object uses to a BooleanStream
+ */
+size_t
+BrokerIdMarshaller::marshal1(ProtocolFormat& wireFormat, const IDataStructure& o, BooleanStream& bs) {
+ BrokerId& info = (BrokerId&) o;
+
+ int rc = 0;
+ rc += writeString1(info.getValue(), bs);
+
+ return rc + 0;
+}
+
+/*
+ * Write a object instance to data output stream
+ */
+void
+BrokerIdMarshaller::marshal2(ProtocolFormat& wireFormat, const IDataStructure& o, BinaryWriter& dataOut, BooleanStream& bs) {
+ // }
+
+
+ BrokerId& info = (BrokerId&) o;
+ writeString2(info.getValue(), dataOut, bs);
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BrokerIdMarshaller_h_
+#define BrokerIdMarshaller_h_
+
+#include <string>
+#include <memory>
+
+#include "command/IDataStructure.h"
+
+/* auto-generated! */
+/* we could cut this down - for now include all possible headers */
+#include "command/BrokerId.h"
+#include "command/ConnectionId.h"
+#include "command/ConsumerId.h"
+#include "command/ProducerId.h"
+#include "command/SessionId.h"
+#include "command/BaseCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+
+#include "marshal/BaseDataStreamMarshaller.h"
+
+#include "marshal/ProtocolFormat.h"
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ class BrokerIdMarshaller : public BaseDataStreamMarshaller
+ {
+ public:
+ BrokerIdMarshaller();
+ virtual ~BrokerIdMarshaller();
+
+ virtual auto_ptr<ActiveMQ::Command::IDataStructure> createCommand();
+ virtual char getDataStructureType();
+
+ virtual void unmarshal(ProtocolFormat& wireFormat,
+ ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual size_t marshal1(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual void marshal2(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut,
+ ActiveMQ::IO::BooleanStream& bs);
+ };
+ }
+}
+#endif /*BrokerIdMarshaller_h_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerIdMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,121 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "netinet/in.h"
+#include "marshal/BrokerInfoMarshaller.h"
+#include "command/BrokerInfo.h"
+#include "boost/shared_ptr.hpp"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+/*
+ * Marshalling code for Open Wire Format for BrokerInfo
+ *
+ * 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
+ */
+
+BrokerInfoMarshaller::BrokerInfoMarshaller()
+{
+ // no-op
+}
+
+BrokerInfoMarshaller::~BrokerInfoMarshaller()
+{
+ // no-op
+}
+
+auto_ptr<IDataStructure> BrokerInfoMarshaller::createCommand()
+{
+ return auto_ptr<IDataStructure>(new BrokerInfo());
+}
+
+char BrokerInfoMarshaller::getDataStructureType()
+{
+ return BrokerInfo::TYPE;
+}
+
+/*
+ * Un-marshal an object instance from the data input stream
+ */
+void
+BrokerInfoMarshaller::unmarshal(ProtocolFormat& wireFormat, IDataStructure& o, BinaryReader& dataIn, BooleanStream& bs)
+{
+ BaseCommandMarshaller::unmarshal(wireFormat, o, dataIn, bs);
+
+ BrokerInfo& info = (BrokerInfo&) o;
+ info.setBrokerId( shared_ptr<BrokerId>(static_cast<BrokerId*>(unmarshalCachedObject(wireFormat, dataIn, bs).release())) );
+ info.setBrokerURL( unmarshalString(wireFormat, dataIn, bs) );
+
+ if (bs.readBoolean()) {
+ short size = dataIn.readShort();
+ std::vector<shared_ptr<const BrokerInfo> > value;
+ for( int i=0; i < size; i++ )
+ value.push_back(shared_ptr<BrokerInfo>(static_cast<BrokerInfo*>(unmarshalNestedObject(wireFormat,dataIn, bs).release())));
+ info.setPeerBrokerInfos( value );
+ }
+ info.setBrokerName( unmarshalString(wireFormat, dataIn, bs) );
+ info.setSlaveBroker( bs.readBoolean() );
+ info.setMasterBroker( bs.readBoolean() );
+ info.setFaultTolerantConfiguration( bs.readBoolean() );
+
+}
+
+/*
+ * Write the booleans that this object uses to a BooleanStream
+ */
+size_t
+BrokerInfoMarshaller::marshal1(ProtocolFormat& wireFormat, const IDataStructure& o, BooleanStream& bs) {
+ BrokerInfo& info = (BrokerInfo&) o;
+
+ int rc = BaseCommandMarshaller::marshal1(wireFormat, info, bs);
+ rc += marshal1CachedObject(wireFormat, info.getBrokerId(), bs);
+ rc += writeString1(info.getBrokerURL(), bs);
+ rc += marshal1ObjectArray(wireFormat, info.getPeerBrokerInfos(), bs);
+ rc += writeString1(info.getBrokerName(), bs);
+ bs.writeBoolean(info.isSlaveBroker());
+ bs.writeBoolean(info.isMasterBroker());
+ bs.writeBoolean(info.isFaultTolerantConfiguration());
+
+ return rc + 0;
+}
+
+/*
+ * Write a object instance to data output stream
+ */
+void
+BrokerInfoMarshaller::marshal2(ProtocolFormat& wireFormat, const IDataStructure& o, BinaryWriter& dataOut, BooleanStream& bs) {
+ // }
+
+ BaseCommandMarshaller::marshal2(wireFormat, o, dataOut, bs);
+
+ BrokerInfo& info = (BrokerInfo&) o;
+ marshal2CachedObject(wireFormat, info.getBrokerId(), dataOut, bs);
+ writeString2(info.getBrokerURL(), dataOut, bs);
+ marshal2ObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
+ writeString2(info.getBrokerName(), dataOut, bs);
+ bs.readBoolean();
+ bs.readBoolean();
+ bs.readBoolean();
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BrokerInfoMarshaller_h_
+#define BrokerInfoMarshaller_h_
+
+#include <string>
+#include <memory>
+
+#include "command/IDataStructure.h"
+
+/* auto-generated! */
+/* we could cut this down - for now include all possible headers */
+#include "command/BrokerId.h"
+#include "command/ConnectionId.h"
+#include "command/ConsumerId.h"
+#include "command/ProducerId.h"
+#include "command/SessionId.h"
+#include "command/BaseCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+
+#include "marshal/BaseCommandMarshaller.h"
+
+#include "marshal/ProtocolFormat.h"
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ class BrokerInfoMarshaller : public BaseCommandMarshaller
+ {
+ public:
+ BrokerInfoMarshaller();
+ virtual ~BrokerInfoMarshaller();
+
+ virtual auto_ptr<ActiveMQ::Command::IDataStructure> createCommand();
+ virtual char getDataStructureType();
+
+ virtual void unmarshal(ProtocolFormat& wireFormat,
+ ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual size_t marshal1(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual void marshal2(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut,
+ ActiveMQ::IO::BooleanStream& bs);
+ };
+ }
+}
+#endif /*BrokerInfoMarshaller_h_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BrokerInfoMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BufferReader.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BufferReader.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BufferReader.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BufferReader.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,44 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "amq_corelib/Exception.h"
+#include "marshal/BufferReader.h"
+#include <algorithm>
+
+#include <iostream>
+
+using ActiveMQ::Exception;
+
+using namespace ActiveMQ::IO;
+using namespace std;
+
+void
+BufferReader::close() {
+
+}
+
+int
+BufferReader::read(unsigned char* buffer, size_t size) {
+ if (pos_ + size > readFrom_.size())
+ throw Exception("No bytes left in buffer");
+
+ memcpy(buffer, &(readFrom_[pos_]), size);
+ pos_ += size;
+ return size;
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BufferReader.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BufferReader.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BufferReader.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BufferReader.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BufferReader.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BufferReader.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,46 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BufferReader_hpp_
+#define BufferReader_hpp_
+
+#include <vector>
+
+#include "marshal/BinaryReader.h"
+
+namespace ActiveMQ {
+ namespace IO {
+ class BufferReader : public BinaryReader
+ {
+ private:
+ const std::vector<unsigned char>& readFrom_;
+ size_t pos_;
+
+ public:
+ BufferReader(const std::vector<unsigned char>& readFrom) : readFrom_(readFrom), pos_(0) {}
+ virtual ~BufferReader() {}
+
+ virtual void close();
+ virtual int read(unsigned char* buffer, size_t size);
+ std::vector<unsigned char> readBytes(size_t num);
+ };
+ }
+}
+
+#endif /*BufferReader_hpp_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BufferReader.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BufferReader.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,42 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "marshal/BufferWriter.h"
+#include <algorithm>
+
+#include <iostream>
+
+using namespace ActiveMQ::IO;
+using namespace std;
+
+void
+BufferWriter::close() {
+
+}
+
+void
+BufferWriter::flush() {
+
+}
+
+int
+BufferWriter::write(const uint8_t* buffer, size_t size) {
+ writeInto_.insert(writeInto_.end(), buffer, buffer + size);
+ return size;
+}
Propchange: incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BufferWriter.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/BufferWriter.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/BufferWriter.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/BufferWriter.h (added)
+++ incubator/activemq/trunk/amazon/marshal/BufferWriter.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,45 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 BufferWriter_hpp_
+#define BufferWriter_hpp_
+
+#include <vector>
+
+#include "marshal/BinaryWriter.h"
+
+namespace ActiveMQ {
+ namespace IO {
+ class BufferWriter : public BinaryWriter
+ {
+ private:
+ std::vector<uint8_t>& writeInto_;
+
+ public:
+ BufferWriter(std::vector<uint8_t>& writeInto) : writeInto_(writeInto) {}
+ virtual ~BufferWriter() {}
+
+ virtual void close();
+ virtual void flush();
+ virtual int write(const uint8_t* buffer, size_t size);
+ };
+ }
+}
+
+#endif /*BufferWriter_hpp_*/
Propchange: incubator/activemq/trunk/amazon/marshal/BufferWriter.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/BufferWriter.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,108 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "netinet/in.h"
+#include "marshal/ConnectionControlMarshaller.h"
+#include "command/ConnectionControl.h"
+#include "boost/shared_ptr.hpp"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+/*
+ * Marshalling code for Open Wire Format for ConnectionControl
+ *
+ * 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
+ */
+
+ConnectionControlMarshaller::ConnectionControlMarshaller()
+{
+ // no-op
+}
+
+ConnectionControlMarshaller::~ConnectionControlMarshaller()
+{
+ // no-op
+}
+
+auto_ptr<IDataStructure> ConnectionControlMarshaller::createCommand()
+{
+ return auto_ptr<IDataStructure>(new ConnectionControl());
+}
+
+char ConnectionControlMarshaller::getDataStructureType()
+{
+ return ConnectionControl::TYPE;
+}
+
+/*
+ * Un-marshal an object instance from the data input stream
+ */
+void
+ConnectionControlMarshaller::unmarshal(ProtocolFormat& wireFormat, IDataStructure& o, BinaryReader& dataIn, BooleanStream& bs)
+{
+ BaseCommandMarshaller::unmarshal(wireFormat, o, dataIn, bs);
+
+ ConnectionControl& info = (ConnectionControl&) o;
+ info.setClose( bs.readBoolean() );
+ info.setExit( bs.readBoolean() );
+ info.setFaultTolerant( bs.readBoolean() );
+ info.setResume( bs.readBoolean() );
+ info.setSuspend( bs.readBoolean() );
+
+}
+
+/*
+ * Write the booleans that this object uses to a BooleanStream
+ */
+size_t
+ConnectionControlMarshaller::marshal1(ProtocolFormat& wireFormat, const IDataStructure& o, BooleanStream& bs) {
+ ConnectionControl& info = (ConnectionControl&) o;
+
+ int rc = BaseCommandMarshaller::marshal1(wireFormat, info, bs);
+ bs.writeBoolean(info.isClose());
+ bs.writeBoolean(info.isExit());
+ bs.writeBoolean(info.isFaultTolerant());
+ bs.writeBoolean(info.isResume());
+ bs.writeBoolean(info.isSuspend());
+
+ return rc + 0;
+}
+
+/*
+ * Write a object instance to data output stream
+ */
+void
+ConnectionControlMarshaller::marshal2(ProtocolFormat& wireFormat, const IDataStructure& o, BinaryWriter& dataOut, BooleanStream& bs) {
+ // }
+
+ BaseCommandMarshaller::marshal2(wireFormat, o, dataOut, bs);
+
+ ConnectionControl& info = (ConnectionControl&) o;
+ bs.readBoolean();
+ bs.readBoolean();
+ bs.readBoolean();
+ bs.readBoolean();
+ bs.readBoolean();
+}
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 ConnectionControlMarshaller_h_
+#define ConnectionControlMarshaller_h_
+
+#include <string>
+#include <memory>
+
+#include "command/IDataStructure.h"
+
+/* auto-generated! */
+/* we could cut this down - for now include all possible headers */
+#include "command/BrokerId.h"
+#include "command/ConnectionId.h"
+#include "command/ConsumerId.h"
+#include "command/ProducerId.h"
+#include "command/SessionId.h"
+#include "command/BaseCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+
+#include "marshal/BaseCommandMarshaller.h"
+
+#include "marshal/ProtocolFormat.h"
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ class ConnectionControlMarshaller : public BaseCommandMarshaller
+ {
+ public:
+ ConnectionControlMarshaller();
+ virtual ~ConnectionControlMarshaller();
+
+ virtual auto_ptr<ActiveMQ::Command::IDataStructure> createCommand();
+ virtual char getDataStructureType();
+
+ virtual void unmarshal(ProtocolFormat& wireFormat,
+ ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual size_t marshal1(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual void marshal2(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut,
+ ActiveMQ::IO::BooleanStream& bs);
+ };
+ }
+}
+#endif /*ConnectionControlMarshaller_h_*/
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionControlMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,99 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "netinet/in.h"
+#include "marshal/ConnectionErrorMarshaller.h"
+#include "command/ConnectionError.h"
+#include "boost/shared_ptr.hpp"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+/*
+ * Marshalling code for Open Wire Format for ConnectionError
+ *
+ * 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
+ */
+
+ConnectionErrorMarshaller::ConnectionErrorMarshaller()
+{
+ // no-op
+}
+
+ConnectionErrorMarshaller::~ConnectionErrorMarshaller()
+{
+ // no-op
+}
+
+auto_ptr<IDataStructure> ConnectionErrorMarshaller::createCommand()
+{
+ return auto_ptr<IDataStructure>(new ConnectionError());
+}
+
+char ConnectionErrorMarshaller::getDataStructureType()
+{
+ return ConnectionError::TYPE;
+}
+
+/*
+ * Un-marshal an object instance from the data input stream
+ */
+void
+ConnectionErrorMarshaller::unmarshal(ProtocolFormat& wireFormat, IDataStructure& o, BinaryReader& dataIn, BooleanStream& bs)
+{
+ BaseCommandMarshaller::unmarshal(wireFormat, o, dataIn, bs);
+
+ ConnectionError& info = (ConnectionError&) o;
+ info.setException( unmarshalBrokerError(wireFormat, dataIn, bs) );
+ info.setConnectionId( shared_ptr<ConnectionId>(static_cast<ConnectionId*>(unmarshalNestedObject(wireFormat, dataIn, bs).release())) );
+
+}
+
+/*
+ * Write the booleans that this object uses to a BooleanStream
+ */
+size_t
+ConnectionErrorMarshaller::marshal1(ProtocolFormat& wireFormat, const IDataStructure& o, BooleanStream& bs) {
+ ConnectionError& info = (ConnectionError&) o;
+
+ int rc = BaseCommandMarshaller::marshal1(wireFormat, info, bs);
+ rc += marshal1BrokerError(wireFormat, info.getException(), bs);
+ rc += marshal1NestedObject(wireFormat, info.getConnectionId(), bs);
+
+ return rc + 0;
+}
+
+/*
+ * Write a object instance to data output stream
+ */
+void
+ConnectionErrorMarshaller::marshal2(ProtocolFormat& wireFormat, const IDataStructure& o, BinaryWriter& dataOut, BooleanStream& bs) {
+ // }
+
+ BaseCommandMarshaller::marshal2(wireFormat, o, dataOut, bs);
+
+ ConnectionError& info = (ConnectionError&) o;
+ marshal2BrokerError(wireFormat, info.getException(), dataOut, bs);
+ marshal2NestedObject(wireFormat, info.getConnectionId(), dataOut, bs);
+}
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h (added)
+++ incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h Mon Jul 31 02:36:40 2006
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 ConnectionErrorMarshaller_h_
+#define ConnectionErrorMarshaller_h_
+
+#include <string>
+#include <memory>
+
+#include "command/IDataStructure.h"
+
+/* auto-generated! */
+/* we could cut this down - for now include all possible headers */
+#include "command/BrokerId.h"
+#include "command/ConnectionId.h"
+#include "command/ConsumerId.h"
+#include "command/ProducerId.h"
+#include "command/SessionId.h"
+#include "command/BaseCommand.h"
+
+#include "marshal/BinaryReader.h"
+#include "marshal/BinaryWriter.h"
+
+#include "marshal/BaseCommandMarshaller.h"
+
+#include "marshal/ProtocolFormat.h"
+
+namespace ActiveMQ {
+ namespace Marshalling {
+
+ class ConnectionErrorMarshaller : public BaseCommandMarshaller
+ {
+ public:
+ ConnectionErrorMarshaller();
+ virtual ~ConnectionErrorMarshaller();
+
+ virtual auto_ptr<ActiveMQ::Command::IDataStructure> createCommand();
+ virtual char getDataStructureType();
+
+ virtual void unmarshal(ProtocolFormat& wireFormat,
+ ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryReader& dataIn,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual size_t marshal1(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BooleanStream& bs);
+
+ virtual void marshal2(ProtocolFormat& wireFormat,
+ const ActiveMQ::Command::IDataStructure& o,
+ ActiveMQ::IO::BinaryWriter& dataOut,
+ ActiveMQ::IO::BooleanStream& bs);
+ };
+ }
+}
+#endif /*ConnectionErrorMarshaller_h_*/
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/amazon/marshal/ConnectionErrorMarshaller.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/amazon/marshal/ConnectionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/amazon/marshal/ConnectionIdMarshaller.cpp?rev=427057&view=auto
==============================================================================
--- incubator/activemq/trunk/amazon/marshal/ConnectionIdMarshaller.cpp (added)
+++ incubator/activemq/trunk/amazon/marshal/ConnectionIdMarshaller.cpp Mon Jul 31 02:36:40 2006
@@ -0,0 +1,94 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "netinet/in.h"
+#include "marshal/ConnectionIdMarshaller.h"
+#include "command/ConnectionId.h"
+#include "boost/shared_ptr.hpp"
+
+using namespace ActiveMQ::Marshalling;
+using namespace ActiveMQ::Command;
+using namespace ActiveMQ::IO;
+using std::auto_ptr;
+using boost::shared_ptr;
+
+/*
+ * Marshalling code for Open Wire Format for ConnectionId
+ *
+ * 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
+ */
+
+ConnectionIdMarshaller::ConnectionIdMarshaller()
+{
+ // no-op
+}
+
+ConnectionIdMarshaller::~ConnectionIdMarshaller()
+{
+ // no-op
+}
+
+auto_ptr<IDataStructure> ConnectionIdMarshaller::createCommand()
+{
+ return auto_ptr<IDataStructure>(new ConnectionId());
+}
+
+char ConnectionIdMarshaller::getDataStructureType()
+{
+ return ConnectionId::TYPE;
+}
+
+/*
+ * Un-marshal an object instance from the data input stream
+ */
+void
+ConnectionIdMarshaller::unmarshal(ProtocolFormat& wireFormat, IDataStructure& o, BinaryReader& dataIn, BooleanStream& bs)
+{
+
+ ConnectionId& info = (ConnectionId&) o;
+ info.setValue( unmarshalString(wireFormat, dataIn, bs) );
+
+}
+
+/*
+ * Write the booleans that this object uses to a BooleanStream
+ */
+size_t
+ConnectionIdMarshaller::marshal1(ProtocolFormat& wireFormat, const IDataStructure& o, BooleanStream& bs) {
+ ConnectionId& info = (ConnectionId&) o;
+
+ int rc = 0;
+ rc += writeString1(info.getValue(), bs);
+
+ return rc + 0;
+}
+
+/*
+ * Write a object instance to data output stream
+ */
+void
+ConnectionIdMarshaller::marshal2(ProtocolFormat& wireFormat, const IDataStructure& o, BinaryWriter& dataOut, BooleanStream& bs) {
+ // }
+
+
+ ConnectionId& info = (ConnectionId&) o;
+ writeString2(info.getValue(), dataOut, bs);
+}