| /* |
| * 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 "marshal/DestinationInfoMarshaller.hpp" |
| |
| using namespace apache::activemq::client::marshal; |
| |
| /* |
| * Marshalling code for Open Wire Format for DestinationInfo |
| * |
| * 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 |
| */ |
| |
| DestinationInfoMarshaller::DestinationInfoMarshaller() |
| { |
| // no-op |
| } |
| |
| DestinationInfoMarshaller::~DestinationInfoMarshaller() |
| { |
| // no-op |
| } |
| |
| |
| |
| IDataStructure* DestinationInfoMarshaller::createObject() |
| { |
| return new DestinationInfo(); |
| } |
| |
| char DestinationInfoMarshaller::getDataStructureType() |
| { |
| return DestinationInfo.ID_DestinationInfo; |
| } |
| |
| /* |
| * Un-marshal an object instance from the data input stream |
| */ |
| void DestinationInfoMarshaller::unmarshal(ProtocolFormat& wireFormat, Object o, BinaryReader& dataIn, BooleanStream& bs) |
| { |
| base.unmarshal(wireFormat, o, dataIn, bs); |
| |
| DestinationInfo& info = (DestinationInfo&) o; |
| info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); |
| info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); |
| info.setOperationType(dataIn.readByte()); |
| info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs)); |
| |
| if (bs.readBoolean()) { |
| short size = dataIn.readShort(); |
| org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; |
| for( int i=0; i < size; i++ ) { |
| value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); |
| } |
| info.setBrokerPath(value); |
| } |
| else { |
| info.setBrokerPath(null); |
| } |
| |
| } |
| |
| |
| /* |
| * Write the booleans that this object uses to a BooleanStream |
| */ |
| int DestinationInfoMarshaller::marshal1(ProtocolFormat& wireFormat, Object& o, BooleanStream& bs) { |
| DestinationInfo& info = (DestinationInfo&) o; |
| |
| int rc = base.marshal1(wireFormat, info, bs); |
| rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); |
| rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); |
| rc += marshal1Long(wireFormat, info.getTimeout(), bs); |
| rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); |
| |
| return rc + 1; |
| } |
| |
| /* |
| * Write a object instance to data output stream |
| */ |
| void DestinationInfoMarshaller::marshal2(ProtocolFormat& wireFormat, Object& o, BinaryWriter& dataOut, BooleanStream& bs) { |
| base.marshal2(wireFormat, o, dataOut, bs); |
| |
| DestinationInfo& info = (DestinationInfo&) o; |
| marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); |
| marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); |
| DataStreamMarshaller.writeByte(info.getOperationType(), dataOut); |
| marshal2Long(wireFormat, info.getTimeout(), dataOut, bs); |
| marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); |
| |
| } |