[openrtm-commit:01237] r2432 - in branches/work_ForDoil/OpenRTM-aist/src/lib/doil: . corba utils/omniidl_be/tests utils/omniidl_be/tests/ConfigurationProxy
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 2月 11日 (火) 15:52:09 JST
Author: win-ei
Date: 2014-02-11 15:52:09 +0900 (Tue, 11 Feb 2014)
New Revision: 2432
Modified:
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/ObjectManager.h
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/corba/CORBAManager.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.cpp
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.h
branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy/ConfigurationProxyTests.cpp
Log:
Daily work.
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/ObjectManager.h
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/ObjectManager.h 2014-02-11 05:00:15 UTC (rev 2431)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/ObjectManager.h 2014-02-11 06:52:09 UTC (rev 2432)
@@ -119,7 +119,7 @@
{
ObjectVectorItr it;
Guard guard(m_objects._mutex);
-
+
it = std::find_if(m_objects._obj.begin(), m_objects._obj.end(),
Predicate(obj));
if (it == m_objects._obj.end())
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/corba/CORBAManager.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/corba/CORBAManager.cpp 2014-02-11 05:00:15 UTC (rev 2431)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/corba/CORBAManager.cpp 2014-02-11 06:52:09 UTC (rev 2432)
@@ -191,8 +191,8 @@
if (impl == NULL) return INVALID_ARGS;
const char* id = impl->id();
- std::cout << "CORBAManager::activateObject: id " << id << std::endl;
- std::cout << "CORBAManager::activateObject: name " << impl->name() << std::endl;
+ //std::cout << "CORBAManager::activateObject: id " << id << std::endl;
+ //std::cout << "CORBAManager::activateObject: name " << impl->name() << std::endl;
ServantFactory* factory = m_factory.find(id);
#if 0
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy/ConfigurationProxyTests.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy/ConfigurationProxyTests.cpp 2014-02-11 05:00:15 UTC (rev 2431)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy/ConfigurationProxyTests.cpp 2014-02-11 06:52:09 UTC (rev 2432)
@@ -250,6 +250,14 @@
{
return "IOrganizationMock";
}
+ virtual bool add_organization_property(const ::SDOPackage::Local::OrganizationProperty& organization_property)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ return true;
+ }
+/*
virtual bool set_organization_property(const ::SDOPackage::Local::OrganizationProperty& organization_property)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
@@ -257,6 +265,7 @@
{
return true;
}
+*/
virtual bool set_organization_property_value(const ::std::string&name, const ::std::string& value)
throw (::SDOPackage::Local::InvalidParameter,
@@ -411,7 +420,6 @@
/*!
*
*/
-/*
::CORBA::Boolean set_service_profile(const ::SDOPackage::ServiceProfile& sProfile)
throw (CORBA::SystemException,
::SDOPackage::InvalidParameter,
@@ -421,7 +429,6 @@
if (m_logger != NULL) m_logger->log("set_service_profile");
return true;
}
-*/
/*!
*
*/
@@ -777,7 +784,8 @@
{
CPPUNIT_TEST_SUITE(ConfigurationProxyTests);
CPPUNIT_TEST(test_set_device_profile);
- CPPUNIT_TEST(test_set_service_profile);
+ //CPPUNIT_TEST(test_set_service_profile);
+ CPPUNIT_TEST(test_add_service_profile);
CPPUNIT_TEST(test_add_organization);
CPPUNIT_TEST(test_remove_service_profile);
CPPUNIT_TEST(test_remove_organization);
@@ -869,8 +877,10 @@
*
*
*/
+/*
void test_set_service_profile()
{
+ std::cout <<"test_set_service_profile() entry "<<std::endl;
doil::CORBA::CORBAManager&
mgr(doil::CORBA::CORBAManager::instance());
std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
@@ -882,41 +892,97 @@
std::cout<<"ref is nil.Abort test."<<std::endl;
return;
}
+
+ std::cout <<"test_set_service_profile() ref: "<<ref<<std::endl;
::SDOPackage::CORBA::ConfigurationProxy* ap
= new ::SDOPackage::CORBA::ConfigurationProxy(ref);
Logger logger;
obj->setLogger(&logger);
+ std::cout <<"test_set_service_profile() 030 "<<std::endl;
CPPUNIT_ASSERT_EQUAL(0, logger.countLog("set_service_profile"));
::SDOPackage::Local::ServiceProfile porf;
ISDOServiceMock service;
+ std::cout <<"test_set_service_profile() 040 "<<std::endl;
mgr.registerFactory(service.id(),
doil::New<ISDOServiceServantMock>,
doil::Delete<ISDOServiceServantMock>);
+ std::cout <<"test_set_service_profile() 050 "<<std::endl;
mgr.activateObject(&service);
porf.service = &service;
const ::SDOPackage::Local::ServiceProfile _porf = porf;
+ std::cout <<"test_set_service_profile() 060 "<<std::endl;
ap->set_service_profile(_porf);
+ std::cout <<"test_set_service_profile() 070 "<<std::endl;
CPPUNIT_ASSERT_EQUAL(1, logger.countLog("set_service_profile"));
+ std::cout <<"test_set_service_profile() 080 "<<std::endl;
mgr.deactivateObject(&service);
+ std::cout <<"test_set_service_profile() 080 "<<std::endl;
delete ap;
CORBA::release(ref);
+ mgr.shutdown();
+ std::cout <<"test_set_service_profile() ret "<<std::endl;
}
+*/
/*!
*
*
*
*/
+ void test_add_service_profile()
+ {
+ doil::CORBA::CORBAManager&
+ mgr(doil::CORBA::CORBAManager::instance());
+ //std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
+
+ ConfigurationMock* obj = new ConfigurationMock();
+ ::CORBA::Object_ptr ref = obj->_this();
+ if(::CORBA::is_nil(ref))
+ {
+ std::cout<<"ref is nil.Abort test."<<std::endl;
+ return;
+ }
+
+ ::SDOPackage::CORBA::ConfigurationProxy* ap
+ = new ::SDOPackage::CORBA::ConfigurationProxy(ref);
+
+ Logger logger;
+ obj->setLogger(&logger);
+
+ CPPUNIT_ASSERT_EQUAL(0, logger.countLog("add_service_profile"));
+ ::SDOPackage::Local::ServiceProfile porf;
+ ISDOServiceMock service;
+
+ mgr.registerFactory(service.id(),
+ doil::New<ISDOServiceServantMock>,
+ doil::Delete<ISDOServiceServantMock>);
+ mgr.activateObject(&service);
+
+ porf.service = &service;
+ const ::SDOPackage::Local::ServiceProfile _porf = porf;
+ ap->add_service_profile(_porf);
+ CPPUNIT_ASSERT_EQUAL(1, logger.countLog("add_service_profile"));
+
+ mgr.deactivateObject(&service);
+
+ delete ap;
+ CORBA::release(ref);
+ }
+ /*!
+ *
+ *
+ *
+ */
void test_add_organization()
{
doil::CORBA::CORBAManager&
mgr(doil::CORBA::CORBAManager::instance());
- std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
+ //std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
ConfigurationMock* obj = new ConfigurationMock();
::CORBA::Object_ptr ref = obj->_this();
@@ -1013,7 +1079,6 @@
*/
void test_get_configuration_parameters()
{
-std::cout<<"test_get_configuration_parameters"<<std::endl;
ConfigurationMock* obj = new ConfigurationMock();
::CORBA::Object_ptr ref = obj->_this();
if(::CORBA::is_nil(ref))
@@ -1263,11 +1328,12 @@
CPPUNIT_ASSERT_EQUAL(0,
logger.countLog("set_configuration_set_values"));
- CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str));
- ap->set_configuration_set_values(str,configuration_set);
+ //CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str));
+ //ap->set_configuration_set_values(str,configuration_set);
+ ap->set_configuration_set_values(configuration_set);
CPPUNIT_ASSERT_EQUAL(1,
logger.countLog("set_configuration_set_values"));
- CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str));
+ //CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str));
delete ap;
CORBA::release(ref);
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.cpp
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.cpp 2014-02-11 05:00:15 UTC (rev 2431)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.cpp 2014-02-11 06:52:09 UTC (rev 2432)
@@ -71,6 +71,7 @@
/*!
* @brief set_service_profile
*/
+/*
bool ConfigurationProxy::set_service_profile(const ::SDOPackage::Local::ServiceProfile& sProfile)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
@@ -94,7 +95,33 @@
corba_to_local(corba_ret, local_ret);
return local_ret;
}
+*/
+ /*!
+ * @brief add_service_profile
+ */
+ bool ConfigurationProxy::add_service_profile(const ::SDOPackage::Local::ServiceProfile& sProfile)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError)
+ {
+ // Convert Local to CORBA.
+ // (The direction of the argument is 'in' or 'inout'.)
+ ::SDOPackage::ServiceProfile _sProfile;
+ local_to_corba(sProfile, _sProfile);
+ // Execute the method.
+ ::CORBA::Boolean corba_ret;
+ bool local_ret;
+ corba_ret = m_obj->add_service_profile(_sProfile);
+
+ // Convert CORBA to Local.
+ // (The direction of the argument is 'out' or 'inout'.)
+
+ // Generate the return value.
+// local_ret = corba_ret;
+ corba_to_local(corba_ret, local_ret);
+ return local_ret;
+ }
/*!
* @brief add_organization
*/
@@ -332,22 +359,24 @@
/*!
* @brief set_configuration_set_values
*/
- bool ConfigurationProxy::set_configuration_set_values(const ::std::string& config_id, const ::SDOPackage::Local::ConfigurationSet& configuration_set)
+ //bool ConfigurationProxy::set_configuration_set_values(const ::std::string& config_id, const ::SDOPackage::Local::ConfigurationSet& configuration_set)
+ bool ConfigurationProxy::set_configuration_set_values(const ::SDOPackage::Local::ConfigurationSet& configuration_set)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
::SDOPackage::Local::InternalError)
{
// Convert Local to CORBA.
// (The direction of the argument is 'in' or 'inout'.)
- char* _config_id;
+ //char* _config_id;
::SDOPackage::ConfigurationSet _configuration_set;
- local_to_corba(config_id, _config_id);
+ //local_to_corba(config_id, _config_id);
local_to_corba(configuration_set, _configuration_set);
// Execute the method.
::CORBA::Boolean corba_ret;
bool local_ret;
- corba_ret = m_obj->set_configuration_set_values(_config_id, _configuration_set);
+ //corba_ret = m_obj->set_configuration_set_values(_config_id, _configuration_set);
+ corba_ret = m_obj->set_configuration_set_values(_configuration_set);
// Convert CORBA to Local.
// (The direction of the argument is 'out' or 'inout'.)
Modified: branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.h
===================================================================
--- branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.h 2014-02-11 05:00:15 UTC (rev 2431)
+++ branches/work_ForDoil/OpenRTM-aist/src/lib/doil/utils/omniidl_be/tests/ConfigurationProxy.h 2014-02-11 06:52:09 UTC (rev 2432)
@@ -39,13 +39,17 @@
::SDOPackage::Local::NotAvailable,
::SDOPackage::Local::InternalError);
-
+ virtual bool add_service_profile(const ::SDOPackage::Local::ServiceProfile& sProfile)
+ throw (::SDOPackage::Local::InvalidParameter,
+ ::SDOPackage::Local::NotAvailable,
+ ::SDOPackage::Local::InternalError);
+/*
virtual bool set_service_profile(const ::SDOPackage::Local::ServiceProfile& sProfile)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
::SDOPackage::Local::InternalError);
+*/
-
virtual bool add_organization(const ::SDOPackage::Local::IOrganization* org)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
@@ -96,7 +100,8 @@
::SDOPackage::Local::InternalError);
- virtual bool set_configuration_set_values(const ::std::string& config_id, const ::SDOPackage::Local::ConfigurationSet& configuration_set)
+ //virtual bool set_configuration_set_values(const ::std::string& config_id, const ::SDOPackage::Local::ConfigurationSet& configuration_set)
+ virtual bool set_configuration_set_values(const ::SDOPackage::Local::ConfigurationSet& configuration_set)
throw (::SDOPackage::Local::InvalidParameter,
::SDOPackage::Local::NotAvailable,
::SDOPackage::Local::InternalError);
More information about the openrtm-commit
mailing list