[openrtm-commit:00357] r542 - branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 8月 13日 (土) 16:59:20 JST
Author: fsi-katami
Date: 2011-08-13 16:59:20 +0900 (Sat, 13 Aug 2011)
New Revision: 542
Modified:
branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java
Log:
Implemented ComponentObserverConsumer. refs #2051
Modified: branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java
===================================================================
--- branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java 2011-08-13 06:59:50 UTC (rev 541)
+++ branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java 2011-08-13 07:59:20 UTC (rev 542)
@@ -18,6 +18,7 @@
import jp.go.aist.rtm.RTC.port.PortConnectRetListenerType;
import jp.go.aist.rtm.RTC.util.CallbackFunction;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.ListenerBase;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.Properties;
@@ -183,32 +184,47 @@
break;
}
}
-
+
+ DataRef<Boolean> bflag = new DataRef<Boolean>(new Boolean(true));
+ bflag.v = new Boolean(m_observed[StatusKind._COMPONENT_PROFILE]);
switchListeners(flags[StatusKind._COMPONENT_PROFILE],
- m_observed[StatusKind._COMPONENT_PROFILE],
+ bflag,
this,
"setComponentProfileListeners",
"unsetComponentProfileListeners");
+ m_observed[StatusKind._COMPONENT_PROFILE] = bflag.v.booleanValue();
+
+ bflag.v = new Boolean(m_observed[StatusKind._RTC_STATUS]);
switchListeners(flags[StatusKind._RTC_STATUS],
- m_observed[StatusKind._RTC_STATUS],
+ bflag,
this,
"setComponentStatusListeners",
"unsetComponentStatusListeners");
+ m_observed[StatusKind._RTC_STATUS] = bflag.v.booleanValue();
+
+ bflag.v = new Boolean(m_observed[StatusKind._EC_STATUS]);
switchListeners(flags[StatusKind._EC_STATUS],
- m_observed[StatusKind._EC_STATUS],
+ bflag,
this,
"setExecutionContextListeners",
"unsetExecutionContextListeners");
+ m_observed[StatusKind._EC_STATUS] = bflag.v.booleanValue();
+
+ bflag.v = new Boolean(m_observed[StatusKind._PORT_PROFILE]);
switchListeners(flags[StatusKind._PORT_PROFILE],
- m_observed[StatusKind._PORT_PROFILE],
+ bflag,
this,
"setPortProfileListeners",
"unsetPortProfileListeners");
+ m_observed[StatusKind._PORT_PROFILE] = bflag.v.booleanValue();
+
+ bflag.v = new Boolean(m_observed[StatusKind._CONFIGURATION]);
switchListeners(flags[StatusKind._CONFIGURATION],
- m_observed[StatusKind._CONFIGURATION],
+ bflag,
this,
"setConfigurationListeners",
"unsetConfigurationListeners");
+ m_observed[StatusKind._CONFIGURATION] = bflag.v.booleanValue();
}
@@ -218,11 +234,11 @@
* {@.en Switching listeners connecting/disconnecting}
*/
protected <DataType>
- void switchListeners(boolean next, boolean pre,
+ void switchListeners(boolean next, DataRef<Boolean> pre,
DataType obj,
String setfunc,
String unsetfunc) {
- if (!pre && next) {
+ if (!pre.v.booleanValue() && next) {
try {
Class clazz = obj.getClass();
Method method = clazz.getMethod(setfunc,null);
@@ -232,9 +248,9 @@
// rtcout.println(Logbuf.WARN,
// "Exception caught."+e.toString());
}
- pre = true;
+ pre.v = new Boolean(true);
}
- else if (pre && !next) {
+ else if (pre.v.booleanValue() && !next) {
try {
Class clazz = obj.getClass();
Method method = clazz.getMethod(unsetfunc,null);
@@ -244,7 +260,7 @@
// rtcout.println(Logbuf.WARN,
// "Exception caught."+e.toString());
}
- pre = false;
+ pre.v = new Boolean(false);
}
}
openrtm-commit メーリングリストの案内