]> SALOME platform Git repositories - modules/kernel.git/blob - src/HDFPersist/HDFcontainerObject.cc
Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/kernel.git] / src / HDFPersist / HDFcontainerObject.cc
1 using namespace std;
2 extern "C"
3 {
4 #include "hdfi.h"
5 }
6 #include "HDFcontainerObject.hxx"
7 #include "HDFexception.hxx"
8 #include "utilities.h"
9
10 HDFcontainerObject::HDFcontainerObject(char *name)
11   : HDFinternalObject(name)
12 {
13   _nsons = 0;
14   _firstson = NULL;
15   _lastson = NULL;
16 }
17
18 HDFcontainerObject::~HDFcontainerObject()
19 {
20   HDFinternalObject *sonToDelete = 0;
21   while(_firstson)
22     {
23       sonToDelete = _firstson;
24       _firstson = _firstson->GetNextBrother();
25 //       MESSAGE("son to delete: " << sonToDelete);
26       delete sonToDelete;
27     }
28 //   MESSAGE("destruction: " << this);
29 }
30
31 int HDFcontainerObject::nInternalObjects()
32 {
33   return 0;
34 }
35
36 void HDFcontainerObject::InternalObjectIndentify(int rank, char *object_name)
37 {
38   object_name = NULL;
39 }
40
41 void HDFcontainerObject::AddSon(HDFinternalObject *son)
42 {
43 //   MESSAGE("add son ")  MESSAGE("add to this" << this);
44 //   MESSAGE("add son " << son);
45 //   MESSAGE("firstson " << _firstson);
46 //   MESSAGE("lastson  " << _lastson);
47
48   if (_nsons == 0)
49     {
50       _firstson = son;
51       _lastson = _firstson;
52     }
53   else
54     {
55       _lastson->SetNextBrother(son);
56       son->SetPreviousBrother(_lastson);
57       _lastson = son;
58     }
59   _nsons ++;
60 //   MESSAGE("firstson " << _firstson);
61 //   MESSAGE("lastson  " << _lastson);
62 }
63
64 HDFinternalObject *HDFcontainerObject::GetFirstSon()
65 {
66   return _firstson;
67 }
68
69 HDFinternalObject *HDFcontainerObject::GetLastSon()
70 {
71   return _lastson;
72 }
73
74 int HDFcontainerObject::nSons()
75 {
76   return _nsons;
77 }