util.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00020 #ifndef RTC_CORBA_UTIL_H
00021 #define RTC_CORBA_UTIL_H
00022 
00023 #include <rtc/IRTC.h>
00024 #include <rtc/corba/idl/RTCSkel.h>
00025 #include <doil/ImplBase.h>
00026 #include <assert.h>
00027 
00028 
00029 namespace RTC
00030 {
00031 namespace CORBA
00032 {
00033   template <typename Local, typename Remote>
00034   bool to_remote(Local* lobj, Remote* robj)
00035   {
00036     ::doil::ImplBase* l;
00037     l = dynamic_cast<doil::ImplBase*>(lobj);
00038     if (l != NULL) return false;
00039     ::CORBA::Object_ptr r;
00040     r = doil::CORBA::CORBAManager::instance().toReference(l);
00041     if (!::CORBA::is_nil(r)) return false;
00042     robj = Remote::_narrow(r);
00043     return true;
00044   }
00045 
00049   inline RTC::Local::ReturnCode_t to_local(RTC::ReturnCode_t x)
00050   {
00051     return RTC::Local::ReturnCode_t((int)x);
00052   }
00053 
00057   inline RTC::ReturnCode_t to_remote(RTC::Local::ReturnCode_t x)
00058   {
00059     return RTC::ReturnCode_t((int)x);
00060   }
00061 
00065   inline RTC::Local::ExecutionKind to_local(RTC::ExecutionKind x)
00066   {
00067     return RTC::Local::ExecutionKind((int)x);
00068   }
00069 
00073   inline RTC::ExecutionKind to_remote(RTC::Local::ExecutionKind x)
00074   {
00075     return RTC::ExecutionKind((int)x);
00076   }
00077   
00081   inline RTC::Local::PortInterfacePolarity
00082   to_local(RTC::PortInterfacePolarity x)
00083   {
00084     return RTC::Local::PortInterfacePolarity((int)x);
00085   }
00086 
00090   inline RTC::PortInterfacePolarity to_remote(RTC::Local::PortInterfacePolarity x)
00091   {
00092     return RTC::PortInterfacePolarity((int)x);
00093   }
00094 
00098   inline RTC::Local::LifeCycleState
00099   to_local(RTC::LifeCycleState x)
00100   {
00101     return RTC::Local::LifeCycleState((int)x);
00102   }
00103 
00107   inline RTC::LifeCycleState to_remote(RTC::Local::LifeCycleState x)
00108   {
00109     return RTC::LifeCycleState((int)x);
00110   }
00111 
00112 
00113 
00114   inline RTC::Local::ExecutionContextProfile to_local(RTC::ExecutionContextProfile x)
00115   {
00116     RTC::Local::ExecutionContextProfile l;
00117     l.kind = to_local(x.kind);
00118     l.rate = x.rate;
00119     //    l.owner = NULL;
00120     //    l.participoants = 
00121     // properties =
00122     return l;
00123   }
00124 
00125 };
00126 };
00127 #endif // RTC_CORBA_UTIL_H


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sun Mar 26 2017 03:37:17