[openrtm-commit:01302] r2497 - branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 2月 15日 (土) 18:01:19 JST
Author: win-ei
Date: 2014-02-15 18:01:19 +0900 (Sat, 15 Feb 2014)
New Revision: 2497
Added:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.h
Modified:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ConfigurationImpl.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOServiceImpl.cpp
Log:
Daily work.
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ConfigurationImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ConfigurationImpl.cpp 2014-02-15 06:10:01 UTC (rev 2496)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/ConfigurationImpl.cpp 2014-02-15 09:01:19 UTC (rev 2497)
@@ -31,7 +31,8 @@
ConfigurationImpl::ConfigurationImpl()
{
- sprintf(m_name, "%s%d", id(), count);
+ //sprintf(m_name, "%s%d", id(), count);
+ sprintf(m_name, "%s", id());
++count;
m_logger = new Logger();
// std::cout << "ConfigrationImpl: " << name() << " created." << std::endl;
@@ -39,7 +40,8 @@
ConfigurationImpl::ConfigurationImpl(Logger& aLogger)
{
- sprintf(m_name, "%s%d", id(), count);
+ //sprintf(m_name, "%s%d", id(), count);
+ sprintf(m_name, "%s", id());
++count;
m_logger = &aLogger;
// std::cout << "ConfigrationImpl: " << name() << " created." << std::endl;
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am 2014-02-15 06:10:01 UTC (rev 2496)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am 2014-02-15 09:01:19 UTC (rev 2497)
@@ -54,6 +54,7 @@
libstubs_a_SOURCES += SDOImpl.cpp
libstubs_a_SOURCES += RTObjectImpl.cpp
libstubs_a_SOURCES += PortServiceImpl.cpp
+libstubs_a_SOURCES += MonitoringImpl.cpp
stubsdir = .
noinst_LIBRARIES = libstubs.a
Added: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.cpp (rev 0)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.cpp 2014-02-15 09:01:19 UTC (rev 2497)
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+/*!
+ * @file MonitoringImpl.h
+ * @brief MonitoringImpl C++ implementation sample for doil
+ * @date $Date$
+ * @author
+ *
+ * $Id$
+ */
+
+
+#include <stdio.h>
+#include <MonitoringImpl.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <Logger.h>
+
+namespace UnitTest
+{
+namespace Servant
+{
+ /*!
+ * @if jp
+ * @class MonitoringImpl
+ * @brief MonitoringServant試験用インプリメントクラス
+ * @else
+ * @class MonitoringImpl
+ * @brief Monitoring implementation class for LightweightRTObjecServant' unittest.
+ * @endif
+ */
+ int MonitoringImpl::count = 0;
+
+ MonitoringImpl::MonitoringImpl()
+ {
+ sprintf(m_name, "%s", id());
+ ++count;
+ m_logger = new Logger();
+ }
+ MonitoringImpl::MonitoringImpl(Logger& aLogger)
+ {
+ sprintf(m_name, "%s", id());
+ ++count;
+ m_logger = &aLogger;
+ }
+
+ MonitoringImpl::~MonitoringImpl()
+ {
+ }
+
+
+
+
+
+
+
+
+}; // namespace Local
+}; // namespace SDOPackage
Added: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.h
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.h (rev 0)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/MonitoringImpl.h 2014-02-15 09:01:19 UTC (rev 2497)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+/*!
+ * @file MonitoringImpl.h
+ * @brief MonitoringImpl C++ implementation sample for doil
+ * @date $Date$
+ * @author
+ *
+ * $Id$
+ */
+
+#ifndef MONITORING_IMPL_H
+#define MONITORING_IMPL_H
+
+
+#include <doil/ImplBase.h>
+#include <IMonitoring.h>
+#include <Logger.h>
+
+namespace UnitTest
+{
+namespace Servant
+{
+
+ /*!
+ * @if jp
+ * @class MonitoringImpl
+ * @brief Monitoring試験用インプリメントクラス
+ * @else
+ * @class MonitoringImpl
+ * @brief Monitoring implementation class for MonitoringServant' unittest.
+ * @endif
+ */
+
+ class MonitoringImpl
+ : public virtual doil::ImplBase,
+ public virtual ::SDOPackage::Local::IMonitoring
+
+ {
+ public:
+ MonitoringImpl();
+ MonitoringImpl(Logger& aLogger);
+
+ virtual ~MonitoringImpl();
+
+
+
+ const char* id() { return "Monitoring"; }
+ const char* name() { return m_name; }
+ void incRef() { refcount++; }
+ void decRef() { refcount--; }
+ private:
+ static int count;
+ char m_name[32];
+ int refcount;
+ Logger *m_logger;
+ };
+
+}; // namespace Servant
+}; // namespace UnitTest
+
+#endif //
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.cpp 2014-02-15 06:10:01 UTC (rev 2496)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.cpp 2014-02-15 09:01:19 UTC (rev 2497)
@@ -13,6 +13,7 @@
#include <SDOImpl.h>
#include <SDOServiceImpl.h>
#include <ConfigurationImpl.h>
+#include <MonitoringImpl.h>
#include <iostream>
#include <sstream>
#include <string>
@@ -35,12 +36,14 @@
SDOImpl::SDOImpl()
{
+ sprintf(m_name, "%s", id());
++count;
m_logger = new Logger();
m_sdos = new UnitTest::Servant::SDOServiceImpl();
}
SDOImpl::SDOImpl(Logger& aLogger)
{
+ sprintf(m_name, "%s", id());
++count;
m_logger = &aLogger;
}
@@ -115,7 +118,9 @@
prof.interface_type = "bar";
prof.properties.push_back(nv);
prof.service = m_sdos;
+ prof.service = new UnitTest::Servant::SDOServiceImpl();
std::cout<<"3:"<<prof.service<<std::endl;
+std::cout<<"3:"<<prof.service->name()<<std::endl;
return prof;
}
@@ -128,9 +133,7 @@
{
m_logger->push("get_sdo_service");
}
- ::SDOPackage::Local::ISDOService* ret = m_sdos;
- return m_sdos;
- return ret;
+ return new UnitTest::Servant::SDOServiceImpl();
}
::SDOPackage::Local::IConfiguration* SDOImpl::get_configuration()
@@ -155,7 +158,7 @@
{
m_logger->push("get_monitoring");
}
- ::SDOPackage::Local::IMonitoring* ret;
+ ::SDOPackage::Local::IMonitoring* ret = new UnitTest::Servant::MonitoringImpl();
return ret;
}
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOServiceImpl.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOServiceImpl.cpp 2014-02-15 06:10:01 UTC (rev 2496)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOServiceImpl.cpp 2014-02-15 09:01:19 UTC (rev 2497)
@@ -33,11 +33,15 @@
SDOServiceImpl::SDOServiceImpl()
{
+ //sprintf(m_name, "%s%d", id(), count);
+ sprintf(m_name, "%s", id());
++count;
m_logger = new Logger();
}
SDOServiceImpl::SDOServiceImpl(Logger& aLogger)
{
+ //sprintf(m_name, "%s%d", id(), count);
+ sprintf(m_name, "%s", id());
++count;
m_logger = &aLogger;
}
More information about the openrtm-commit
mailing list