0022627: Change OCCT memory management defaults
[occt.git] / src / LibCtl / LibCtl_GlobalNode.gxx
1 //#include <LibCtl_GlobalNode.ixx>
2
3 //  Classe generique imbriquee dans Library : utilisee pour construire les
4 //  listes globales de Modules attaches a une classe instanciee de Library
5 //  (cf Library pour plus de details)
6
7
8     LibCtl_GlobalNode::LibCtl_GlobalNode ()    {  }
9
10 // ATTENTION, Add agit en substitution : pour un Protocol donne, c est le
11 //   dernier appel qui l emporte
12     void LibCtl_GlobalNode::Add
13   (const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol)
14 {
15   if (themod == amodule) return;
16   if (theprot == aprotocol) themod = amodule;
17   else if (thenext.IsNull()) {
18     if (themod.IsNull()) {  themod = amodule;   theprot = aprotocol;  }
19     else {
20       thenext = new LibCtl_GlobalNode;
21       thenext->Add (amodule,aprotocol);
22     }
23   }
24   else thenext->Add (amodule,aprotocol);
25 }
26
27     const Handle(TheModule)& LibCtl_GlobalNode::Module () const
28       {  return themod;  }
29
30     const Handle(TheProtocol)& LibCtl_GlobalNode::Protocol () const
31       {  return theprot;  }
32
33     const Handle(LibCtl_GlobalNode)& LibCtl_GlobalNode::Next () const
34       {  return thenext;  }