Index: OS/trunk/src/buffer.cpp
===================================================================
--- /XIOS/trunk/src/buffer.cpp	(revision 314)
+++ 	(revision )
@@ -1,266 +1,0 @@
-#include "buffer.hpp"
-
-#include "mpi_manager.hpp"
-#include "buffer_impl.hpp"
-
-namespace xmlioserver
-{
-   namespace comm
-   {
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
-
-      CBuffer::CBuffer(StdSize size)
-         : size(size), delIdata(true)
-      {
-         this->idata = new char[size]();
-         //CMPIManager::AllocMem(&idata, size);
-      }
-
-      CBuffer::CBuffer(char * data, StdSize size)
-         : size(size), delIdata(false)
-      {
-         this->idata = data;
-      }
-      
-      CBuffer::CBuffer(const CBuffer & buffer)
-         : size(buffer.size), delIdata(true)
-      {
-         this->idata = new char[size]();
-         std::copy (buffer.idata, buffer.idata+size, this->idata);
-      }
-      
-      CBuffer::CBuffer(const CBuffer * const buffer)
-         : size(buffer->size), delIdata(true)
-      {
-         this->idata = new char[size]();
-         std::copy (buffer->idata, buffer->idata+size, this->idata);       
-      }
-
-      CBuffer::~CBuffer(void)
-      {
-         if (delIdata) delete [] this->idata;
-         else this->fillData('\0', this->getSize(), 0);
-         //CMPIManager::FreeMem(idata);
-      }
-
-      ///--------------------------------------------------------------
-
-      CBuffer::operator char * (void)
-      { return (this->getData()); }
-
-      char * CBuffer::operator[](StdSize position)
-      { return (this->getData(position)); }
-
-      //---------------------------------------------------------------
-
-      StdSize CBuffer::getSize(StdSize position) const
-      {
-         if (position > this->size)
-            ERROR("CBuffer::getSize(position)",
-                  << " Buffer size <  size + position !");
-         return (this->size - position);
-      }
-
-      char * CBuffer::getData(StdSize position) const
-      {
-         if (position > this->size)
-            ERROR("CBuffer::getData(position)",
-                   << " Buffer size < position !");
-         return &(this->idata[position]);
-      }
-
-      //---------------------------------------------------------------
-
-      void CBuffer::getData(char * data, StdSize size, StdSize position) const
-      {
-         if (this->size < (size + position))
-            ERROR("CBuffer::getData(data, size, position)",
-                   << " Buffer size <  size + position !");
-         std::copy(this->getData(position), this->getData(position + size), data);
-      }
-      
-      //---------------------------------------------------------------
-      
-      void CBuffer::setData(const char * data, StdSize size, StdSize position)
-      {
-         if (this->size < (size + position))
-            ERROR("CBuffer::getData(data, size, position)",
-                   << " Buffer size <  size + position !");
-         std::copy(&(data[0]), &(data[size]), this->getData(position));
-      }
-
-      //---------------------------------------------------------------
-
-#define BufferDataTypeGetter(type, type_enum)\
-   template <> CBuffer::CBufferDataType \
-      CBuffer::getBufferDataType<type>(void) const { return (type_enum); }; \
-   template <> CBuffer::CBufferDataType \
-      CBuffer::getBufferDataType<ARRAY(type, 1)>(void) const { return (type_enum); };
-
-      BufferDataTypeGetter(bool, TBOOL8);
-      BufferDataTypeGetter(char, TCHAR8);
-      BufferDataTypeGetter(float, TFLOAT32);
-      BufferDataTypeGetter(double, TDOUBLE64);
-      BufferDataTypeGetter(long int, TINT32);
-
-#undef BufferDataTypeGetter
-
-
-      //---------------------------------------------------------------
-
-      void CBuffer::getBufferData(CBufferData & bufdata, StdSize position) const
-      {
-         StdSize currposition = position;
-         this->getData( reinterpret_cast<char*>(&(bufdata.type))
-                      , sizeof(CBufferDataType), currposition);
-         this->getData( reinterpret_cast<char*>(&(bufdata.isArray))
-                      , sizeof(bool), currposition += sizeof(CBufferDataType));
-         this->getData( reinterpret_cast<char*>(&(bufdata.size))
-                      , sizeof(StdSize), currposition += sizeof(bool));
-         this->getData( reinterpret_cast<char*>(&(bufdata.position))
-                      , sizeof(StdSize), currposition += sizeof(StdSize));
-      }
-
-      void CBuffer::setBufferData(const CBufferData & bufdata, StdSize position)
-      {
-         StdSize currposition = position;
-         this->setData( reinterpret_cast<const char*>(&(bufdata.type))
-                      , sizeof(CBufferDataType), currposition);
-         this->setData( reinterpret_cast<const char*>(&(bufdata.isArray))
-                      , sizeof(bool), currposition += sizeof(CBufferDataType));
-         this->setData( reinterpret_cast<const char*>(&(bufdata.size))
-                      , sizeof(StdSize), currposition += sizeof(bool));
-         this->setData( reinterpret_cast<const char*>(&(bufdata.position))
-                      , sizeof(StdSize), currposition += sizeof(StdSize));
-      }
-
-      //---------------------------------------------------------------
-
-#define CBufferGetter(type, Type)       \
-   type CBuffer::get##Type(StdSize position) const \
-   { type retvalue; this->getData<type>(retvalue, position); return (retvalue); }
-
-
-      CBufferGetter(char     , Char)
-      CBufferGetter(bool     , Bool)
-      CBufferGetter(float    , Float)
-      CBufferGetter(double   , Double)
-      CBufferGetter(long int , Int)
-
-#undef CBufferGetter
-
-      //---------------------------------------------------------------
-
-#define CBufferArrayGetter(type, Type) \
-   ARRAY(type, 1) CBuffer::get##Type##Array(StdSize position) const \
-   {  ARRAY_CREATE(retvalue, type, 1, [1]);                         \
-      this->getDataArray<type>(retvalue, position);                 \
-      return (retvalue); }
-
-      CBufferArrayGetter(char     , Char)
-      CBufferArrayGetter(bool     , Bool)
-      CBufferArrayGetter(float    , Float)
-      CBufferArrayGetter(double   , Double)
-      CBufferArrayGetter(long int , Int)
-
-#undef CBufferArrayGetter
-
-      StdString CBuffer::getString(StdSize position) const
-      {
-         ARRAY(char, 1) array = this->getCharArray(position);
-         return (StdString(array->data(), array->num_elements()));
-      }
-
-      //---------------------------------------------------------------
-
-#define CBufferSetter(type, Type) \
-      void  CBuffer::set##Type(type value, StdSize position) \
-      { this->setData(value, position); }
-
-      CBufferSetter(char     , Char)
-      CBufferSetter(bool     , Bool)
-      CBufferSetter(float    , Float)
-      CBufferSetter(double   , Double)
-      CBufferSetter(long int , Int)
-
-#undef CBufferSetter
-
-      //---------------------------------------------------------------
-
-#define CBufferArraySetter(type, Type) \
-      void  CBuffer::set##Type##Array(ARRAY(type, 1) value, StdSize position) \
-      { this->setDataArray(value, position); }
-
-      CBufferArraySetter(char     , Char)
-      CBufferArraySetter(bool     , Bool)
-      CBufferArraySetter(float    , Float)
-      CBufferArraySetter(double   , Double)
-      CBufferArraySetter(long int , Int)
-
-#undef CBufferArraySetter
-
-      void CBuffer::setString(const StdString & value, StdSize position)
-      {
-         ARRAY_CREATE(arr, char, 1, [value.size()]);
-         std::copy(value.data(), &(value.data()[value.size()]), arr->data());
-         this->setCharArray(arr, position);
-      }
-
-      //---------------------------------------------------------------
-
-      void CBuffer::printToBinaryFile (const StdString & filename)
-      {
-         StdOFStream ofs(filename.c_str());
-         this->printToBinaryStream(ofs);
-         ofs.close();
-      }
-      
-      //---------------------------------------------------------------
-      
-      void CBuffer::printToBinaryStream (StdOStream & ostr)
-      {  
-         ostr.write (this->getData(), this->getSize()); 
-      }
-      
-      //---------------------------------------------------------------
-      
-      StdSize CBuffer::getNextDataPosition(StdSize position)
-      {
-         CBufferData  bufdata;
-         this->updateBufferData(position);
-         this->getBufferData(bufdata, position);
-         return (bufdata.size + bufdata.position);
-      }
-
-      //---------------------------------------------------------------
-
-      template <>
-         StdSize CBuffer::getRequestedSize(StdString data) const
-      { 
-         return (DATA_HEADER_SIZE + data.size() * sizeof (char)); 
-      }
-      
-      //---------------------------------------------------------------
-      
-      void CBuffer::updateBufferData(StdSize position)
-      {
-         CBufferData bufdata;
-         this->getBufferData(bufdata, position);
-         bufdata.position = position + DATA_HEADER_SIZE;
-         this->setBufferData(bufdata, position);
-      }
-      
-      //---------------------------------------------------------------
-      
-      void CBuffer::fillData(char data, StdSize size, StdSize position)
-      {
-         if (this->size < (size + position))
-            ERROR("CBuffer::getData(data, size, position)",
-                   << " Buffer size <  size + position !");
-         std::fill_n(this->getData(position), size, data);
-      }
-      
-      ///--------------------------------------------------------------
-
-   } // namespace tree
-} // namespace xmlioserver
Index: OS/trunk/src/buffer_list.cpp
===================================================================
--- /XIOS/trunk/src/buffer_list.cpp	(revision 314)
+++ 	(revision )
@@ -1,74 +1,0 @@
-#include "buffer_list.hpp"
-
-namespace xmlioserver
-{
-   namespace comm
-   {
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
-      CBufferList::CBufferList(MPI_Comm com_client_server)
-         : SuperClass(CMPIManager::GetCommSize(com_client_server) - 1)
-         , com_client_server(com_client_server)
-         , nbbuffer(CMPIManager::GetCommSize(com_client_server) - 1)
-      { /* Ne rien faire de plus */ }
-
-      CBufferList::~CBufferList(void)
-      { /* Ne rien faire de plus */ }
-
-      ///--------------------------------------------------------------
-
-      bool CBufferList::hasRequests(void) const
-      {
-         bool retvalue = SuperClass::operator[](0).hasRequest();
-         for (StdSize i = 1; i < this->nbbuffer; i++)
-            retvalue = retvalue && SuperClass::operator[](i).hasRequest();
-         return (retvalue);
-      }
-
-      bool CBufferList::recvRequests(void)
-      {
-         while (!this->hasRequests())
-         {
-            for (int i = 1; i < CMPIManager::GetCommSize(com_client_server); i++)
-            {
-               if (CMPIManager::HasReceivedData(com_client_server, i))
-               {
-                  StdSize size = CMPIManager::GetReceivedDataSize(com_client_server, i);
-                  if (SuperClass::operator[](i-1).isAvailable(size))
-                  {
-                     CMPIManager::ReceiveCircularBuffer
-                        (com_client_server, i, SuperClass::operator[](i-1));
-                  }
-                  else
-                  {
-                     DEBUG ("Impossible d'Ã©crire dans le tampon " << i 
-                             << " (Taille requise : " << size << " octets,"
-                             << " Taille du buffer circulaire : "
-                             << SuperClass::operator[](i-1).getSize() << " octets)");
-                  }
-               }
-            }
-         }
-         
-
-            
-         return (true);
-      }
-
-      void CBufferList::getRequests(std::vector<CLinearBuffer> & lbuffer)
-      {
-         for (StdSize i = 0; i < this->nbbuffer; i++)
-         {
-            lbuffer.push_back(SuperClass::operator[](i).getNextRequest());
-         }
-      }
-
-      StdSize CBufferList::getNumberOfBuffers(void) const
-      { 
-         return (this->nbbuffer) ;
-      }
-
-      ///--------------------------------------------------------------
-
-   } // namespace tree
-} // namespace xmlioserver
-
Index: OS/trunk/src/buffer_pair.cpp
===================================================================
--- /XIOS/trunk/src/buffer_pair.cpp	(revision 314)
+++ 	(revision )
@@ -1,87 +1,0 @@
-#include "buffer_pair.hpp"
-
-#include "mpi_manager.hpp"
-
-namespace xmlioserver
-{
-   namespace comm
-   {
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
-      CBufferPair::CBufferPair(MPI_Comm com_client_server)
-         : com_client_server(com_client_server) 
-         , first(BUFFER_CLIENT_SIZE), second(BUFFER_CLIENT_SIZE)
-         , first_request(MPI_REQUEST_NULL), second_request(MPI_REQUEST_NULL)
-         , currentBuffer(0)
-      { /* Ne rien faire de plus */ }
-
-      CBufferPair::~CBufferPair(void)
-      { /* Ne rien faire de plus */ }
-
-      ///--------------------------------------------------------------
-
-      bool CBufferPair::mustBeSent(void)
-      {
-         if ((currentBuffer  ==  0) && (first.getUsedSize()  != 0) &&
-            ((second_request == MPI_REQUEST_NULL) || CMPIManager::Test (second_request)))
-             return (true);
-             
-         if ((currentBuffer  ==  1) && (second.getUsedSize() != 0) &&
-            ((first_request  == MPI_REQUEST_NULL) || CMPIManager::Test (first_request)))
-            return (true);
-            
-         return (false);
-      }
-      
-      //---------------------------------------------------------------
-      
-      MPI_Request CBufferPair::wait(void)
-      {
-         if (this->currentBuffer == 0)
-         {
-            CMPIManager::Wait(this->second_request);
-            this->second_request = MPI_REQUEST_NULL;
-            return (this->second_request);
-         }
-         else
-         {
-            CMPIManager::Wait(this->first_request);
-            this->first_request = MPI_REQUEST_NULL;
-            return (this->first_request);
-         }
-      }
-      
-      //---------------------------------------------------------------
-      
-      void CBufferPair::sendCurrentBuffer(void)
-      {
-         if (this->currentBuffer == 0)
-         {
-            CMPIManager::SendLinearBuffer
-               (this->com_client_server, 0, this->first, this->first_request);
-            this->currentBuffer  =  1;
-            this->second_request = MPI_REQUEST_NULL;
-            this->second.clear();
-         }
-         else  if(this->currentBuffer == 1)
-         {
-            CMPIManager::SendLinearBuffer
-               (this->com_client_server, 0, this->second, this->second_request);
-            this->currentBuffer =  0;
-            this->first_request = MPI_REQUEST_NULL;
-            this->first.clear();
-         }
-      }
-      
-      //---------------------------------------------------------------
-      
-      CLinearBuffer & CBufferPair::getCurrentBuffer(void)
-      {
-         if (currentBuffer == 0) return (this->first);
-         return (this->second);
-      }
-      
-      ///--------------------------------------------------------------
-
-   } // namespace tree
-} // namespace xmlioserver
-
Index: OS/trunk/src/data_treatment.hpp
===================================================================
--- /XIOS/trunk/src/data_treatment.hpp	(revision 314)
+++ 	(revision )
@@ -1,171 +1,0 @@
-#ifndef __XMLIO_CDataTreatment__
-#define __XMLIO_CDataTreatment__
-
-/// xmlioserver headers ///
-#include "xmlioserver_spl.hpp"
-#include "node_type.hpp"
-#include "mpi_manager.hpp"
-#include "data_output.hpp"
-#include "duration.hpp"
-#include "client.hpp"
-#include "xios_manager.hpp"
-#include <mpi.h>
-
-namespace xmlioserver
-{
-   namespace data
-   {
-      /// ////////////////////// DÃ©clarations ////////////////////// ///
-      class CDataTreatment
-      {
-         public :
-
-            /// Construteurs ///
-            CDataTreatment
-               (boost::shared_ptr<CContext> _ctxt =
-                  CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()));
-
-            CDataTreatment(const CDataTreatment & data_treatment);       // Not implemented yet.
-            CDataTreatment(const CDataTreatment * const data_treatment); // Not implemented yet.
-
-            /// Accesseurs ///
-            const boost::shared_ptr<CContext> getCurrentContext(void) const;
-            const std::vector<boost::shared_ptr<CFile> > & getEnabledFiles  (void) const;
-
-            /// Ecriture et mise Ã  jour du calendrier ///
-            void write_data(const StdString & fieldId,
-                            const StdString & fileId,
-                            const std::deque<ARRAY(double, 1)> & data);
-
-            template <StdSize N>
-               void write_data(const StdString & fieldId, const ARRAY(double, N) & data);
-
-            template <StdSize N>
-               void write_data(const StdString & fieldId, const ARRAY(float, N) & data);
-
-            void update_calendar(int step);
-            void set_timestep(const date::CDuration & duration);
-            void finalize(void) ;
-            
-            /// CrÃ©ation des sorties ///
-            template <class T> void createDataOutput(MPI_Comm comm_server = CXIOSManager::Comm_Server);
-
-           
-            /// Destructeur ///
-            ~CDataTreatment(void);
-
-         private :
-
-            /// Traitements ///
-            void doTreatment(void);
-            void closeAllFile(void ) ;
-
-            void findAllEnabledFields(void);
-            void solveAllGridRef(void);
-            void solveAllOperation(void);
-            void solveAllInheritance(void) const;
-            void findEnabledFiles(void);
-
-            /// PropriÃ©tÃ©s privÃ©es ///
-            boost::shared_ptr<CContext> currentContext;
-            std::vector<boost::shared_ptr<CFile> > enabledFiles;
-     
-      }; // CDataTreatment
-
-      //----------------------------------------------------------------
-
-      template <class T>
-         void CDataTreatment::createDataOutput(MPI_Comm comm_server )
-      {
-         std::vector<boost::shared_ptr<CFile> >::const_iterator
-            it = this->enabledFiles.begin(), end = this->enabledFiles.end();
-         
-         for (; it != end; it++)
-         {
-            CXIOSManager::Comm_Server = comm_server;
-            boost::shared_ptr<CFile> file = *it;
-            StdString filename = (!file->name.isEmpty())
-                               ?   file->name.getValue() : file->getId();
-            StdOStringStream oss;
-            if (!CObjectFactory::GetObject<CContext>
-                (CObjectFactory::GetCurrentContextId())->output_dir.isEmpty())
-            	oss << CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId())->output_dir.getValue();
-            oss << filename;
-            if (!file->name_suffix.isEmpty())
-                oss << file->name_suffix.getValue();
-
-            bool multifile=true ;
-            if (!file->type.isEmpty())
-            {
-              StdString str=file->type.getValue() ; 
-              if (str.compare("one_file")==0) multifile=false ;
-              else if (str.compare("multi_file")==0) multifile=true ;
-              else ERROR("void CDataTreatment::createDataOutput(MPI_Comm comm_server)",
-                         "incorrect file <type> attribut : must be <multi_file> or <one_file>, "
-                        <<"having : <"<<str<<">") ;
-            } 
-            if (multifile) 
-            {
-              if (comm::CMPIManager::GetCommSize(comm_server) > 1)
-	               oss << "_" << comm::CMPIManager::GetCommRank(comm_server);
-            }
-            oss << ".nc";
-
-            boost::shared_ptr<io::CDataOutput> dout(new T(oss.str(), false,comm_server,multifile));
-//            file->initializeDataOutput(dout);
-         }
-      }
-
-      template <StdSize N>
-         void CDataTreatment::write_data
-            (const StdString & fieldId, const ARRAY(float, N) & data)
-      {
-         typedef typename boost::multi_array<double, N>::size_type sizetp;
-         std::vector<sizetp> shape;
-         const sizetp *	shapearr = data->shape();
-
-         shape.assign(shapearr, shapearr + N);
-         ARRAY(double, N) datad(new CArray<double, N>(shape));
-         for (StdSize i = 0; i < datad->num_elements(); i++)
-          datad->data()[i] = data->data()[i];
-
-         this->write_data(fieldId, datad);
-      }
-
-      template <StdSize N>
-         void CDataTreatment::write_data
-            (const StdString & fieldId, const ARRAY(double, N) & data)
-      {
-         const date::CDate & currDate =
-                this->currentContext->getCalendar()->getCurrentDate();
-         const date::CDuration & timestep = 
-               this->currentContext->getCalendar()->getTimeStep();
-         const std::vector<boost::shared_ptr<CField> > & refField=
-               CObjectFactory::GetObject<CField>(fieldId)->getAllReference();
-         std::vector<boost::shared_ptr<CField> >::const_iterator
-               it = refField.begin(), end = refField.end();
-         for (; it != end; it++)
-         {
-            boost::shared_ptr<CField> field = *it;
-            boost::shared_ptr<CFile>  file  = field->getRelFile();
-            if (field->updateData(data))
-            {
-               if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT)
-               { 
-                   boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient();
-                   client->sendData(field->getId(), file->getId(), field->getData());
-               }
-               else
-               {
-                  file->getDataOutput()->writeFieldData(field);
-               }
-            }
-         }
-
-      }
-
-   } // namespace data
-
-} // namespace xmlioserver
-
-#endif // __XMLIO_CDataTreatment__
Index: OS/trunk/src/rebuild.cpp
===================================================================
--- /XIOS/trunk/src/rebuild.cpp	(revision 314)
+++ 	(revision )
@@ -1,17 +1,0 @@
-#include "rebuild.hpp"
-
-namespace xmlioserver
-{
-   namespace io
-   {
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
-
-      CRebuild::CRebuild(const StdString & filename)
-      { /* Ne rien faire de plus */ }
-
-      CRebuild::~CRebuild(void)
-      { /* Ne rien faire de plus */ }
-
-
-   } // namespace io
-} // namespace xmlioserver
Index: OS/trunk/src/server.hpp
===================================================================
--- /XIOS/trunk/src/server.hpp	(revision 314)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#ifndef __XMLIO_Server__
-#define __XMLIO_Server__
-
-/// xmlioserver headers ///
-#include "xmlioserver_spl.hpp"
-#include "mpi_manager.hpp"
-#include "buffer_list.hpp"
-#include "array.hpp"
-
-namespace xmlioserver {
-namespace comm {
-
-   /// ////////////////////// DÃ©clarations ////////////////////// ///
-   
-   class CServer
-   {
-      public :
-
-         static boost::shared_ptr<CServer> CreateServer(MPI_Comm comm_client_server);
-         static boost::shared_ptr<CServer> GetServer(void);
-
-         /// Destructeur ///
-         ~CServer(void);
-         
-         void run(void);
-         
-      protected : 
-      
-         /// Accesseur ///
-         const CBufferList & getBufferList(void) const;
-         
-      public :
-      
-         /// Appels distants///   
-         void initialize(void); // manager 0, method 0
-         void finalize(void);   // manager 0, method 1
-             
-         void setContext    (const std::vector<CLinearBuffer> & buffer); // manager 1, method 0
-         void updateCalendar(const std::vector<CLinearBuffer> & buffer); // manager 1, method 1
-         void setTimestep   (const std::vector<CLinearBuffer> & buffer); // manager 1, method 2
-         
-         void writeData(const std::vector<CLinearBuffer> & buffer, int prec); // manager 2, method 0 - 1
-      
-      private :
-
-         /// Constructeurs ///
-         CServer(MPI_Comm comm_client_server);
-      
-         /// PropriÃ©tÃ© privÃ©e ///
-         CBufferList blist;
-
-         static boost::shared_ptr<CServer> Server;
-      
-   }; // class CServer  
-
-} // namespace comm
-} // namespace xmlioserver
-
-#endif //__XMLIO_Server__
