Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_ref_func.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_ref_func.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_ref_func.hpp	(revision 2203)
@@ -50,4 +50,5 @@
     refObjects.push_back(refer_ptr);                                   \
     SuperClassAttribute::setAttributes(refer_ptr, apply);              \
+    setInheritedId(refer_ptr) ;                                        \
   }                                                                    \
 }                                                                      \
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 2203)
@@ -13,4 +13,7 @@
 #include "client_server_mapping_distributed.hpp"
 #include "distribution_client.hpp"
+
+#include <algorithm>
+#include <regex>
 
 namespace xios {
@@ -217,4 +220,20 @@
    }
    CATCH
+
+   CAxis* CAxis::get(const string& id)
+   {
+     const regex r("::");
+     smatch m;
+     if (regex_search(id, m, r))
+     {
+        if (m.size()!=1) ERROR("CAxis* CAxis::get(string& id)", <<" id = "<<id<< "  -> bad format id, separator :: append more than one time");
+        string fieldId=m.prefix() ;
+        if (fieldId.empty()) ERROR("CAxis* CAxis::get(string& id)", <<" id = "<<id<< "  -> bad format id, field name is empty");
+        string suffix=m.suffix() ;
+        CField* field=CField::get(fieldId) ;
+        return field->getAssociatedAxis(suffix) ;
+     }
+     else return CObjectFactory::GetObject<CAxis>(id).get();
+   }
 
    /*!
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 2203)
@@ -69,4 +69,5 @@
 
          static CAxis* createAxis();
+         static CAxis* get(const string& id) ; //<! return axis pointer using id
 
          /// Accesseurs ///
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 2203)
@@ -26,8 +26,7 @@
 #include "transformation_path.hpp"
 
-
-
-
 #include <algorithm>
+#include <regex>
+
 
 namespace xios {
@@ -79,4 +78,21 @@
    }
    CATCH
+
+   CDomain* CDomain::get(const string& id)
+   {
+     const regex r("::");
+     smatch m;
+     if (regex_search(id, m, r))
+     {
+        if (m.size()!=1) ERROR("CDomain* CDomain::get(string& id)", <<" id = "<<id<< "  -> bad format id, separator :: append more than one time");
+        string fieldId=m.prefix() ;
+        if (fieldId.empty()) ERROR("CDomain* CDomain::get(string& id)", <<" id = "<<id<< "  -> bad format id, field name is empty");
+        string suffix=m.suffix() ;
+        CField* field=CField::get(fieldId) ;
+        return field->getAssociatedDomain(suffix) ;
+     }
+     else return CObjectFactory::GetObject<CDomain>(id).get();
+   }
+
 
    const std::set<StdString> & CDomain::getRelFiles(void) const
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 2203)
@@ -70,7 +70,9 @@
          CDomain(const CDomain & domain);       // Not implemented yet.
          CDomain(const CDomain * const domain); // Not implemented yet.
-
+       
          static CDomain* createDomain();
-         
+         static CDomain* get(const string& id) ; //<! return domain pointer using id
+        // static bool has(const string& id) ;     //<! return true if domain with identifier id exist
+
          CMesh* mesh;
          void assignMesh(const StdString, const int);
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2203)
@@ -326,4 +326,26 @@
   }
   CATCH
+
+  CDomain* CField::getAssociatedDomain(const string& domainId) const
+  {
+    if (grid_==nullptr) ERROR("CDomain* CField::getAssociatedDomain(const string& domainId)", <<" field with id="<<getId()<<" has no associated grid, "
+                              <<"check if the worklfow is enabled for this field");
+    grid_->getAssociatedDomain(domainId) ;
+  }
+
+  CAxis* CField::getAssociatedAxis(const string& axisId) const
+  {
+    if (grid_==nullptr) ERROR("CAxis* CField::getAssociatedAxis(const string& axisId)", <<" field with id="<<getId()<<" has no associated grid, "
+                              <<"check if the worklfow is enabled for this field");
+    grid_->getAssociatedAxis(axisId) ;
+  }
+
+  CScalar* CField::getAssociatedScalar(const string& scalarId) const
+  {
+    if (grid_==nullptr) ERROR("CScalar* CField::getAssociatedScalar(const string& scalarId)", <<" field with id="<<getId()<<" has no associated grid, "
+                              <<"check if the worklfow is enabled for this field");
+    grid_->getAssociatedScalar(scalarId) ;
+  }
+
 
   func::CFunctor::ETimeType CField::getOperationTimeType() const
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 2203)
@@ -48,4 +48,7 @@
    class CContext;
    class CGenericFilter;
+   class CDomain ;
+   class CAxis ;
+   class CScalar ;
 
    class CGarbageCollector;
@@ -101,4 +104,7 @@
          CGrid* getRelGrid(void) const;
          CFile* getRelFile(void) const;
+         CDomain* getAssociatedDomain(const std::string& domainId) const;
+         CAxis*   getAssociatedAxis(const std::string& axisId) const;
+         CScalar* getAssociatedScalar(const std::string& scalarId) const;
 
          func::CFunctor::ETimeType getOperationTimeType() const;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2203)
@@ -30,4 +30,5 @@
 #include "algo_types.hpp"
 
+#include <regex>
 
 namespace xios
@@ -398,4 +399,164 @@
   }
   CATCH_DUMP_ATTR
+
+  CDomain* CGrid::getAssociatedDomain(const string& domainId)
+  {
+    const regex r("\\[[0-9]*\\]");
+    smatch m;
+    string id=domainId ;
+    int pos=-1 ;
+    if (regex_search(domainId, m, r))
+    {
+        if (m.size()!=1) ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<" domainId = "<<domainId<< "  -> bad format id, separator [] append more than one time");
+        id=m.prefix() ;
+        pos = stoi(m.str(0).substr(1,m.str(0).size()-2)) ;
+    }
+    std::vector<CDomain*> domainList = this->getDomains();
+    if (domainList.empty()) ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<"no domain is compsing the grid");
+    if (id.empty())
+    {
+      if (pos==-1)
+      {
+        if (domainList.size()==1) return domainList[0] ;
+        else ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<"the grid contain more than 1 domain, use [#n] to specify which one must be retrieved");
+      }
+      else
+      {
+        if (domainList.size()>pos) return domainList[pos] ;
+        else ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<"the position of the requested domain [ pos = "<<pos
+                   <<" ] is greater than the number of domain composing the grid  [ numDomain = "<<domainList.size()<<" ]");
+      }
+    }
+    else
+    {
+      if (pos==-1) 
+      {
+        int nbDomain=0 ;
+        for(int i=0; i<domainList.size();i++) if (domainList[i]->getTemplateId()==id) nbDomain++ ;
+        if (nbDomain>1) ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<"no domain with the id = "<<id
+                              <<" is composing the grid") ;
+        if (nbDomain==0) ERROR("CGrid::getAssociatedDomain(const string& domainId)", <<"the grid contain more than 1 domain with the id = "
+                               <<id<<" , use [#n] to specify which one must be retrieved") ;
+        for(int i=0; i<domainList.size();i++) if (domainList[i]->getTemplateId()==id) return domainList[i]  ;
+      }
+      else
+      {
+        int currentPos=0 ;
+        for(int i=0; i<domainList.size();i++) 
+        {
+          if (domainList[i]->getTemplateId()==id && pos==currentPos) return domainList[i] ;
+          currentPos++ ;
+        }
+        ERROR("CGrid::getAssociatedDomain(const string& domainId)",<<"Cannot find domain with [ id = "<< id <<" ] at [ pos = "<<pos<<" ] in the grid");
+      }  
+    }
+  } 
+
+  CAxis* CGrid::getAssociatedAxis(const string& axisId)
+  {
+    const regex r("\\[[0-9]*\\]");
+    smatch m;
+    string id=axisId ;
+    int pos=-1 ;
+    if (regex_search(axisId, m, r))
+    {
+        if (m.size()!=1) ERROR("CGrid::getAssociatedAxis(const string& axisId)", <<" axisId = "<<axisId<< "  -> bad format id, separator [] append more than one time");
+        id=m.prefix() ;
+        pos = stoi(m.str(0).substr(1,m.str(0).size()-2)) ;
+    }
+    std::vector<CAxis*> axisList = this->getAxis();
+    if (axisList.empty()) ERROR("CGrid::getAssociatedAxis(const string& AxisId)", <<"no axis is composing the grid");
+    if (id.empty())
+    {
+      if (pos==-1)
+      {
+        if (axisList.size()==1) return axisList[0] ;
+        else ERROR("CGrid::getAssociatedAxis(const string& axisId)", <<"the grid contain more than 1 axis, use [#n] to specify which one must be retrieved");
+      }
+      else
+      {
+        if (axisList.size()>pos) return axisList[pos] ;
+        else ERROR("CGrid::getAssociatedAxis(const string& axisId)", <<"the position of the requested axis [ pos = "<<pos
+                   <<" ] is greater than the number of axis composing the grid  [ numAxis = "<<axisList.size()<<" ]");
+      }
+    }
+    else
+    {
+      if (pos==-1) 
+      {
+        int nbAxis=0 ;
+        for(int i=0; i<axisList.size();i++) if (axisList[i]->getTemplateId()==id) nbAxis++ ;
+        if (nbAxis>1) ERROR("CGrid::getAssociatedAxis(const string& axisId)", <<"no axis with the id = "<<id
+                              <<" is composing the grid") ;
+        if (nbAxis==0) ERROR("CGrid::getAssociatedAxis(const string& axisId)", <<"the grid contain more than 1 axis with the id = "
+                               <<id<<" , use [#n] to specify which one must be retrieved") ;
+        for(int i=0; i<axisList.size();i++) if (axisList[i]->getTemplateId()==id) return axisList[i]  ;
+      }
+      else
+      {
+        int currentPos=0 ;
+        for(int i=0; i<axisList.size();i++) 
+        {
+          if (axisList[i]->getTemplateId()==id && pos==currentPos) return axisList[i] ;
+          currentPos++ ;
+        }
+        ERROR("CGrid::getAssociatedAxis(const string& axisId)",<<"Cannot find axis with [ id = "<< id <<" ] at [ pos = "<<pos<<" ] in the grid");
+      }  
+    }
+  } 
+
+  CScalar* CGrid::getAssociatedScalar(const string& scalarId)
+  {
+    const regex r("\\[[0-9]*\\]");
+    smatch m;
+    string id=scalarId ;
+    int pos=-1 ;
+    if (regex_search(scalarId, m, r))
+    {
+        if (m.size()!=1) ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<" scalarId = "<<scalarId<< "  -> bad format id, separator [] append more than one time");
+        id=m.prefix() ;
+        pos = stoi(m.str(0).substr(1,m.str(0).size()-2)) ;
+    }
+    std::vector<CScalar*> scalarList = this->getScalars();
+    if (scalarList.empty()) ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<"no scalar is composing the grid");
+    if (id.empty())
+    {
+      if (pos==-1)
+      {
+        if (scalarList.size()==1) return scalarList[0] ;
+        else ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<"the grid contain more than 1 scalar, use [#n] to specify which one must be retrieved");
+      }
+      else
+      {
+        if (scalarList.size()>pos) return scalarList[pos] ;
+        else ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<"the position of the requested scalar [ pos = "<<pos
+                   <<" ] is greater than the number of scalar composing the grid  [ numScalar = "<<scalarList.size()<<" ]");
+      }
+    }
+    else
+    {
+      if (pos==-1) 
+      {
+        int nbScalar=0 ;
+        for(int i=0; i<scalarList.size();i++) if (scalarList[i]->getTemplateId()==id) nbScalar++ ;
+        if (nbScalar>1) ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<"no scalar with the id = "<<id
+                              <<" is composing the grid") ;
+        if (nbScalar==0) ERROR("CGrid::getAssociatedScalar(const string& scalarId)", <<"the grid contain more than 1 scalar with the id = "
+                               <<id<<" , use [#n] to specify which one must be retrieved") ;
+        for(int i=0; i<scalarList.size();i++) if (scalarList[i]->getTemplateId()==id) return scalarList[i]  ;
+      }
+      else
+      {
+        int currentPos=0 ;
+        for(int i=0; i<scalarList.size();i++) 
+        {
+          if (scalarList[i]->getTemplateId()==id && pos==currentPos) return scalarList[i] ;
+          currentPos++ ;
+        }
+        ERROR("CGrid::getAssociatedScalar(const string& scalarId)",<<"Cannot find scalar with [ id = "<< id <<" ] at [ pos = "<<pos<<" ] in the grid");
+      }  
+    }
+  } 
+
 
   /*!
@@ -1737,7 +1898,19 @@
               cout<<"Create new domain : "<<dstDomain->getId()<<" with alias : "<<dstElementId<<endl ;
 
-              if (isGenerate) dstDomain->duplicateAttributes(lastDstDomain) ;
-              else if (srcElementId=="" && srcElement.type==TYPE_DOMAIN)  dstDomain->duplicateAttributes(srcElement.domain) ; // make a copy
-              else dstDomain->duplicateAttributes(dstElement.domain) ; // make a copy
+              if (isGenerate) 
+              {
+                dstDomain->duplicateAttributes(lastDstDomain) ;
+                dstDomain->setTemplateId(lastDstDomain) ;
+              }
+              else if (srcElementId=="" && srcElement.type==TYPE_DOMAIN)  
+              {
+                dstDomain->duplicateAttributes(srcElement.domain) ; // make a copy
+                dstDomain->setTemplateId(srcElement.domain) ;
+              }
+              else 
+              {
+                dstDomain->duplicateAttributes(dstElement.domain) ; // make a copy
+                dstDomain->setTemplateId(dstElement.domain) ;
+              }
               CTransformation<CDomain>* transformation = CTransformation<CDomain>::createTransformation(transType,"") ;
               auto srcTransform = CTransformation<CDomain>::getTransformation(transType, transId) ;
@@ -1787,7 +1960,19 @@
               cout<<"Create new axis : "<<dstAxis->getId()<<" with alias : "<<dstElementId<<endl ;
               
-              if (isGenerate) dstAxis->duplicateAttributes(lastDstAxis) ;
-              else if (srcElementId=="" && srcElement.type==TYPE_AXIS)  dstAxis->duplicateAttributes(srcElement.axis) ; // make a copy
-              else dstAxis->duplicateAttributes(dstElement.axis) ; // make a copy
+              if (isGenerate) 
+              {
+                dstAxis->duplicateAttributes(lastDstAxis) ;
+                dstAxis->setTemplateId(lastDstAxis) ;
+              }
+              else if (srcElementId=="" && srcElement.type==TYPE_AXIS)  
+              { 
+                dstAxis->duplicateAttributes(srcElement.axis) ; // make a copy
+                dstAxis->setTemplateId(srcElement.axis) ;
+              }
+              else 
+              {
+                dstAxis->duplicateAttributes(dstElement.axis) ; // make a copy$
+                dstAxis->setTemplateId(dstElement.axis) ;
+              }
               CTransformation<CAxis>* transformation = CTransformation<CAxis>::createTransformation(transType,"") ;
               auto srcTransform = CTransformation<CAxis>::getTransformation(transType, transId) ;
@@ -1836,7 +2021,19 @@
               cout<<"Create new scalar : "<<dstScalar->getId()<<" with alias : "<<dstElementId<<endl ;
               
-              if (isGenerate) dstScalar->duplicateAttributes(lastDstScalar) ;
-              else if (srcElementId=="" && srcElement.type==TYPE_SCALAR)  dstScalar->duplicateAttributes(srcElement.scalar) ; // make a copy
-              else dstScalar->duplicateAttributes(dstElement.scalar) ; // make a copy
+              if (isGenerate) 
+              {
+                dstScalar->duplicateAttributes(lastDstScalar) ;
+                dstScalar->setTemplateId(lastDstScalar) ;
+              }
+              else if (srcElementId=="" && srcElement.type==TYPE_SCALAR)
+              {
+                dstScalar->duplicateAttributes(srcElement.scalar) ; // make a copy
+                dstScalar->setTemplateId(srcElement.scalar) ;
+              }
+              else 
+              {
+                dstScalar->duplicateAttributes(dstElement.scalar) ; // make a copy
+                dstScalar->setTemplateId(dstElement.scalar) ;
+              }
               CTransformation<CScalar>* transformation = CTransformation<CScalar>::createTransformation(transType,"") ;
               auto srcTransform = CTransformation<CScalar>::getTransformation(transType, transId) ;
@@ -1993,4 +2190,5 @@
           CDomain* domain = CDomain::create();
           domain->duplicateAttributes(element.domain) ;
+          domain->setTemplateId(element.domain) ;
           domain->name = element.domain->getId() ;
           newGrid->addDomain(domain->getId()) ;
@@ -2000,4 +2198,5 @@
           CAxis* axis = CAxis::create();
           axis->duplicateAttributes(element.axis) ;
+          axis->setTemplateId(element.axis) ;
           axis->name = element.axis->getId() ;
           newGrid->addAxis(axis->getId()) ;
@@ -2007,4 +2206,5 @@
           CScalar* scalar = CScalar::create();
           scalar->duplicateAttributes(element.scalar) ;
+          scalar->setTemplateId(element.scalar) ;
           scalar->name = element.scalar->getId() ;
           newGrid->addScalar(scalar->getId()) ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 2203)
@@ -147,4 +147,7 @@
          static CGrid* cloneGrid(const StdString& idNewGrid, CGrid* gridSrc);
 
+         CDomain* getAssociatedDomain(const string& domainId) ;
+         CAxis*   getAssociatedAxis(const string& axisId) ;
+         CScalar* getAssociatedScalar(const string& scalarId) ;
       public:            
          void solveDomainAxisRef(bool areAttributesChecked);
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 2203)
@@ -9,4 +9,7 @@
 #include "context.hpp"
 
+#include <algorithm>
+#include <regex>
+
 namespace xios 
 {
@@ -48,4 +51,20 @@
     CScalar* scalar = CScalarGroup::get("scalar_definition")->createChild();
     return scalar;
+  }
+
+  CScalar* CScalar::get(const string& id)
+  {
+    const regex r("::");
+    smatch m;
+    if (regex_search(id, m, r))
+    {
+      if (m.size()!=1) ERROR("CScalar* CScalar::get(string& id)", <<" id = "<<id<< "  -> bad format id, separator :: append more than one time");
+      string fieldId=m.prefix() ;
+      if (fieldId.empty()) ERROR("CScalar* CScalar::get(string& id)", <<" id = "<<id<< "  -> bad format id, field name is empty");
+      string suffix=m.suffix() ;
+      CField* field=CField::get(fieldId) ;
+      return field->getAssociatedScalar(suffix) ;
+    }
+    else return CObjectFactory::GetObject<CScalar>(id).get();
   }
 
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 2203)
@@ -78,4 +78,5 @@
     public:
       static CScalar* createScalar();
+      static CScalar* get(const string& id) ; //<! return scalar pointer using id
 
     public:
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 2203)
@@ -85,5 +85,5 @@
          static T* createAlias(const string& id, const string& alias) ;
          void createAlias(const string& alias) ;
-         
+
          static const vector<T*> getAll() ;
          static const vector<T*> getAll(const string& contextId) ;
@@ -92,5 +92,29 @@
          void generateFortran2003Interface(ostream& oss) ;
          void generateFortranInterface(ostream& oss) ;
+      
+      // manage inherited id which is herited by reference
+        void setInheritedId(T* obj) ;
+        bool hasInheritedId(void) { return hasInheritedId_ ;}
+        string getInheritedId(void) { return  inheritedId_ ;}
 
+      private:  
+         std::string inheritedId_ ;
+         bool hasInheritedId_ = false;
+
+      // manage the template id
+      public:
+         void setTemplateId(T* obj) ; //<! set the id of the object that served as template 
+         bool hasTemplateId(void) {return hasTemplateId_;} //<! return  hasTemplateId_
+         string getTemplateId(void)
+         {
+           if (hasTemplateId_) return templateId_  ;
+           else if (hasId() && !hasAutoGeneratedId()) return getId() ;
+           else if (hasInheritedId()) return getInheritedId() ;
+           else return getId() ;
+         }
+      private:
+         std::string templateId_ ;    //<! the id of the object that served as template 
+         bool hasTemplateId_ = false; //<! true if templateId is set
+      
       protected :
 
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 2199)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 2203)
@@ -157,4 +157,40 @@
    }
 
+   // ---------------------------------------------------------------
+   template <class T>
+   void CObjectTemplate<T>::setInheritedId(T* obj)
+   {
+     if (!hasInheritedId_)
+     {
+       if (!(hasId() && !hasAutoGeneratedId())) 
+        if (obj->hasId() && !obj->hasAutoGeneratedId()) 
+        {
+          hasInheritedId_=true ;
+          inheritedId_=obj->getId() ;
+        } 
+     }
+   }
+
+   template <class T>
+   void CObjectTemplate<T>::setTemplateId(T* obj)
+   {
+     if (hasId() && !hasAutoGeneratedId())
+     {
+        templateId_ = getId() ;
+        hasTemplateId_ = true ;
+     }
+     else if (obj->hasId() && !obj->hasAutoGeneratedId())
+     {
+       templateId_ = obj->getId() ;
+       hasTemplateId_ = true ;
+     }
+     else if (obj->hasTemplateId())
+     {
+       templateId_= obj->getTemplateId() ;
+       hasTemplateId_=true ;
+     }
+   }
+   
+   
    //---------------------------------------------------------------
 
