1 | #ifndef __XIOS_CCalendarWrapper__ |
---|
2 | #define __XIOS_CCalendarWrapper__ |
---|
3 | |
---|
4 | /// XIOS headers /// |
---|
5 | #include "xios_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 | |
---|
12 | #include "calendar.hpp" |
---|
13 | |
---|
14 | namespace xios { |
---|
15 | |
---|
16 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
17 | class CCalendarWrapperAttributes; |
---|
18 | class CCalendarWrapper; |
---|
19 | ///-------------------------------------------------------------- |
---|
20 | |
---|
21 | // Declare/Define CFileAttribute |
---|
22 | BEGIN_DECLARE_ATTRIBUTE_MAP(CCalendarWrapper) |
---|
23 | #include "calendar_wrapper_attribute.conf" |
---|
24 | END_DECLARE_ATTRIBUTE_MAP(CCalendarWrapper) |
---|
25 | |
---|
26 | ///-------------------------------------------------------------- |
---|
27 | /*! |
---|
28 | \class CCalendarWrapper |
---|
29 | This class a simple wrapper for the calendar |
---|
30 | */ |
---|
31 | class CCalendarWrapper |
---|
32 | : public CObjectTemplate<CCalendarWrapper> |
---|
33 | , public CCalendarWrapperAttributes |
---|
34 | { |
---|
35 | public : |
---|
36 | |
---|
37 | /// typedef /// |
---|
38 | typedef CObjectTemplate<CCalendarWrapper> SuperClass; |
---|
39 | typedef CCalendarWrapperAttributes SuperClassAttribute; |
---|
40 | |
---|
41 | //--------------------------------------------------------- |
---|
42 | |
---|
43 | public : |
---|
44 | |
---|
45 | /// Constructeurs /// |
---|
46 | CCalendarWrapper(void); |
---|
47 | explicit CCalendarWrapper(const StdString& id); |
---|
48 | |
---|
49 | /// Destructeur /// |
---|
50 | virtual ~CCalendarWrapper(void); |
---|
51 | |
---|
52 | /// Accesseurs statiques /// |
---|
53 | static StdString GetName(void); |
---|
54 | static StdString GetDefName(void); |
---|
55 | static ENodeType GetType(void); |
---|
56 | |
---|
57 | //--------------------------------------------------------- |
---|
58 | |
---|
59 | public : |
---|
60 | // Parse xml calendar node |
---|
61 | virtual void parse(xml::CXMLNode& node); |
---|
62 | // Try to create the calendar from the current attributes |
---|
63 | void createCalendar(void); |
---|
64 | // Try to update the timestep of the calendar with the corresponding attribute |
---|
65 | void updateTimestep(void); |
---|
66 | |
---|
67 | public : |
---|
68 | /// Accesseurs /// |
---|
69 | std::shared_ptr<CCalendar> getCalendar(bool checkValid = false) const; |
---|
70 | |
---|
71 | const CDate& getInitDate() const; |
---|
72 | const CDate& getTimeOrigin() const; |
---|
73 | |
---|
74 | /// Mutateurs /// |
---|
75 | void setInitDate(const CDate& initDate); |
---|
76 | void setTimeOrigin(const CDate& timeOrigin); |
---|
77 | |
---|
78 | private: |
---|
79 | // Calendar of context |
---|
80 | std::shared_ptr<CCalendar> calendar; |
---|
81 | |
---|
82 | }; // class CCalendarWrapper |
---|
83 | |
---|
84 | typedef CCalendarWrapper CCalendarWrapperGroup; |
---|
85 | typedef CCalendarWrapper CCalendarWrapperDefinition; |
---|
86 | } // namespace xios |
---|
87 | |
---|
88 | #endif // __XIOS_CCalendarWrapper__ |
---|