2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 // $Header: r:/t2repos/thief2/src/object/linkdata.cpp,v 1.5 1998/10/08 16:25:04 MROWLEY Exp $
14 // Must be last header
17 ////////////////////////////////////////////////////////////
19 STDMETHODIMP
cLargeLinkDataStore::Set(LinkID id
, void* data
)
21 sLinkDataTableElem
* elem
= Table
.Search(id
);
24 elem
= (sLinkDataTableElem
*)new char[Size
+sizeof(LinkID
)];
26 elem
= Table
.Insert(elem
);
28 if (data
!= elem
->data
)
29 memcpy(elem
->data
,data
,Size
);
34 STDMETHODIMP_(void*) cLargeLinkDataStore::Get(LinkID id
)
36 sLinkDataTableElem
* elem
= Table
.Search(id
);
43 STDMETHODIMP_(ulong
) cLargeLinkDataStore::DataSize()
48 STDMETHODIMP
cLargeLinkDataStore::Remove(LinkID id
)
50 sLinkDataTableElem
* elem
= Table
.Search(id
);
59 ILinkDataStore
* CreateManagedLinkDataStore(ulong data_size
)
61 return new cLargeLinkDataStore(data_size
);