Ignore:
Timestamp:
11/16/17 16:20:41 (6 years ago)
Author:
yushan
Message:

dev_omp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/object_template.hpp

    r1328 r1331  
    1212namespace xios 
    1313{ 
    14    /// ////////////////////// Déclarations ////////////////////// /// 
    15    template <class T> 
    16       class CObjectTemplate 
    17          : public CObject 
    18          , public virtual CAttributeMap 
    19    { 
     14  /// ////////////////////// Déclarations ////////////////////// /// 
     15  template <class T> 
     16  class CObjectTemplate 
     17    : public CObject 
     18    , public virtual CAttributeMap 
     19  { 
    2020 
    21          /// Friend /// 
    22          friend class CObjectFactory; 
     21    /// Friend /// 
     22    friend class CObjectFactory; 
    2323 
    24          /// Typedef /// 
    25          typedef CAttributeMap SuperClassMap; 
    26          typedef CObject SuperClass; 
    27          typedef T DerivedType; 
     24    /// Typedef /// 
     25    typedef CAttributeMap SuperClassMap; 
     26    typedef CObject SuperClass; 
     27    typedef T DerivedType; 
    2828 
    29          enum EEventId 
    30          { 
    31            EVENT_ID_SEND_ATTRIBUTE=100 
    32          } ; 
     29    enum EEventId 
     30    { 
     31      EVENT_ID_SEND_ATTRIBUTE=100 
     32    } ; 
    3333 
    34       public : 
     34    public : 
    3535 
    36          /// Autres /// 
    37          virtual StdString toString(void) const; 
    38          virtual void fromString(const StdString & str); 
     36      /// Autres /// 
     37      virtual StdString toString(void) const; 
     38      virtual void fromString(const StdString & str); 
    3939 
    40 //         virtual void toBinary  (StdOStream & os) const; 
    41 //         virtual void fromBinary(StdIStream & is); 
    42          virtual string getName(void) const ; 
    43          virtual void parse(xml::CXMLNode & node); 
     40//      virtual void toBinary  (StdOStream & os) const; 
     41//      virtual void fromBinary(StdIStream & is); 
     42      virtual string getName(void) const ; 
     43      virtual void parse(xml::CXMLNode & node); 
    4444 
    45          /// Accesseurs /// 
    46          ENodeType getType(void) const; 
     45      /// Accesseurs /// 
     46      ENodeType getType(void) const; 
    4747 
    48          /// Test /// 
    49          virtual bool hasChild(void) const; 
     48      /// Test /// 
     49      virtual bool hasChild(void) const; 
    5050 
    51          /// Traitements /// 
    52          virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 
     51      /// Traitements /// 
     52      virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 
    5353 
    54          /// Traitement statique /// 
    55          static void ClearAllAttributes(void); 
    56          std::map<int, size_t> getMinimumBufferSizeForAttributes(); 
    57          void sendAttributToServer(const string& id); 
    58          void sendAttributToServer(CAttribute& attr) ; 
    59          void sendAllAttributesToServer(); 
    60          static void recvAttributFromClient(CEventServer& event) ; 
    61          static bool dispatchEvent(CEventServer& event) ; 
     54      /// Traitement statique /// 
     55      static void ClearAllAttributes(void); 
     56      std::map<int, size_t> getMinimumBufferSizeForAttributes(); 
     57      void sendAttributToServer(const string& id); 
     58      void sendAttributToServer(CAttribute& attr) ; 
     59      void sendAllAttributesToServer(); 
     60      static void recvAttributFromClient(CEventServer& event) ; 
     61      static bool dispatchEvent(CEventServer& event) ; 
    6262 
    63          bool isEqual(const string& id, const vector<StdString>& excludedAttrs); 
    64          bool isEqual(T* obj, const vector<StdString>& excludedAttrs); 
     63      bool isEqual(const string& id, const vector<StdString>& excludedAttrs); 
     64      bool isEqual(T* obj, const vector<StdString>& excludedAttrs); 
    6565 
    66          /// Accesseur statique /// 
    67          static std::vector<boost::shared_ptr<DerivedType> > & 
    68             GetAllVectobject(const StdString & contextId); 
     66      /// Accesseur statique /// 
     67      static std::vector<boost::shared_ptr<DerivedType> > & 
     68      GetAllVectobject(const StdString & contextId); 
    6969 
    70          /// Destructeur /// 
    71          virtual ~CObjectTemplate(void); 
     70      /// Destructeur /// 
     71      virtual ~CObjectTemplate(void); 
    7272 
    73          static bool has(const string& id) ; 
    74          static bool has(const string& contextId, const string& id) ; 
    75          static T* get(const string& id) ; 
    76          static T* get(const T* ptr) ; 
    77          static T* get(const string& contextId, const string& id) ; 
    78          T* get(void) ; 
    79          shared_ptr<T> getShared(void) ; 
    80          static shared_ptr<T> getShared(const T* ptr) ; 
     73      static bool has(const string& id) ; 
     74      static bool has(const string& contextId, const string& id) ; 
     75      static T* get(const string& id) ; 
     76      static T* get(const T* ptr) ; 
     77      static T* get(const string& contextId, const string& id) ; 
     78      T* get(void) ; 
     79      shared_ptr<T> getShared(void) ; 
     80      static shared_ptr<T> getShared(const T* ptr) ; 
    8181 
    82          static T* create(const string& id=string("")) ; 
    83          static const vector<T*> getAll() ; 
    84          static const vector<T*> getAll(const string& contextId) ; 
     82      static T* create(const string& id=string("")) ; 
     83      static const vector<T*> getAll() ; 
     84      static const vector<T*> getAll(const string& contextId) ; 
    8585 
    86          void generateCInterface(ostream& oss) ; 
    87          void generateFortran2003Interface(ostream& oss) ; 
    88          void generateFortranInterface(ostream& oss) ; 
     86      void generateCInterface(ostream& oss) ; 
     87      void generateFortran2003Interface(ostream& oss) ; 
     88      void generateFortranInterface(ostream& oss) ; 
    8989 
    90       protected : 
     90    protected : 
    9191 
    92          /// Constructeurs /// 
    93          CObjectTemplate(void); 
    94          explicit CObjectTemplate(const StdString & id); 
    95          CObjectTemplate(const CObjectTemplate<T> & object, 
    96                          bool withAttrList = true, bool withId = true); 
    97          CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented. 
     92      /// Constructeurs /// 
     93      CObjectTemplate(void); 
     94      explicit CObjectTemplate(const StdString & id); 
     95      CObjectTemplate(const CObjectTemplate<T> & object, 
     96                      bool withAttrList = true, bool withId = true); 
     97      CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented. 
    9898 
    99       private : 
     99    private : 
    100100 
    101          /// Propriétés statiques /// 
    102          static xios_map<StdString, 
    103                 xios_map<StdString, 
    104                 boost::shared_ptr<DerivedType> > > *AllMapObj_ptr; 
    105          static xios_map<StdString, 
    106                 std::vector<boost::shared_ptr<DerivedType> > > *AllVectObj_ptr; 
     101      /// Propriétés statiques /// 
     102      static xios_map<StdString, 
     103             xios_map<StdString, 
     104             boost::shared_ptr<DerivedType> > > *AllMapObj_ptr; 
     105      #pragma omp threadprivate(AllMapObj_ptr) 
     106      static xios_map<StdString, 
     107             std::vector<boost::shared_ptr<DerivedType> > > *AllVectObj_ptr; 
     108      #pragma omp threadprivate(AllVectObj_ptr) 
    107109 
    108          static xios_map< StdString, long int > *GenId_ptr ; 
     110      static xios_map< StdString, long int > *GenId_ptr ; 
     111      #pragma omp threadprivate(GenId_ptr) 
    109112 
    110    }; // class CObjectTemplate 
     113  }; // class CObjectTemplate 
    111114} // namespace xios 
    112115 
Note: See TracChangeset for help on using the changeset viewer.