3 * Copyright (C) 2006-2008, The Perl Foundation.
6 /* .NET CLI MemberRef Metadata PMC */
9 #include "parrot/extend.h"
10 #include "tableinfo.h"
11 #include "structures.h"
14 pmclass DotNetMemberRefMetadata dynpmc group dotnet {
16 /* Instance initialization. We need a custom DOD marking and destroy. */
19 PObj_custom_mark_SET(SELF);
20 PObj_active_destroy_SET(SELF);
24 /* Get string vtable function; returns the name of the member. */
27 dotnet_memberref *c = (dotnet_memberref *)PMC_struct_val(SELF);
29 /* Handle cases where we've an invalid PMC. */
30 if (!c || !c->str_name)
31 real_exception(INTERP, NULL, E_StandardError,
32 "Invalid DotNetMemberRefMetadata PMC");
38 /* Garbage Collection mark routine. */
41 /* Tell the GC about stuff we're holding on to. */
42 dotnet_memberref *c = (dotnet_memberref *)PMC_struct_val(SELF);
45 pobject_lives(INTERP, (PObj*)c->str_name);
52 /* Cleanup any memory we're using. */
53 if (PMC_struct_val(SELF)) {
54 mem_sys_free(PMC_struct_val(SELF));
55 PMC_struct_val(SELF) = NULL;
60 /* Get the location of the signature blob for this member. */
61 METHOD INTVAL get_signature()
63 dotnet_memberref *c = (dotnet_memberref *)PMC_struct_val(SELF);
66 /* Handle cases where we've an invalid PMC. */
68 real_exception(INTERP, NULL, E_StandardError,
69 "Invalid DotNetMemberRefMetadata PMC");
71 result = c->signature;
72 RETURN(INTVAL result);
76 /* Get the type of "class" that the member belongs to. */
77 METHOD INTVAL get_class_type()
79 dotnet_memberref *c = (dotnet_memberref *)PMC_struct_val(SELF);
82 /* Handle cases where we've an invalid PMC. */
84 real_exception(INTERP, NULL, E_StandardError,
85 "Invalid DotNetMemberRefMetadata PMC");
87 result = c->class_type;
88 RETURN(INTVAL result);
92 /* Get the id of "class" that the member belongs to. */
93 METHOD INTVAL get_class_id()
95 dotnet_memberref *c = (dotnet_memberref *)PMC_struct_val(SELF);
98 /* Handle cases where we've an invalid PMC. */
100 real_exception(INTERP, NULL, E_StandardError,
101 "Invalid DotNetMemberRefMetadata PMC");
103 result = c->class_id;
104 RETURN(INTVAL result);
111 * c-file-style: "parrot"
113 * vim: expandtab shiftwidth=4: