0024927: Getting rid of "Persistent" functionality -- Code
[occt.git] / src / MDataStd / MDataStd_IntegerArrayRetrievalDriver.cxx
1 // Created on: 1999-06-15
2 // Created by: Sergey RUIN
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <MDataStd_IntegerArrayRetrievalDriver.ixx>
18 #include <PDataStd_IntegerArray.hxx>
19 #include <TDataStd_IntegerArray.hxx>
20 #include <MDataStd.hxx>
21 #include <CDM_MessageDriver.hxx>
22
23 //=======================================================================
24 //function : MDataStd_IntegerArrayRetrievalDriver
25 //purpose  : 
26 //=======================================================================
27
28 MDataStd_IntegerArrayRetrievalDriver::MDataStd_IntegerArrayRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
29 {}
30
31
32 //=======================================================================
33 //function : VersionNumber
34 //purpose  : 
35 //=======================================================================
36
37 Standard_Integer MDataStd_IntegerArrayRetrievalDriver::VersionNumber() const
38 { return 0; }
39
40
41 //=======================================================================
42 //function : SourceType
43 //purpose  : 
44 //=======================================================================
45
46 Handle(Standard_Type) MDataStd_IntegerArrayRetrievalDriver::SourceType() const
47 {
48   static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_IntegerArray);
49   return sourceType;
50 }
51
52
53 //=======================================================================
54 //function : NewEmpty
55 //purpose  : 
56 //=======================================================================
57
58 Handle(TDF_Attribute) MDataStd_IntegerArrayRetrievalDriver::NewEmpty () const {
59
60   return new TDataStd_IntegerArray ();
61 }
62
63
64 //=======================================================================
65 //function : Paste
66 //purpose  : 
67 //=======================================================================
68
69 void MDataStd_IntegerArrayRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
70       const Handle(TDF_Attribute)& Target,
71 //      const Handle(MDF_RRelocationTable)& RelocTable) const
72       const Handle(MDF_RRelocationTable)& ) const
73 {
74   Handle(PDataStd_IntegerArray) S = Handle(PDataStd_IntegerArray)::DownCast (Source);
75   Handle(TDataStd_IntegerArray) T = Handle(TDataStd_IntegerArray)::DownCast (Target);
76
77   Standard_Integer i, lower = S->Lower() , upper = S->Upper();
78   T->Init(lower, upper);
79   
80   for(i = lower; i<=upper; i++) T->SetValue( i, S->Value(i) );
81 }
82