• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

baciCORBAMem.h

Go to the documentation of this file.
00001 #ifndef _baciCORBAMem_H_
00002 #define _baciCORBAMem_H_
00003 
00004 /*
00005  * ALMA - Atacama Large Millimiter Array
00006  * (c) European Southern Observatory, 2003 
00007  *
00008  *This library is free software; you can redistribute it and/or
00009  *modify it under the terms of the GNU Lesser General Public
00010  *License as published by the Free Software Foundation; either
00011  *version 2.1 of the License, or (at your option) any later version.
00012  *
00013  *This library is distributed in the hope that it will be useful,
00014  *but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  *Lesser General Public License for more details.
00017  *
00018  *You should have received a copy of the GNU Lesser General Public
00019  *License along with this library; if not, write to the Free Software
00020  *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00021 */
00022 
00028 template<class O, class I=O>
00029 class CORBAMem {
00030   public:
00031     static O addToArry(I&v){ return v; }
00032     static O retn(I&v){ return v; } 
00033 #ifndef XXXMAKE_VXWORKS
00034 //    static O retn(I&); 
00035 #else
00036 //    static double retn(double& v){ return v; }
00037 #endif //MAKE_VXWORKS
00038 };
00039 
00040 template<class O, class I>
00041 class CORBAMem <O*, I>{
00042   public:
00043     static O* retn(I& v){ return new O(v);}
00044     static O addToArry(I& v){ return v;}
00045 };
00046 
00047 template<>
00048 class CORBAMem <char*, ACE_CString>{
00049   public:
00050     static char* retn(ACE_CString& v){ return CORBA::string_dup(v.c_str()); }
00051     static char* addToArry(ACE_CString& v){ return CORBA::string_dup(v.c_str()); }
00052 };
00053 
00054 #if 0
00055 template<class O, class I>
00056 O CORBAMem<O, I>::retn(I& v)
00057 { 
00058     return v; 
00059 }
00060 /*
00061 template<>
00062 char* CORBAMem<char*, ACE_CString>::toHistory(ACE_CString& v);
00063 */
00064 template<class O, class I>
00065 O CORBAMem<O*, I>::toHistory(I& v)
00066 { 
00067     return v; 
00068 }
00069 
00070 template<class O, class I>
00071 O* CORBAMem<O*, I>::retn(I& v)
00072 {
00073     return new O(v);
00074 }
00075 /*
00076 template<>
00077 char* CORBAMem<char*, ACE_CString>::retn(ACE_CString& v);
00078 */
00079 
00080 
00081 #endif //MAKE_VXWORKS
00082 
00083 #endif

Generated on Thu Jan 12 2012 23:13:50 for ACS-10.0 C++ API by  doxygen 1.7.0