1 // Created on: 2007-05-29
2 // Created by: Vlad Romashko
3 // Copyright (c) 2007-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <MDataStd_RealListStorageDriver.ixx>
17 #include <PDataStd_RealList.hxx>
18 #include <TDataStd_RealList.hxx>
19 #include <MDataStd.hxx>
20 #include <CDM_MessageDriver.hxx>
21 #include <TColStd_ListIteratorOfListOfReal.hxx>
23 //=======================================================================
24 //function : MDataStd_RealListStorageDriver
26 //=======================================================================
27 MDataStd_RealListStorageDriver::MDataStd_RealListStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
32 //=======================================================================
33 //function : VersionNumber
35 //=======================================================================
36 Standard_Integer MDataStd_RealListStorageDriver::VersionNumber() const
42 //=======================================================================
43 //function : SourceType
45 //=======================================================================
46 Handle(Standard_Type) MDataStd_RealListStorageDriver::SourceType() const
48 static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_RealList);
52 //=======================================================================
55 //=======================================================================
56 Handle(PDF_Attribute) MDataStd_RealListStorageDriver::NewEmpty() const
58 return new PDataStd_RealList();
61 //=======================================================================
64 //=======================================================================
65 void MDataStd_RealListStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
66 const Handle(PDF_Attribute)& Target,
67 const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
69 const Handle(TDataStd_RealList) S = Handle(TDataStd_RealList)::DownCast (Source);
70 const Handle(PDataStd_RealList) T = Handle(PDataStd_RealList)::DownCast (Target);
72 Standard_Integer lower(1), upper = S->Extent();
75 T->Init(lower, upper);
77 else if (upper >= lower)
79 T->Init(lower, upper);
80 TColStd_ListIteratorOfListOfReal itr(S->List());
81 for (Standard_Integer i = lower; itr.More(); itr.Next(), i++) {
82 T->SetValue(i, itr.Value());