[openrtm-commit:01298] r2493 - branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 2月 15日 (土) 03:28:11 JST
Author: win-ei
Date: 2014-02-15 03:28:11 +0900 (Sat, 15 Feb 2014)
New Revision: 2493
Added:
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.h
Modified:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am
Log:
Daily work.
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-14 18:26:36 UTC (rev 2492)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/Makefile.am 2014-02-14 18:28:11 UTC (rev 2493)
@@ -51,7 +51,7 @@
libstubs_a_SOURCES += MultiModeComponentActionImpl.cpp
libstubs_a_SOURCES += OrganizationImpl.cpp
libstubs_a_SOURCES += SDOSystemElementImpl.cpp
-#libstubs_a_SOURCES += SDOImpl.cpp
+libstubs_a_SOURCES += SDOImpl.cpp
stubsdir = .
noinst_LIBRARIES = libstubs.a
Added: 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 (rev 0)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.cpp 2014-02-14 18:28:11 UTC (rev 2493)
@@ -0,0 +1,202 @@
+// -*- C++ -*-
+/*!
+ * @file SDOImpl.h
+ * @brief SDOImpl C++ implementation sample for doil
+ * @date $Date$
+ * @author
+ *
+ * $Id$
+ */
+
+
+#include <stdio.h>
+#include <SDOImpl.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <Logger.h>
+
+namespace UnitTest
+{
+namespace Servant
+{
+ /*!
+ * @if jp
+ * @class SDOImpl
+ * @brief SDOServant試験用インプリメントクラス
+ * @else
+ * @class SDOImpl
+ * @brief SDO implementation class for LightweightRTObjecServant' unittest.
+ * @endif
+ */
+ int SDOImpl::count = 0;
+
+ SDOImpl::SDOImpl()
+ {
+ ++count;
+ m_logger = new Logger();
+ }
+ SDOImpl::SDOImpl(Logger& aLogger)
+ {
+ ++count;
+ m_logger = &aLogger;
+ }
+
+ SDOImpl::~SDOImpl()
+ {
+ }
+
+ ::std::string SDOImpl::get_sdo_id()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_sdo_id");
+ }
+ return "bar";
+ }
+
+ ::std::string SDOImpl::get_sdo_type()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_sdo_type");
+ }
+ return "bar";
+ }
+
+ ::SDOPackage::Local::DeviceProfile SDOImpl::get_device_profile()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_device_profile");
+ }
+ ::SDOPackage::Local::DeviceProfile prof;
+ return prof;
+ }
+
+ ::SDOPackage::Local::ServiceProfileList SDOImpl::get_service_profiles()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_service_profiles");
+ }
+ ::SDOPackage::Local::ServiceProfileList profs;
+ return profs;
+ }
+
+ ::SDOPackage::Local::ServiceProfile SDOImpl::get_service_profile(const ::std::string& id)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_service_profile");
+ }
+ ::SDOPackage::Local::ServiceProfile prof;
+ return prof;
+ }
+
+ ::SDOPackage::Local::ISDOService* SDOImpl::get_sdo_service(const ::std::string& id)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_sdo_service");
+ }
+ ::SDOPackage::Local::ISDOService* ret;
+ return ret;
+ }
+
+ ::SDOPackage::Local::IConfiguration* SDOImpl::get_configuration()
+ throw (::SDOPackage::Local::InterfaceNotImplemented,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_configuration");
+ }
+ ::SDOPackage::Local::IConfiguration* ret;
+ return ret;
+ }
+
+ ::SDOPackage::Local::IMonitoring* SDOImpl::get_monitoring()
+ throw (::SDOPackage::Local::InterfaceNotImplemented,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_monitoring");
+ }
+ ::SDOPackage::Local::IMonitoring* ret;
+ return ret;
+ }
+
+ ::SDOPackage::Local::OrganizationList SDOImpl::get_organizations()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_organizations");
+ }
+ ::SDOPackage::Local::OrganizationList ret;
+ return ret;
+ }
+
+ ::SDOPackage::Local::NVList SDOImpl::get_status_list()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_status_list");
+ }
+ ::SDOPackage::Local::NVList ret;
+ return ret;
+ }
+
+
+ ::std::string SDOImpl::get_status(const ::std::string& nme)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_status");
+ }
+ return "bar";
+ }
+
+
+ //
+ ::SDOPackage::Local::OrganizationList SDOImpl::get_owned_organizations()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ if (m_logger != NULL)
+ {
+ m_logger->push("get_owned_organizations");
+ }
+ ::SDOPackage::Local::OrganizationList ret;
+ return ret;
+ }
+
+
+
+
+}; // namespace Local
+}; // namespace SDOPackage
Added: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.h
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.h (rev 0)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/unitTest/stubs/SDOImpl.h 2014-02-14 18:28:11 UTC (rev 2493)
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+/*!
+ * @file SDOImpl.h
+ * @brief SDOImpl C++ implementation sample for doil
+ * @date $Date$
+ * @author
+ *
+ * $Id$
+ */
+
+#ifndef SDO_IMPL_H
+#define SDO_IMPL_H
+
+
+#include <doil/ImplBase.h>
+#include <ISDO.h>
+#include <ISDOSystemElement.h>
+#include <Logger.h>
+
+namespace UnitTest
+{
+namespace Servant
+{
+
+ /*!
+ * @if jp
+ * @class SDOImpl
+ * @brief SDO試験用インプリメントクラス
+ * @else
+ * @class SDOImpl
+ * @brief SDO implementation class for SDOServant' unittest.
+ * @endif
+ */
+
+ class SDOImpl
+ : public virtual doil::ImplBase,
+ public virtual SDOPackage::Local::ISDO,
+ public virtual ::SDOPackage::Local::ISDOSystemElement
+
+ {
+ public:
+ SDOImpl();
+ SDOImpl(Logger& aLogger);
+
+ virtual ~SDOImpl();
+
+ virtual ::std::string get_sdo_id()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::std::string get_sdo_type()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::DeviceProfile get_device_profile()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::ServiceProfileList get_service_profiles()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::ServiceProfile get_service_profile(const ::std::string& id)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::ISDOService* get_sdo_service(const ::std::string& id)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::IConfiguration* get_configuration()
+ throw (::SDOPackage::Local::InterfaceNotImplemented,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::IMonitoring* get_monitoring()
+ throw (::SDOPackage::Local::InterfaceNotImplemented,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::OrganizationList get_organizations()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::SDOPackage::Local::NVList get_status_list()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ virtual ::std::string get_status(const ::std::string& nme)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ //
+ virtual ::SDOPackage::Local::OrganizationList get_owned_organizations()
+ throw (::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+
+ const char* id() { return "SDO"; }
+ 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 //
More information about the openrtm-commit
mailing list