source: XIOS/trunk/src/interface/c/icdate.cpp @ 325

Last change on this file since 325 was 325, checked in by ymipsl, 12 years ago

port to gfortran/g++

YM

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
7
8#include "xmlioserver.hpp"
9
10#include "attribute_template_impl.hpp"
11#include "object_template_impl.hpp"
12#include "group_template_impl.hpp"
13
14#include "calendar_type.hpp"
15
16#include "icutil.hpp"
17
18extern "C"
19{
20// /////////////////////////////// Définitions ////////////////////////////// //
21
22   void cxios_set_timestep(double ts_year, double ts_month,  double ts_day,
23                          double ts_hour, double ts_minute, double ts_second)
24   {
25      try
26      {
27         date::CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second};
28         boost::shared_ptr<xmlioserver::tree::CContext> context =
29         xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
30            (CObjectFactory::GetCurrentContextId());
31         
32            context->timestep.setValue(dur.toString());
33            context->sendAttributToServer("timestep") ;
34      }
35      catch (xmlioserver::CException & exc)
36      {
37         std::cerr << exc.getMessage() << std::endl;
38         exit (EXIT_FAILURE);
39      }
40   }
41   
42   void cxios_update_calendar(int step)
43   {
44      boost::shared_ptr<xmlioserver::tree::CContext> context =
45            xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
46            (CObjectFactory::GetCurrentContextId());
47      context->updateCalendar(step) ;
48      context->sendUpdateCalendar(step) ;
49     
50   }
51
52} // extern "C"
Note: See TracBrowser for help on using the repository browser.