SeqTypeConversion.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00020 #ifndef DOIL_CORBA_SEQTYPECONVERSION_H
00021 #define DOIL_CORBA_SEQTYPECONVERSION_H
00022 
00023 #include <coil/stringutil.h>
00024 #include <doil/corba/CORBA.h>
00025 #include <string>
00026 #include <vector>
00027 
00028 //-------------------------------------------------------------
00029 // local -> corba
00030 template <typename LocalSeq, typename LocalElement,
00031           typename CORBASeq, typename CORBAElement>
00032 bool local_to_corba_seq(const LocalSeq& _from, CORBASeq& _to)
00033 {
00034   long int len(_from.size());
00035   _to.length((::CORBA::Long)len);
00036   for (long int i(0); i < len; ++i)
00037     {
00038       if (!local_to_corba(_from[i], _to[i])) return false;
00039     }
00040   return true;
00041 }
00042 
00043 
00044 template <typename CORBASeq, typename CORBAType,
00045           typename LocalSeq, typename LocalType>
00046 bool corba_to_local_seq(const CORBASeq& _from, LocalSeq& _to)
00047 {
00048   ::CORBA::Long len(_from.length());
00049   _to.resize((long)len);
00050   for (::CORBA::Long i(0); i < len; ++i)
00051     {
00052       if (!corba_to_local(_from[i], _to[i]))
00053         return false;
00054     }
00055   return true;
00056 }
00057 
00058 #endif // DOIL_CORBA_SEQTYPECONVERSION_H


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:07