source: XIOS/dev/branch_openmp/src/object_factory.hpp @ 1545

Last change on this file since 1545 was 1545, checked in by yushan, 6 years ago

branch_openmp merged with trunk r1544

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 2.0 KB
RevLine 
[591]1#ifndef __XIOS_CObjectFactory__
2#define __XIOS_CObjectFactory__
[219]3
[1545]4#include <memory>
[219]5
[591]6/// XIOS headers ///
7#include "xios_spl.hpp"
[219]8#include "exception.hpp"
9#include "object_template.hpp"
10
[335]11namespace xios
[219]12{
[1460]13   /// ////////////////////// Déclarations ////////////////////// ///
14   class CObjectFactory
15   {
16      public :
[219]17
[1460]18         /// Mutateurs ///
19         static void SetCurrentContextId(const StdString & context);
[219]20
[1460]21         /// Accesseurs ///
22         static StdString & GetCurrentContextId(void);
[219]23
[1460]24         template <typename U>
[1545]25            static  std::shared_ptr<U> GetObject(const StdString & id);
[219]26
[1460]27         template <typename U>
[1545]28            static  std::shared_ptr<U> GetObject(const StdString& context,const StdString & id);
[286]29
[1460]30         template <typename U>
[1545]31            static  std::shared_ptr<U> GetObject(const U * const object);
[219]32
[1460]33         template <typename U>
34            static  int GetObjectNum(void);
35         template <typename U>
36            static  int GetObjectIdNum(void);
[219]37
[1460]38         template <typename U>
[1545]39            static  const std::vector<std::shared_ptr<U> > &
[1544]40               GetObjectVector(const StdString & context);
[219]41
[1460]42         /// Tests ///
43         template <typename U>
44            static  bool HasObject(const StdString & id);
[219]45
[1460]46         template <typename U>
47            static  bool HasObject(const StdString& context,const StdString & id);
[286]48
[1460]49         /// Instanciateur ///
50         template <typename U>
[1545]51            static  std::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
[219]52
[1460]53         template <typename U> static const StdString& GetUIdBase(void);
54         template <typename U> static StdString GenUId(void);
55         template <typename U> static bool IsGenUId(const StdString& id);
[219]56
[1460]57      private :
[219]58
[1460]59         /// Propriétés statiques ///
60         static StdString *CurrContext_ptr;
61         #pragma omp threadprivate(CurrContext_ptr)
[219]62
[1460]63   }; // class CObjectFactory
[335]64} // namespace xios
[219]65
[352]66//#include "object_factory_impl.hpp"
[219]67
[591]68#endif // __XIOS_CObjectFactory__
Note: See TracBrowser for help on using the repository browser.