Version: 9.16.0
GEOM_List_i.hh
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2.1 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef __GEOM_LIST_I_H__
24#define __GEOM_LIST_I_H__
25
26#include "GEOM_I_Superv.hxx"
27
28// IDL headers
29#include <SALOMEconfig.h>
30#include CORBA_SERVER_HEADER(GEOM_Superv)
31
32#include "utilities.h"
33
34template <class Type>
36 public virtual POA_GEOM::GEOM_List,
37 public virtual PortableServer::RefCountServantBase
38{
39public:
41 GEOM_List_i(const Type& theListToCopy);
43
44 const Type& GetList();
45
46 template <class ElemType>
47 void AddObject(ElemType theObject);
48
49private:
51};
52
53//=============================================================================
54// constructor:
55//=============================================================================
56template <class Type>
58{
59 MESSAGE("GEOM_List_i::GEOM_List_i");
60 //create an empty list
61 myGOList.length(0);
62}
63
64//=============================================================================
65// constructor:
66//=============================================================================
67template <class Type>
69{
70 int aLength = theListToCopy.length();
71 myGOList.length(aLength);
72 for (int i = 0; i < aLength; i++)
73 myGOList[i] = theListToCopy[i];
74}
75
76//=============================================================================
77// destructor:
78//=============================================================================
79template <class Type>
81{
82 MESSAGE("GEOM_List_i::~GEOM_List_i");
83}
84
85//=============================================================================
86// GetList:
87//=============================================================================
88template <class Type>
90{
91 MESSAGE("GEOM_List_i::GetList()");
92 return myGOList;
93}
94
95//=============================================================================
96// AddObject:
97//=============================================================================
98template <class Type>
99template <class ElemType>
100void GEOM_List_i<Type>::AddObject(ElemType theObject)
101{
102 MESSAGE("GEOM_List_i::AddObject(...)");
103 int aLength = myGOList.length();
104 myGOList.length(aLength+1);
105 myGOList[aLength] = theObject;
106}
107
108#endif
#define GEOM_I_SUPERV_EXPORT
Definition: GEOM_I_Superv.hxx:37
Definition: GEOM_List_i.hh:38
const Type & GetList()
Definition: GEOM_List_i.hh:89
GEOM_List_i()
Definition: GEOM_List_i.hh:57
void AddObject(ElemType theObject)
Definition: GEOM_List_i.hh:100
Type myGOList
Definition: GEOM_List_i.hh:50
~GEOM_List_i()
Definition: GEOM_List_i.hh:80
Type
Definition: XAO_XaoUtils.hxx:62