Changeset 188 for XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp
- Timestamp:
- 05/03/11 15:50:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp
r173 r188 7 7 #include "group_template_impl.hpp" 8 8 9 #include "calendar_type.hpp" 10 9 11 namespace xmlioserver { 10 12 namespace tree { … … 14 16 CContext::CContext(void) 15 17 : CObjectTemplate<CContext>(), CContextAttributes() 18 , calendar() 16 19 { /* Ne rien faire de plus */ } 17 20 18 21 CContext::CContext(const StdString & id) 19 22 : CObjectTemplate<CContext>(id), CContextAttributes() 23 , calendar() 20 24 { /* Ne rien faire de plus */ } 21 25 … … 37 41 return (group_context); 38 42 } 39 43 44 //---------------------------------------------------------------- 45 46 boost::shared_ptr<date::CCalendar> CContext::getCalendar(void) const 47 { 48 return (this->calendar); 49 } 50 51 //---------------------------------------------------------------- 52 53 void CContext::setCalendar(boost::shared_ptr<date::CCalendar> newCalendar) 54 { 55 this->calendar = newCalendar; 56 calendar_type.setValue(this->calendar->getId()); 57 start_date.setValue(this->calendar->getInitDate().toString()); 58 } 59 60 //---------------------------------------------------------------- 61 62 void CContext::solveCalendar(void) 63 { 64 if (this->calendar.get() != NULL) return; 65 if (calendar_type.isEmpty() || start_date.isEmpty()) 66 ERROR(" CContext::solveCalendar(void)", 67 << "[ context id = " << this->getId() << " ] " 68 << "Impossible de définir un calendrier (un attribut est manquant)."); 69 70 #define DECLARE_CALENDAR(MType , mtype) \ 71 if (calendar_type.getValue().compare(#mtype) == 0) \ 72 { \ 73 this->calendar = boost::shared_ptr<date::CCalendar> \ 74 (new date::C##MType##Calendar(start_date.getValue())); \ 75 return; \ 76 } 77 #include "calendar_type.conf" 78 79 ERROR("CContext::solveCalendar(void)", 80 << "[ calendar_type = " << calendar_type.getValue() << " ] " 81 << "Le calendrier n'est pas définie dans le code !"); 82 } 83 40 84 //---------------------------------------------------------------- 41 85
Note: See TracChangeset
for help on using the changeset viewer.