/* * 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 #include #include #include // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Java Classes in the // activemq-core module // using namespace std; using namespace activemq; using namespace activemq::exceptions; using namespace activemq::commands; using namespace activemq::wireformat; using namespace activemq::wireformat::openwire; using namespace activemq::wireformat::openwire::marshal; using namespace activemq::wireformat::openwire::utils; using namespace activemq::wireformat::openwire::marshal::generated; using namespace decaf; using namespace decaf::io; using namespace decaf::lang; /////////////////////////////////////////////////////////////////////////////// DataStructure* DataArrayResponseMarshaller::createObject() const { return new DataArrayResponse(); } /////////////////////////////////////////////////////////////////////////////// unsigned char DataArrayResponseMarshaller::getDataStructureType() const { return DataArrayResponse::ID_DATAARRAYRESPONSE; } /////////////////////////////////////////////////////////////////////////////// void DataArrayResponseMarshaller::tightUnmarshal(OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs) { try { ResponseMarshaller::tightUnmarshal(wireFormat, dataStructure, dataIn, bs); DataArrayResponse* info = dynamic_cast(dataStructure); if (bs->readBoolean()) { short size = dataIn->readShort(); info->getData().reserve(size); for (int i = 0; i < size; i++) { info->getData().push_back(Pointer(dynamic_cast( tightUnmarshalNestedObject(wireFormat, dataIn, bs)))); } } else { info->getData().clear(); } } AMQ_CATCH_RETHROW(decaf::io::IOException) AMQ_CATCH_EXCEPTION_CONVERT(exceptions::ActiveMQException, decaf::io::IOException) AMQ_CATCHALL_THROW(decaf::io::IOException) } /////////////////////////////////////////////////////////////////////////////// int DataArrayResponseMarshaller::tightMarshal1(OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs) { try { DataArrayResponse* info = dynamic_cast(dataStructure); int rc = ResponseMarshaller::tightMarshal1(wireFormat, dataStructure, bs); rc += tightMarshalObjectArray1(wireFormat, info->getData(), bs); return rc + 0; } AMQ_CATCH_RETHROW(decaf::io::IOException) AMQ_CATCH_EXCEPTION_CONVERT(exceptions::ActiveMQException, decaf::io::IOException) AMQ_CATCHALL_THROW(decaf::io::IOException) } /////////////////////////////////////////////////////////////////////////////// void DataArrayResponseMarshaller::tightMarshal2(OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs) { try { ResponseMarshaller::tightMarshal2(wireFormat, dataStructure, dataOut, bs ); DataArrayResponse* info = dynamic_cast(dataStructure); tightMarshalObjectArray2(wireFormat, info->getData(), dataOut, bs); } AMQ_CATCH_RETHROW(decaf::io::IOException) AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException) AMQ_CATCHALL_THROW(decaf::io::IOException) } /////////////////////////////////////////////////////////////////////////////// void DataArrayResponseMarshaller::looseUnmarshal(OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn) { try { ResponseMarshaller::looseUnmarshal(wireFormat, dataStructure, dataIn); DataArrayResponse* info = dynamic_cast(dataStructure); if (dataIn->readBoolean()) { short size = dataIn->readShort(); info->getData().reserve(size); for (int i = 0; i < size; i++) { info->getData().push_back( Pointer(dynamic_cast( looseUnmarshalNestedObject(wireFormat, dataIn)))); } } else { info->getData().clear(); } } AMQ_CATCH_RETHROW(decaf::io::IOException) AMQ_CATCH_EXCEPTION_CONVERT(exceptions::ActiveMQException, decaf::io::IOException) AMQ_CATCHALL_THROW(decaf::io::IOException) } /////////////////////////////////////////////////////////////////////////////// void DataArrayResponseMarshaller::looseMarshal(OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut) { try { DataArrayResponse* info = dynamic_cast(dataStructure); ResponseMarshaller::looseMarshal(wireFormat, dataStructure, dataOut); looseMarshalObjectArray(wireFormat, info->getData(), dataOut); } AMQ_CATCH_RETHROW(decaf::io::IOException) AMQ_CATCH_EXCEPTION_CONVERT(exceptions::ActiveMQException, decaf::io::IOException) AMQ_CATCHALL_THROW(decaf::io::IOException) }