Conversion.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef DBUS_CONVERSION_H_
00029 #define DBUS_CONVERSION_H_
00030 #include <map>
00031 #include <string>
00032 #include <casa/Containers/Record.h>
00033 #if defined(DBUS_CPP)
00034 #include <dbus-cpp/dbus.h>
00035 #else
00036 #include <dbus-c++/dbus.h>
00037 #endif
00038 #include <casadbus/types/variant.h>
00039 #include <casadbus/types/record.h>
00040 #include <casa/Arrays/Vector.h>
00041 
00042 namespace casa {
00043 
00044     namespace dbus {
00045                 Record toRecord( const std::map<std::string,DBus::Variant> &mapIn );
00046                 std::map<std::string,DBus::Variant> fromRecord( const Record &record );
00047 
00048                 variant toVariant( const DBus::Variant &src );
00049 
00050                 std::map<std::string,variant> toStdMap( const std::map<std::string,DBus::Variant> &src );
00051                 std::map<std::string,DBus::Variant> fromStdMap( const std::map<std::string,variant> &src );
00052 
00053                 DBus::Variant fromVariant( const variant &src );
00054                 void show( const variant &v );
00055 
00056                 template<class t> std::vector<double> af( const Vector<t> &other ) {
00057                         std::vector<double> result(other.nelements( ));
00058                         for (unsigned int x=0; x < result.size(); ++x)
00059                                 result[x] = (double) other[x];
00060                         return result;
00061                 }
00062     }
00063 }
00064 
00065 #endif