SeqTypeConversion.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef DOIL_CORBA_SEQTYPECONVERSION_H
21 #define DOIL_CORBA_SEQTYPECONVERSION_H
22 
23 #include <coil/stringutil.h>
24 #include <doil/corba/CORBA.h>
25 #include <string>
26 #include <vector>
27 
28 //-------------------------------------------------------------
29 // local -> corba
30 template <typename LocalSeq, typename LocalElement,
31  typename CORBASeq, typename CORBAElement>
32 bool local_to_corba_seq(const LocalSeq& _from, CORBASeq& _to)
33 {
34  long int len(_from.size());
35  _to.length((::CORBA::Long)len);
36  for (long int i(0); i < len; ++i)
37  {
38  if (!local_to_corba(_from[i], _to[i])) return false;
39  }
40  return true;
41 }
42 
43 
44 template <typename CORBASeq, typename CORBAType,
45  typename LocalSeq, typename LocalType>
46 bool corba_to_local_seq(const CORBASeq& _from, LocalSeq& _to)
47 {
48  ::CORBA::Long len(_from.length());
49  _to.resize((long)len);
50  for (::CORBA::Long i(0); i < len; ++i)
51  {
52  if (!corba_to_local(_from[i], _to[i]))
53  return false;
54  }
55  return true;
56 }
57 
58 #endif // DOIL_CORBA_SEQTYPECONVERSION_H
bool local_to_corba(const short int _from,::CORBA::Short &_to)
bool corba_to_local_seq(const CORBASeq &_from, LocalSeq &_to)
bool local_to_corba_seq(const LocalSeq &_from, CORBASeq &_to)
bool corba_to_local(const ::CORBA::Short _from, short &_to)
doil CORBA header


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:56