Changeset 11712 for trunk


Ignore:
Timestamp:
07/30/11 16:04:05 (13 years ago)
Author:
tbretz
Message:
Added function to return the FormatList suitable for CCfits.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Converter.cc

    r11702 r11712  
    10141014}
    10151015
     1016vector<string> Converter::GetFitsFormat() const
     1017{
     1018    //we've got a nice structure describing the format of this service's messages.
     1019    //Let's create the appropriate FITS columns
     1020    vector<string> vec;
     1021    for (FormatList::const_iterator it=fList.begin(); it!=fList.end(); it++)
     1022    {
     1023         ostringstream dataQualifier;
     1024         dataQualifier << it->second.first;
     1025
     1026         switch (it->first.first->name()[0])
     1027         {
     1028         case 'c': dataQualifier << 'B'; break;
     1029         case 's': dataQualifier << 'I'; break;
     1030         case 'i': dataQualifier << 'J'; break;
     1031         case 'l': dataQualifier << 'J'; break;
     1032         case 'f': dataQualifier << 'E'; break;
     1033         case 'd': dataQualifier << 'D'; break;
     1034         case 'x': dataQualifier << 'K'; break;
     1035         case 'v':
     1036         case 'S': //we skip the variable length strings
     1037             continue;
     1038
     1039         default:
     1040             throw runtime_error("GetFitsFormat - unknown FITS format.");
     1041         };
     1042
     1043         vec.push_back(dataQualifier.str());
     1044    }
     1045
     1046    return vec;
     1047}
    10161048
    10171049void Converter::Print(std::ostream &out) const
  • trunk/FACT++/src/Converter.h

    r11702 r11712  
    101101
    102102    std::vector<char> ToFits(const void* src, size_t size) const;
     103    std::vector<std::string> GetFitsFormat() const;
    103104
    104105    static std::string ToFormat(const std::vector<std::string> &fits);
Note: See TracChangeset for help on using the changeset viewer.