summaryrefslogtreecommitdiff
path: root/src/MDocStd/MDocStd_XLinkRetrievalDriver.cxx
blob: 0f114e4a5b81e4f0c1c1379383423095e6272bab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// File:	MDocStd_XLinkRetrievalDriver.cxx
//      	-----------------------------
// Author:	DAUTRY Philippe
//		<fid@fox.paris1.matra-dtv.fr>
// Copyright:	Matra Datavision 1997

// Version:	0.0
// History:	Version	Date		Purpose
//		0.0	Sep 17 1997	Creation



#include <MDocStd_XLinkRetrievalDriver.ixx>
#include <TDocStd_XLink.hxx>
#include <PDocStd_XLink.hxx>
#include <TCollection_AsciiString.hxx>
#include <PCollection_HAsciiString.hxx>
#include <CDM_MessageDriver.hxx>

#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
#define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)

//=======================================================================
//function : MDocStd_XLinkRetrievalDriver
//purpose  : 
//=======================================================================

MDocStd_XLinkRetrievalDriver::MDocStd_XLinkRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{}


//=======================================================================
//function : VersionNumber
//purpose  : 
//=======================================================================

Standard_Integer MDocStd_XLinkRetrievalDriver::VersionNumber() const
{ return 0; }


//=======================================================================
//function : SourceType
//purpose  : 
//=======================================================================

Handle(Standard_Type) MDocStd_XLinkRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDocStd_XLink); }


//=======================================================================
//function : NewEmpty
//purpose  : 
//=======================================================================

Handle(TDF_Attribute) MDocStd_XLinkRetrievalDriver::NewEmpty() const
{ return new TDocStd_XLink(); }


//=======================================================================
//function : Paste
//purpose  : 
//=======================================================================

void MDocStd_XLinkRetrievalDriver::Paste
(const Handle(PDF_Attribute)& aSource,
 const Handle(TDF_Attribute)& aTarget,
// const Handle(MDF_RRelocationTable)& aRelocTable) const
 const Handle(MDF_RRelocationTable)& ) const
{
  DeclareConstAndSpeedCast(aSource,PDocStd_XLink,pxref);
  DeclareConstAndSpeedCast(aTarget,TDocStd_XLink,txref);
  txref->DocumentEntry(pxref->DocumentEntry()->Convert());
  txref->LabelEntry(pxref->LabelEntry()->Convert());
}