[openrtm-commit:00475] r592 - branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 12月 6日 (火) 17:23:47 JST
Author: fsi-katami
Date: 2011-12-06 17:23:47 +0900 (Tue, 06 Dec 2011)
New Revision: 592
Added:
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EncapsOutputStreamExt.java
Modified:
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPort.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortConnector.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortPullConnector.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPullConnector.java
branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPushConnector.java
Log:
Add EncapsOutputStreamExt class. The class is an extension of EncapsOutputStream.
Added: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EncapsOutputStreamExt.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EncapsOutputStreamExt.java (rev 0)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EncapsOutputStreamExt.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -0,0 +1,22 @@
+package jp.go.aist.rtm.RTC.port;
+
+import com.sun.corba.se.impl.encoding.EncapsOutputStream;
+import com.sun.corba.se.spi.orb.ORB;
+
+import jp.go.aist.rtm.RTC.util.ORBUtil;
+
+public class EncapsOutputStreamExt extends EncapsOutputStream {
+ /**
+ * {@.ja コンストラクタ}
+ * {@.en Constructor}
+ * <p>
+ *
+ */
+ public EncapsOutputStreamExt(org.omg.CORBA.ORB orb, boolean isLittleEndian) {
+ super((ORB)orb,isLittleEndian);
+ }
+
+ public final byte[] getByteArray(){
+ return toByteArray();
+ }
+}
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPort.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPort.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPort.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -13,7 +13,6 @@
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.Streamable;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
/**
* <p>入力ポートのためのベース実装クラスです。
@@ -125,7 +124,6 @@
this.m_OnOverflow = null;
this.m_OnUnderflow = null;
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
m_orb = ORBUtil.getOrb();
Class cl = value.v.getClass();
@@ -315,7 +313,7 @@
}
ReturnCode ret;
- EncapsOutputStream cdr = new EncapsOutputStream(m_spi_orb,
+ EncapsOutputStreamExt cdr = new EncapsOutputStreamExt(m_orb,
isLittleEndian());
DataRef<InputStream> dataref
= new DataRef<InputStream>(cdr.create_input_stream());
@@ -538,6 +536,5 @@
private Streamable m_streamable = null;
private Field m_field = null;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
private ORB m_orb;
}
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortConnector.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortConnector.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortConnector.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -33,7 +33,6 @@
m_profile = profile;
m_buffer = buffer;
m_isLittleEndian = true;
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
m_orb = ORBUtil.getOrb();
}
@@ -169,7 +168,6 @@
protected ConnectorInfo m_profile;
protected BufferBase<OutputStream> m_buffer;
protected boolean m_isLittleEndian;
- protected com.sun.corba.se.spi.orb.ORB m_spi_orb;
protected org.omg.CORBA.ORB m_orb;
}
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -15,7 +15,6 @@
import _SDOPackage.NVListHolder;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
/**
* {@.ja InPortCorbaCdrConsumer クラス}
@@ -41,10 +40,8 @@
*/
public InPortCorbaCdrConsumer() {
super(OpenRTM.InPortCdr.class);
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
rtcout = new Logbuf("InPortCorbaCdrConsumer");
// rtcout.setLevel("PARANOID");
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
m_orb = ORBUtil.getOrb();
}
/**
@@ -109,16 +106,15 @@
public ReturnCode put(final OutputStream data) {
rtcout.println(Logbuf.PARANOID, "put");
- EncapsOutputStream cdr;
- cdr = (EncapsOutputStream)data;
+ EncapsOutputStreamExt cdr;
+ cdr = (EncapsOutputStreamExt)data;
byte[] ch = cdr.toByteArray();
- EncapsOutputStream output_stream
- = new EncapsOutputStream(m_spi_orb, m_connector.isLittleEndian());
+ EncapsOutputStreamExt output_stream
+ = new EncapsOutputStreamExt(m_orb, m_connector.isLittleEndian());
output_stream.write_octet_array(ch,0,ch.length);
try {
-// OpenRTM.PortStatus ret = _ptr().put(cdr.toByteArray());
- OpenRTM.PortStatus ret = _ptr().put(output_stream.toByteArray());
+ OpenRTM.PortStatus ret = _ptr().put(output_stream.getByteArray());
return convertReturn(ret);
}
catch (Exception e) {
@@ -471,7 +467,6 @@
private Logbuf rtcout;
private Properties m_properties;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
private OutPortConnector m_connector;
private ORB m_orb;
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -19,7 +19,6 @@
import OpenRTM.InPortCdrPOA;
import _SDOPackage.NVListHolder;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
/**
* {@.ja InPortCorbaCdrProvider クラス}
@@ -57,7 +56,7 @@
NVUtil.newNV("dataport.corba_cdr.inport_ref",
m_objref, OpenRTM.InPortCdr.class ));
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
+ m_orb = ORBUtil.getOrb();
}
/**
@@ -148,8 +147,8 @@
rtcout.println(Logbuf.PARANOID, "InPortCorbaCdrProvider.put()");
if (m_buffer == null) {
- EncapsOutputStream cdr
- = new EncapsOutputStream(m_spi_orb,m_connector.isLittleEndian());
+ EncapsOutputStreamExt cdr
+ = new EncapsOutputStreamExt(m_orb,m_connector.isLittleEndian());
cdr.write_octet_array(data, 0, data.length);
onReceiverError(cdr);
return OpenRTM.PortStatus.PORT_ERROR;
@@ -159,11 +158,11 @@
rtcout.println(Logbuf.PARANOID, "received data size: "+data.length);
- EncapsOutputStream cdr
- = new EncapsOutputStream(m_spi_orb,m_connector.isLittleEndian());
+ EncapsOutputStreamExt cdr
+ = new EncapsOutputStreamExt(m_orb,m_connector.isLittleEndian());
cdr.write_octet_array(data, 0, data.length);
- int len = cdr.toByteArray().length;
+ int len = cdr.getByteArray().length;
rtcout.println(Logbuf.PARANOID, "converted CDR data size: "+len);
onReceived(cdr);
jp.go.aist.rtm.RTC.buffer.ReturnCode ret = m_buffer.write(cdr);
@@ -203,7 +202,7 @@
*/
protected OpenRTM.PortStatus
convertReturn(jp.go.aist.rtm.RTC.buffer.ReturnCode status,
- final EncapsOutputStream data) {
+ final EncapsOutputStreamExt data) {
switch (status) {
case BUFFER_OK:
onBufferWrite(data);
@@ -611,7 +610,7 @@
private BufferBase<OutputStream> m_buffer;
private OpenRTM.InPortCdr m_objref;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
+ private ORB m_orb;
private InPortConnector m_connector;
private ConnectorListeners m_listeners;
private ConnectorBase.ConnectorInfo m_profile;
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortPullConnector.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortPullConnector.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortPullConnector.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -9,7 +9,6 @@
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
/**
* {@.ja InPortPullConnector クラス}
@@ -146,7 +145,7 @@
if (m_consumer == null) {
return ReturnCode.PORT_ERROR;
}
- EncapsOutputStream cdr = new EncapsOutputStream(m_spi_orb,
+ EncapsOutputStreamExt cdr = new EncapsOutputStreamExt(m_orb,
m_isLittleEndian);
ReturnCode ret = m_consumer.get(cdr);
DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -234,7 +234,6 @@
this.m_OnOverflow = null;
this.m_OnUnderflow = null;
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
Class cl = valueRef.v.getClass();
String str = cl.getName();
@@ -701,6 +700,5 @@
private Streamable m_streamable = null;
private Field m_field = null;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
private Vector<ReturnCode> m_status = new Vector<ReturnCode>();
}
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -19,7 +19,6 @@
import OpenRTM.OutPortCdrPOA;
import _SDOPackage.NVListHolder;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
/**
* {@.ja OutPortCorbaCdrProvider クラス}
@@ -168,9 +167,9 @@
if (ret.equals(jp.go.aist.rtm.RTC.buffer.ReturnCode.BUFFER_OK)) {
- EncapsOutputStream outcdr;
- outcdr = (EncapsOutputStream)cdr_ref.v;
- data.value = outcdr.toByteArray();
+ EncapsOutputStreamExt outcdr;
+ outcdr = (EncapsOutputStreamExt)cdr_ref.v;
+ data.value = outcdr.getByteArray();
}
return convertReturn(ret);
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPullConnector.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPullConnector.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPullConnector.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -8,7 +8,7 @@
import org.omg.CORBA.portable.OutputStream;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
+import org.omg.CORBA.ORB;
/**
* {@.ja OutPortPullConnector クラス}
@@ -146,7 +146,7 @@
m_provider = provider;
m_buffer = buffer;
m_listeners = listeners;
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
+ m_orb = ORBUtil.getOrb();
// create buffer
if (m_buffer == null) {
m_buffer = createBuffer(profile);
@@ -179,7 +179,7 @@
rtcout.println(Logbuf.TRACE, "write()");
OutPort out = (OutPort)m_outport;
OutputStream cdr
- = new EncapsOutputStream(m_spi_orb,m_isLittleEndian);
+ = new EncapsOutputStreamExt(m_orb,m_isLittleEndian);
out.write_stream(data,cdr);
m_buffer.write(cdr);
return ReturnCode.PORT_OK;
@@ -305,7 +305,7 @@
* <p> the pointer to the buffer </p>
*/
protected BufferBase<OutputStream> m_buffer;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
+ private ORB m_orb;
private OutPortBase m_outport;
/**
* <p> A reference to a ConnectorListener </p>
Modified: branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPushConnector.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPushConnector.java 2011-12-06 08:07:30 UTC (rev 591)
+++ branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortPushConnector.java 2011-12-06 08:23:47 UTC (rev 592)
@@ -14,7 +14,7 @@
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.Streamable;
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
+import org.omg.CORBA.ORB;
public class OutPortPushConnector extends OutPortConnector {
/**
@@ -153,7 +153,7 @@
m_publisher.setBuffer(m_buffer);
m_publisher.setListener(m_profile, m_listeners);
- m_spi_orb = (com.sun.corba.se.spi.orb.ORB)ORBUtil.getOrb();
+ m_orb = ORBUtil.getOrb();
onConnect();
@@ -199,7 +199,7 @@
rtcout.println(Logbuf.TRACE, "write()");
OutPort out = (OutPort)m_outport;
OutputStream cdr
- = new EncapsOutputStream(m_spi_orb,m_isLittleEndian);
+ = new EncapsOutputStreamExt(m_orb,m_isLittleEndian);
out.write_stream(data,cdr);
return m_publisher.write(cdr,0,0);
}
@@ -353,7 +353,7 @@
private BufferBase<OutputStream> m_buffer;
private Streamable m_streamable = null;
private Field m_field = null;
- private com.sun.corba.se.spi.orb.ORB m_spi_orb;
+ private ORB m_orb;
private OutPortBase m_outport;
/**
* <p> A reference to a ConnectorListener </p>
openrtm-commit メーリングリストの案内