0031939: Coding - correction of spelling errors in comments [part 10]
[occt.git] / src / StdLPersistent / StdLPersistent_Dependency.cxx
1 // Copyright (c) 2015 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <StdLPersistent_Dependency.hxx>
15
16
17 static void ImportName (const Handle(TDataStd_Expression)& theAttribute,
18                         const TCollection_ExtendedString&  theName)
19   { theAttribute->SetExpression (theName); }
20
21 static void ImportName (const Handle(TDataStd_Relation)&  theAttribute,
22                         const TCollection_ExtendedString& theName)
23   { theAttribute->SetRelation (theName); }
24
25
26 //=======================================================================
27 //function : Import
28 //purpose  : Import transient attribute from the persistent data
29 //=======================================================================
30 template <class AttribClass>
31 void StdLPersistent_Dependency::instance<AttribClass>::Import
32   (const Handle(AttribClass)& theAttribute) const
33 {
34   if (myName)
35     ImportName (theAttribute, myName->Value()->String());
36
37   if (myVariables)
38   {
39     StdLPersistent_HArray1OfPersistent::Iterator anIter (*myVariables->Array());
40     for (; anIter.More(); anIter.Next())
41     {
42       const Handle(StdObjMgt_Persistent) aPersistent = anIter.Value();
43       if (aPersistent)
44         theAttribute->GetVariables().Append (aPersistent->GetAttribute());
45     }
46   }
47 }
48
49
50 template class StdLPersistent_Dependency::instance<TDataStd_Expression>;
51 template class StdLPersistent_Dependency::instance<TDataStd_Relation>;