Index: XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- XIOS/trunk/src/object_template_impl.hpp	(revision 501)
+++ XIOS/trunk/src/object_template_impl.hpp	(revision 509)
@@ -55,5 +55,5 @@
       ERROR("CObjectTemplate<T> construtor 3", << "Not completly implemented yet !");
    }
-   
+
    template <class T>
       CObjectTemplate<T>::~CObjectTemplate(void)
@@ -65,10 +65,10 @@
       std::vector<boost::shared_ptr<T> > &
          CObjectTemplate<T>::GetAllVectobject(const StdString & contextId)
-   { 
-      return (CObjectTemplate<T>::AllVectObj[contextId]); 
-   }
-   
-   //---------------------------------------------------------------
-   
+   {
+      return (CObjectTemplate<T>::AllVectObj[contextId]);
+   }
+
+   //---------------------------------------------------------------
+
    template <class T>
       StdString CObjectTemplate<T>::toString(void) const
@@ -84,22 +84,22 @@
    template <class T>
       void CObjectTemplate<T>::fromString(const StdString & str)
-   { 
+   {
       ERROR("CObjectTemplate<T>::fromString(str)",
-            << "[ str = " << str << "] Not implemented yet !"); 
-   }
-   
-   //---------------------------------------------------------------
-
-/*   
+            << "[ str = " << str << "] Not implemented yet !");
+   }
+
+   //---------------------------------------------------------------
+
+/*
    template <class T>
       void CObjectTemplate<T>::toBinary(StdOStream & os) const
    {
-      SuperClassMap::toBinary(os);    
-   }
-      
+      SuperClassMap::toBinary(os);
+   }
+
    template <class T>
       void CObjectTemplate<T>::fromBinary(StdIStream & is)
    {
-      SuperClassMap::fromBinary(is); 
+      SuperClassMap::fromBinary(is);
    }
 */
@@ -121,5 +121,5 @@
       return (T::GetType());
    }
-  
+
    template <class T>
    string CObjectTemplate<T>::getName(void) const
@@ -127,11 +127,11 @@
       return (T::GetName());
    }
-  
+
    //---------------------------------------------------------------
 
    template <class T>
       bool CObjectTemplate<T>::hasChild(void) const
-   { 
-      return (false); 
+   {
+      return (false);
    }
 
@@ -140,6 +140,6 @@
    template <class T>
       void CObjectTemplate<T>::solveDescInheritance(bool apply, const CAttributeMap * const parent)
-   { 
-      SuperClassMap::setAttributes(parent, apply); 
+   {
+      SuperClassMap::setAttributes(parent, apply);
    }
 
@@ -160,4 +160,16 @@
    }
 
+   template<typename T>
+   void CObjectTemplate<T>::sendAllAttributesToServer()
+   {
+     CAttributeMap& attrMap = *this;
+     CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end();
+     for (; it != itE; ++it)
+     {
+       if (!(it->second)->isEmpty()) sendAttributToServer(*(it->second));
+     }
+
+   }
+
    template <class T>
    void CObjectTemplate<T>::sendAttributToServer(const string& id)
@@ -172,10 +184,10 @@
   {
     CContext* context=CContext::getCurrent() ;
-    
+
     if (!context->hasServer)
     {
        CContextClient* client=context->client ;
 
-       CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE) ;   
+       CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE) ;
        if (client->isServerLeader())
        {
@@ -189,11 +201,11 @@
        else client->sendEvent(event) ;
     }
-      
+
   }
-   
+
   template <class T>
   void CObjectTemplate<T>::recvAttributFromClient(CEventServer& event)
   {
-      
+
     CBufferIn* buffer=event.subEvents.begin()->buffer;
     string id,attrId;
@@ -220,5 +232,5 @@
            return true ;
            break ;
-       
+
          default :
          return false ;
@@ -227,5 +239,5 @@
       }
    }
-   
+
    template <typename T>
    bool CObjectTemplate<T>::has(const string & id)
@@ -251,5 +263,5 @@
      return CObjectFactory::GetObject<T>(ptr).get() ;
    }
-   
+
    template <typename T>
    shared_ptr<T> CObjectTemplate<T>::getShared(const T* ptr)
@@ -263,5 +275,5 @@
      return CObjectFactory::GetObject<T>((T*)this) ;
    }
-   
+
    template <typename T>
    const vector<T*> CObjectTemplate<T>::getAll()
@@ -269,5 +281,5 @@
      const vector< shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>();
      vector<T*> vect ;
-    
+
      typename vector<shared_ptr<T> >::const_iterator it;
      for(it=shared_vect.begin();it!=shared_vect.end();++it) vect.push_back(it->get()) ;
@@ -280,5 +292,5 @@
      const vector< shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(id);
      vector<T*> vect ;
-    
+
      typename vector<shared_ptr<T> >::const_iterator it;
      for(it=shared_vect.begin();it!=shared_vect.end();++it) vect.push_back(it->get()) ;
@@ -303,5 +315,5 @@
     return CObjectFactory::GetObject<T>((T*)this).get() ;
   }
-  
+
    template <typename T>
    void CObjectTemplate<T>::generateCInterface(ostream& oss)
@@ -310,5 +322,5 @@
      int found=className.find_first_of("_") ;
      if (found!=string::npos) className.replace(found,1,0,'x') ;
-     
+
      oss<<"/* ************************************************************************** *"<<iendl ;
      oss<<" *               Interface auto generated - do not modify                   *"<<iendl ;
@@ -340,5 +352,5 @@
      int found=className.find_first_of("_") ;
      if (found!=string::npos) className.replace(found,1,0,'x') ;
-     
+
      oss<<"! * ************************************************************************** *"<<iendl ;
      oss<<"! *               Interface auto generated - do not modify                     *"<<iendl ;
@@ -349,5 +361,5 @@
      oss<<iendl ;
      oss<<"INTERFACE ! Do not call directly / interface FORTRAN 2003 <-> C99"<<iendl++ ;
-     oss<<iendl ;   
+     oss<<iendl ;
      oss<<iendl ;
      SuperClassMap::generateFortran2003Interface(oss,className) ;
@@ -356,5 +368,5 @@
      oss<<"END MODULE "<<className<<"_interface_attr"<<iendl ;
    }
-  
+
    template <typename T>
    void CObjectTemplate<T>::generateFortranInterface(ostream& oss)
@@ -366,5 +378,5 @@
      found=superClassName.find("_group") ;
      if (found!=string::npos) superClassName.erase(found,6) ;
-     
+
      oss<<"! * ************************************************************************** *"<<iendl ;
      oss<<"! *               Interface auto generated - do not modify                     *"<<iendl ;
@@ -398,5 +410,5 @@
      SuperClassMap::generateFortranInterfaceIsDefined_hdl(oss,className) ;
      oss<<iendl ;
-     SuperClassMap::generateFortranInterfaceIsDefined_hdl_(oss,className) ;     
+     SuperClassMap::generateFortranInterfaceIsDefined_hdl_(oss,className) ;
      oss<<iendl-- ;
      oss<<"END MODULE i"<<className<<"_attr"<<iendl ;
