0025324: Make OCCT collections copy-constructible
[occt.git] / src / TCollection / TCollection_Sequence.lxx
CommitLineData
b311480e 1// Created on: 1992-12-22
2// Created by: Remi LEQUETTE
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17//=======================================================================
18//function : Empty constructor
19//purpose :
20//=======================================================================
21
22inline TCollection_Sequence::TCollection_Sequence()
23{
24}
25
39ef94f8 26//=======================================================================
27//function : Copy constructor
28//purpose :
29//=======================================================================
30
31inline TCollection_Sequence::TCollection_Sequence(const TCollection_Sequence& theOther)
32{
33 Assign(theOther);
34}
35
7fd59977 36//=======================================================================
37//function : Append
38//purpose : Appends a Sequence to myself
39//=======================================================================
40inline void TCollection_Sequence::Append (TCollection_Sequence& S)
41{
42 if (FirstItem == S.FirstItem) Assign(S);
43 PAppend (S);
44}
45
46//=======================================================================
47//function : Prepend
48//purpose : Prepends a Sequence to myself
49//=======================================================================
50inline void TCollection_Sequence::Prepend (TCollection_Sequence& S)
51{
52 if (FirstItem == S.FirstItem) Assign(S);
53 PPrepend (S);
54}
55//=======================================================================
56//function : InsertBefore
57//purpose : Inserts an item before an index
58//=======================================================================
59inline void TCollection_Sequence::InsertBefore (const Standard_Integer Index,
60 const SeqItem& I)
61{
62 InsertAfter(Index-1,I);
63}
64
65//=======================================================================
66//function : InsertBefore
67//purpose : Inserts a Sequence before an index
68//=======================================================================
69inline void TCollection_Sequence::InsertBefore (const Standard_Integer Index,
70 TCollection_Sequence& S)
71{
72 InsertAfter(Index-1,S);
73}
74
75//=======================================================================
76//function : InsertAfter
77//purpose : Inserts a Sequence after an index
78//=======================================================================
79inline void TCollection_Sequence::InsertAfter (const Standard_Integer Index,
80 TCollection_Sequence& S)
81{
82 PInsertAfter(Index,S);
83}
84
85//=======================================================================
86//function : Split
87//purpose : Cuts a Sequence into two
88//=======================================================================
89inline void TCollection_Sequence::Split (const Standard_Integer Index,
90 TCollection_Sequence& S)
91{
92 S.Clear();
93 PSplit(Index,S);
94}
95
96
97
98
99
100
101