Author: tabish
Date: Sat Nov 18 13:59:46 2006
New Revision: 476618
URL: http://svn.apache.org/viewvc?view=rev&rev=476618
Log:
Code Submit for planned Openwire Support
Modified:
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp?view=diff&rev=476618&r1=476617&r2=476618
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
Sat Nov 18 13:59:46 2006
@@ -285,6 +285,47 @@
}
////////////////////////////////////////////////////////////////////////////////
+int OpenWireFormat::tightMarshalNestedObject1( commands::DataStructure* object,
+ utils::BooleanStream* bs )
+ throw ( io::IOException ) {
+
+ try {
+
+ bs->writeBoolean( object != NULL );
+ if( object == NULL ) {
+ return 0;
+ }
+
+// if (o.IsMarshallAware())
+// {
+// MarshallAware ma = (MarshallAware) o;
+// byte[] sequence = ma.GetMarshalledForm(this);
+// bs.WriteBoolean(sequence != null);
+// if (sequence != null)
+// {
+// return 1 + sequence.Length;
+// }
+// }
+//
+// byte type = o.GetDataStructureType();
+// if (type == 0) {
+// throw new IOException("No valid data structure type for: " + o + " of type:
" + o.GetType());
+// }
+// BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type
& 0xFF];
+// if (dsm == null)
+// throw new IOException("Unknown data type: " + type);
+// //Console.WriteLine("Marshalling type: " + type + " with structure: " + o);
+// return 1 + dsm.TightMarshal1(this, o, bs);
+
+ return 0;
+
+ }
+ AMQ_CATCH_RETHROW( IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, IOException )
+ AMQ_CATCHALL_THROW( IOException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
void OpenWireFormat::tightMarshalNestedObject2( DataStructure* o,
DataOutputStream* ds,
BooleanStream* bs )
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h?view=diff&rev=476618&r1=476617&r2=476618
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
Sat Nov 18 13:59:46 2006
@@ -69,6 +69,17 @@
virtual transport::Command* unmarshal( io::DataInputStream* dis ) throw ( io::IOException
);
/**
+ * Utility method for Tight Marshalling the given object to the boolean
+ * stream passed.
+ * @param object - The DataStructure to marshal
+ * @param bs - the BooleanStream to write to
+ * @returns size of the data returned.
+ */
+ virtual int tightMarshalNestedObject1( commands::DataStructure* object,
+ utils::BooleanStream* bs )
+ throw ( io::IOException );
+
+ /**
* Utility method that will Tight marshall some internally nested object
* that implements the DataStructure interface. Writes the data to the
* Data Ouput Stream provided.
|