source: XIOS/dev/branch_yushan_merged/src/group_factory.hpp @ 1134

Last change on this file since 1134 was 1134, checked in by yushan, 7 years ago

branch merged with trunk r1130

  • 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.5 KB
RevLine 
[591]1#ifndef __XIOS_CGroupFactory__
2#define __XIOS_CGroupFactory__
[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_factory.hpp"
11#include "group_template.hpp"
[278]12#include "xml_parser.hpp"
[219]13
[335]14namespace xios
[219]15{
16   /// ////////////////////// Déclarations ////////////////////// ///
17   class CGroupFactory
18   {
19      public :
20
21         /// Mutateurs ///
22         static void SetCurrentContextId(const StdString & context);
23
24         template <typename U>
[354]25            static void AddGroup(boost::shared_ptr<U> pgroup,
[219]26                                        boost::shared_ptr<U> cgroup);
27
28         template <typename U>
[354]29            static void AddChild(boost::shared_ptr<U> group,
[219]30                                        boost::shared_ptr<typename U::RelChild> child);
31
32         /// Accesseurs ///
33         static StdString & GetCurrentContextId(void);
34
35         template <typename U>
[354]36            static boost::shared_ptr<U>
[219]37               GetGroup(boost::shared_ptr<U> group, const StdString & id);
38
39         template <typename U>
[354]40            static boost::shared_ptr<typename U::RelChild>
[219]41               GetChild(boost::shared_ptr<U> group, const StdString & id);
42
43         template <typename U>
[354]44            static int GetGroupNum(boost::shared_ptr<U> group);
[219]45         template <typename U>
[354]46            static int GetGroupIdNum(boost::shared_ptr<U> group);
[219]47         template <typename U>
[354]48            static int GetChildNum(boost::shared_ptr<U> group);
[219]49         template <typename U>
[354]50            static int GetChildIdNum(boost::shared_ptr<U> group);
[219]51
52         /// Tests ///
53         template <typename U>
[354]54            static bool HasGroup(boost::shared_ptr<U> group, const StdString & id);
[219]55
56         template <typename U>
[354]57            static bool HasChild(boost::shared_ptr<U> group, const StdString & id);
[219]58
59         /// Instanciateur ///
60         template <typename U>
[354]61            static boost::shared_ptr<U>
[219]62               CreateGroup(boost::shared_ptr<U> group, const StdString & id = StdString(""));
63
64         template <typename U>
[354]65            static boost::shared_ptr<typename U::RelChild>
[219]66               CreateChild(boost::shared_ptr<U> group, const StdString & id = StdString(""));
67
68      private :
69
70         /// Propriétés statiques ///
[1134]71         static StdString *CurrContext_ptr;
72         #pragma omp threadprivate(CurrContext_ptr)
[219]73
74   }; // class CGroupFactory
[335]75} // namespace xios
[219]76
[352]77//#include "group_factory_impl.hpp"
78//#include "group_parser.hpp"
[219]79
[591]80#endif // __XIOS_CGroupFactory__
Note: See TracBrowser for help on using the repository browser.