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

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

bug fix for tests in prod mode

  • 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.1 KB
RevLine 
[591]1#ifndef __XIOS_CObjectFactory__
2#define __XIOS_CObjectFactory__
[219]3
4/// boost headers ///
5#include <boost/shared_ptr.hpp>
6
[591]7/// XIOS headers ///
8#include "xios_spl.hpp"
[219]9#include "exception.hpp"
10#include "object_template.hpp"
11
[335]12namespace xios
[219]13{
[1460]14   /// ////////////////////// Déclarations ////////////////////// ///
15   class CObjectFactory
16   {
17      public :
[219]18
[1460]19         /// Mutateurs ///
20         static void SetCurrentContextId(const StdString & context);
[219]21
[1460]22         /// Accesseurs ///
23         static StdString & GetCurrentContextId(void);
[219]24
[1460]25         template <typename U>
26            static  boost::shared_ptr<U> GetObject(const StdString & id);
[219]27
[1460]28         template <typename U>
29            static  boost::shared_ptr<U> GetObject(const StdString& context,const StdString & id);
[286]30
[1460]31         template <typename U>
32            static  boost::shared_ptr<U> GetObject(const U * const object);
[219]33
[1460]34         template <typename U>
35            static  int GetObjectNum(void);
36         template <typename U>
37            static  int GetObjectIdNum(void);
[219]38
[1460]39         template <typename U>
40            static  const std::vector<boost::shared_ptr<U> > &
[1544]41               GetObjectVector(const StdString & context);
42               //GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId());
[219]43
[1460]44         /// Tests ///
45         template <typename U>
46            static  bool HasObject(const StdString & id);
[219]47
[1460]48         template <typename U>
49            static  bool HasObject(const StdString& context,const StdString & id);
[286]50
[1460]51         /// Instanciateur ///
52         template <typename U>
53            static  boost::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
[219]54
[1460]55         template <typename U> static const StdString& GetUIdBase(void);
56         template <typename U> static StdString GenUId(void);
57         template <typename U> static bool IsGenUId(const StdString& id);
[219]58
[1460]59      private :
[219]60
[1460]61         /// Propriétés statiques ///
62         static StdString *CurrContext_ptr;
63         #pragma omp threadprivate(CurrContext_ptr)
[219]64
[1460]65   }; // class CObjectFactory
[335]66} // namespace xios
[219]67
[352]68//#include "object_factory_impl.hpp"
[219]69
[591]70#endif // __XIOS_CObjectFactory__
Note: See TracBrowser for help on using the repository browser.