summaryrefslogtreecommitdiff
path: root/src/vm/weakreferencenative.h
blob: 0d946f9855d97808f23f787d9bee70d051730f55 (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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*============================================================
**
** Header: WeakReferenceNative.h
**
**
===========================================================*/

#ifndef _WEAKREFERENCENATIVE_H
#define _WEAKREFERENCENATIVE_H

//
// The implementations of WeakReferenceNative and WeakReferenceOfTNative are identical, but the managed signatures
// are different. WeakReferenceOfTNative has strongly typed signatures. It is necessary for correct security transparancy
// annotations without compromising inlining (security critical code cannot be inlined into security neutral code).
//

class WeakReferenceNative
{
public:
    static FCDECL3(void, Create, WeakReferenceObject * pThis, Object * pTarget, CLR_BOOL trackResurrection);
    static FCDECL1(void, Finalize, WeakReferenceObject * pThis);
    static FCDECL1(Object *, GetTarget, WeakReferenceObject * pThis);
    static FCDECL2(void, SetTarget, WeakReferenceObject * pThis, Object * pTarget);
    static FCDECL1(FC_BOOL_RET, IsTrackResurrection, WeakReferenceObject * pThis);
    static FCDECL1(FC_BOOL_RET, IsAlive, WeakReferenceObject * pThis);
};

class WeakReferenceOfTNative
{
public:
    static FCDECL3(void, Create, WeakReferenceObject * pThis, Object * pTarget, CLR_BOOL trackResurrection);
    static FCDECL1(void, Finalize, WeakReferenceObject * pThis);
    static FCDECL1(Object *, GetTarget, WeakReferenceObject * pThis);
    static FCDECL2(void, SetTarget, WeakReferenceObject * pThis, Object * pTarget);
    static FCDECL1(FC_BOOL_RET, IsTrackResurrection, WeakReferenceObject * pThis);
};

#endif // _WEAKREFERENCENATIVE_H