Ignore:
Timestamp:
06/22/15 13:36:21 (9 years ago)
Author:
mhnguyen
Message:

Implementing generic transformation algorithm (local commit)

+) Change a little bit to make sure everything work in order

Test
+) test_new_features passe with inverse

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/transformation.hpp

    r619 r621  
    22#define __XMLIO_CTransformation__ 
    33 
    4 /// xios headers /// 
    54#include "xmlioserver_spl.hpp" 
    6 #include "attribute_enum.hpp" 
    7 #include "attribute_enum_impl.hpp" 
    8 #include "attribute_array.hpp" 
    9 #include "declare_attribute.hpp" 
    10 #include "object_template.hpp" 
    11 #include "group_factory.hpp" 
    12 #include "declare_group.hpp" 
     5#include "transformation_enum.hpp" 
    136 
    147namespace xios { 
    15  
    16   /// ////////////////////// Déclarations ////////////////////// /// 
    17   class CTransformationGroup; 
    18   class CTransformationAttributes; 
    19   class CTransformation; 
    20   ///-------------------------------------------------------------- 
    21  
    22   // Declare/Define CFileAttribute 
    23   BEGIN_DECLARE_ATTRIBUTE_MAP(CTransformation) 
    24 #include "transformation_attribute.conf" 
    25   END_DECLARE_ATTRIBUTE_MAP(CTransformation) 
    268 
    279  ///-------------------------------------------------------------- 
    2810  /*! 
    2911    \class CTransformation 
    30     This class describes transformation in xml file. 
     12    This class describes inverse_axis in xml file. 
    3113  */ 
     14  template<typename T> 
    3215  class CTransformation 
    33     : public CObjectTemplate<CTransformation> 
    34     , public CTransformationAttributes 
    3516  { 
    36     public : 
    37       enum TransformationId 
    38       { 
    39         TRANS_ID_ZOOM, TRANS_ID_INVERSE 
    40       }; 
    41       typedef CObjectTemplate<CTransformation> SuperClass; 
    42       typedef CTransformationAttributes SuperClassAttribute; 
     17  public: 
     18    typedef typename boost::unordered_map<ETranformationType, CTransformation<T>*, boost::hash<int> > TransformationMapTypes; 
     19    typedef TransformationMapTypes TransMapTypes; 
    4320 
    4421    public : 
    4522      /// Constructeurs /// 
    46       CTransformation(void); 
    47       explicit CTransformation(const StdString& id); 
     23      CTransformation(void) {} 
     24      virtual void checkValid(T* dest) = 0; 
    4825 
    4926      /// Destructeur /// 
    50       virtual ~CTransformation(void); 
    51  
    52       /// Accesseurs statiques /// 
    53       static StdString GetName(void); 
    54       static StdString GetDefName(void); 
    55       static ENodeType GetType(void); 
    56     private: 
    57       static std::vector<StdString> TransformationTypes; 
    58       static std::vector<TransformationId> TransformationTypeIds; 
    59  
    60     public : 
    61       void checkAttributes(); 
    62  
    63     private: 
    64       void checkAttributesType(TransformationId& transType); 
    65       void checkAttributesZoomType(); 
    66       void checkAttributesInverseType(); 
    67  
    68     private: 
     27      virtual ~CTransformation(void) {} 
    6928  }; // class CTransformation 
    7029 
    71   DECLARE_GROUP(CTransformation); 
    7230} // namespace xios 
    7331 
Note: See TracChangeset for help on using the changeset viewer.