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

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

Suppress access to CObjectFactory class and CTreeManager.

YM

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, 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         CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second};
28         boost::shared_ptr<xios::CContext> context = CContext::getCurrent() ;
29         
30            context->timestep.setValue(dur.toString());
31            context->sendAttributToServer("timestep") ;
32      }
33      catch (xios::CException & exc)
34      {
35         std::cerr << exc.getMessage() << std::endl;
36         exit (EXIT_FAILURE);
37      }
38   }
39   
40   void cxios_update_calendar(int step)
41   {
42      boost::shared_ptr<xios::CContext> context = CContext::getCurrent() ;
43      context->updateCalendar(step) ;
44      context->sendUpdateCalendar(step) ;
45     
46   }
47
48} // extern "C"
Note: See TracBrowser for help on using the repository browser.