Ignore:
Timestamp:
10/07/10 16:17:04 (14 years ago)
Author:
hozdoba
Message:

suite du précédent commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp

    r126 r127  
    8686   { _hasValue = true ; value.resize(val.shape()); value = val ; } 
    8787 
     88#define PRINT_ARRAY(type)                                             \ 
     89   template <>                                                        \ 
     90      ostream& Attribut<Array<type, 1> >::print(ostream & _out) const \ 
     91   {                                                                  \ 
     92      if (_hasValue) _out << " " << getName() << "=\"" << value(0);   \ 
     93      _out << "..." << value(value.size()-1); _out << "\"" ;          \ 
     94      return (_out) ;                                                 \ 
     95   } 
     96 
    8897#define SET_ARRAY_TYPE(type) \ 
    89    SET_ARRAY_DIM(type,1)     \ 
    90    SET_ARRAY_DIM(type,2)     \ 
    91    SET_ARRAY_DIM(type,3)     \ 
    92    SET_ARRAY_DIM(type,4) 
     98   PRINT_ARRAY(type)         \ 
     99   SET_ARRAY_DIM(type, 1)    \ 
     100   SET_ARRAY_DIM(type, 2)    \ 
     101   SET_ARRAY_DIM(type, 3)    \ 
     102   SET_ARRAY_DIM(type, 4) 
    93103 
    94104   SET_ARRAY_TYPE(double) 
     105   SET_ARRAY_TYPE(float) 
    95106   SET_ARRAY_TYPE(int) 
    96107   SET_ARRAY_TYPE(bool) 
    97108 
    98    template <> 
    99       ostream& Attribut<Array<double,1> >::print(ostream & o) const 
    100    { 
    101       if (_hasValue) o << " " << getName() << "=\"" << value(0); 
    102       /*for (int i = 1; i < value.size(); i++) 
    103       { o << "," << value(i); }*/ 
    104       o << value(0) << "..." << value(value.size()-1); 
    105       o << "\"" ; 
    106       return (o) ; 
    107    } 
     109#undef SET_ARRAY_DIM 
     110#undef SET_ARRAY_TYPE 
     111#undef PRINT_ARRAY 
    108112 
    109113   template <> 
    110       void Attribut<Array<double,1> >::setFromString(const std::string& _str) 
     114      void Attribut<Array<double, 1> >::setFromString(const std::string& _str) 
    111115   { 
    112116      istringstream iss(_str) ; 
Note: See TracChangeset for help on using the changeset viewer.