Annotation of parser3/src/types/pa_vstateless_class.C, revision 1.5
1.2 paf 1: /*
2: Parser
3: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
4: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
5:
1.5 ! paf 6: $Id: pa_vstateless_class.C,v 1.4 2001/03/18 13:38:49 paf Exp $
1.2 paf 7: */
8:
9: #include "pa_vstateless_class.h"
10: #include "pa_vstring.h"
11:
12: void VStateless_class::add_native_method(
13: const char *cstr_name,
14: Native_code_ptr native_code,
15: int min_numbered_params_count, int max_numbered_params_count) {
16:
1.4 paf 17: String& name=*NEW String(pool(), cstr_name);
1.2 paf 18:
19: Method& method=*NEW Method(pool(),
20: name,
21: min_numbered_params_count, max_numbered_params_count,
22: 0/*params_names*/, 0/*locals_names*/,
23: 0/*parser_code*/, native_code
24: );
25: add_method(name, method);
26: }
27:
28: void VStateless_class::put_method(const String& aname, Method *amethod) {
29: if(read_only)
30: THROW(0, 0,
31: &aname,
32: "can not add method to read-only '%s' class",
33: name().cstr());
34:
35: fmethods.put(aname, amethod);
36: }
E-mail: