[219] | 1 | #ifndef __XMLIO_CContext__ |
---|
| 2 | #define __XMLIO_CContext__ |
---|
| 3 | |
---|
| 4 | /// xmlioserver headers /// |
---|
| 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "node_type.hpp" |
---|
| 7 | #include "calendar.hpp" |
---|
| 8 | |
---|
| 9 | #include "declare_group.hpp" |
---|
| 10 | |
---|
| 11 | namespace xmlioserver { |
---|
| 12 | namespace data { |
---|
| 13 | class CDataTreatment; |
---|
| 14 | } // namespace tree |
---|
| 15 | } // namespace xmlioserver |
---|
| 16 | |
---|
| 17 | namespace xmlioserver { |
---|
| 18 | namespace tree { |
---|
| 19 | |
---|
| 20 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 21 | class CContextGroup; |
---|
| 22 | class CContextAttributes; |
---|
| 23 | class CContext; |
---|
| 24 | |
---|
| 25 | ///-------------------------------------------------------------- |
---|
| 26 | |
---|
| 27 | // Declare/Define CFileAttribute |
---|
| 28 | BEGIN_DECLARE_ATTRIBUTE_MAP(CContext) |
---|
| 29 | # include "context_attribute.conf" |
---|
| 30 | END_DECLARE_ATTRIBUTE_MAP(CContext) |
---|
| 31 | |
---|
| 32 | ///-------------------------------------------------------------- |
---|
| 33 | |
---|
| 34 | class CContext |
---|
| 35 | : public CObjectTemplate<CContext> |
---|
| 36 | , public CContextAttributes |
---|
| 37 | { |
---|
| 38 | /// typedef /// |
---|
| 39 | typedef CObjectTemplate<CContext> SuperClass; |
---|
| 40 | typedef CContextAttributes SuperClassAttribute; |
---|
| 41 | |
---|
| 42 | public : |
---|
| 43 | |
---|
| 44 | typedef CContextAttributes RelAttributes; |
---|
| 45 | typedef CContext RelGroup; |
---|
| 46 | |
---|
| 47 | //--------------------------------------------------------- |
---|
| 48 | |
---|
| 49 | public : |
---|
| 50 | |
---|
| 51 | /// Constructeurs /// |
---|
| 52 | CContext(void); |
---|
| 53 | explicit CContext(const StdString & id); |
---|
| 54 | CContext(const CContext & context); // Not implemented yet. |
---|
| 55 | CContext(const CContext * const context); // Not implemented yet. |
---|
| 56 | |
---|
| 57 | /// Destructeur /// |
---|
| 58 | virtual ~CContext(void); |
---|
| 59 | |
---|
| 60 | //--------------------------------------------------------- |
---|
| 61 | |
---|
| 62 | public : |
---|
| 63 | |
---|
| 64 | /// Mutateurs /// |
---|
| 65 | void setCalendar(boost::shared_ptr<date::CCalendar> newCalendar); |
---|
| 66 | void setDataTreatment(boost::shared_ptr<data::CDataTreatment> datat); |
---|
| 67 | |
---|
| 68 | /// Accesseurs /// |
---|
| 69 | boost::shared_ptr<date::CCalendar> getCalendar(void) const; |
---|
| 70 | boost::shared_ptr<data::CDataTreatment> getDataTreatment(void) const; |
---|
| 71 | |
---|
| 72 | /// Accesseurs statiques /// |
---|
| 73 | static StdString GetName(void); |
---|
| 74 | static StdString GetDefName(void); |
---|
| 75 | static ENodeType GetType(void); |
---|
| 76 | |
---|
| 77 | static boost::shared_ptr<CContextGroup> GetContextGroup(void); |
---|
| 78 | |
---|
| 79 | public : |
---|
| 80 | |
---|
| 81 | /// Traitements /// |
---|
| 82 | virtual void solveDescInheritance(const CAttributeMap * const parent = 0); |
---|
| 83 | void solveFieldRefInheritance(void); |
---|
| 84 | void solveCalendar(void); |
---|
| 85 | |
---|
| 86 | /// Autres méthodes statiques /// |
---|
| 87 | static void ShowTree(StdOStream & out = std::clog); |
---|
| 88 | static void CleanTree(void); |
---|
| 89 | |
---|
| 90 | /// Test /// |
---|
| 91 | virtual bool hasChild(void) const; |
---|
| 92 | |
---|
| 93 | public : |
---|
| 94 | |
---|
| 95 | /// Autres /// |
---|
| 96 | virtual void parse(xml::CXMLNode & node); |
---|
| 97 | |
---|
| 98 | virtual StdString toString(void) const; |
---|
| 99 | virtual void toBinary (StdOStream & os) const; |
---|
| 100 | virtual void fromBinary(StdIStream & is); |
---|
| 101 | |
---|
| 102 | private : |
---|
| 103 | |
---|
| 104 | boost::shared_ptr<date::CCalendar> calendar; |
---|
| 105 | boost::shared_ptr<data::CDataTreatment> datat; |
---|
| 106 | |
---|
| 107 | }; // class CContext |
---|
| 108 | |
---|
| 109 | ///-------------------------------------------------------------- |
---|
| 110 | |
---|
| 111 | // Declare/Define CContextGroup and CContextDefinition |
---|
| 112 | DECLARE_GROUP(CContext); |
---|
| 113 | |
---|
| 114 | ///-------------------------------------------------------------- |
---|
| 115 | |
---|
| 116 | } // namespace tree |
---|
| 117 | } // namespace xmlioserver |
---|
| 118 | |
---|
| 119 | #endif // __XMLIO_CContext__ |
---|