Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 65 lines (56 sloc) 1.948 kB
0c910b8 @NotFound start reorganizing components
authored
1 #ifndef INCLUDE_WINXEDXX_OBJECT_H
2 #define INCLUDE_WINXEDXX_OBJECT_H
3
4 // winxedxx_object.h
21f52be @NotFound more reorganization
authored
5 // (C) 2011 Julián Albo "NotFound"
0c910b8 @NotFound start reorganizing components
authored
6
7 namespace WinxedXX
8 {
9
10 class WxxObject
11 {
12 public:
13 virtual int is_null() const = 0;
14 virtual int instanceof(const std::string &type) = 0;
15 virtual int get_bool() = 0;
16 virtual int get_integer() = 0;
17 virtual double get_number() = 0;
18 virtual int elements() = 0;
19 virtual std::string get_string() = 0;
20 virtual WxxObject & set(int value) = 0;
21 virtual WxxObject & set(double value) = 0;
22 virtual WxxObject & set(const char *s) = 0;
23 virtual WxxObject & set(const std::string &s) = 0;
24 virtual std::string get_string_keyed(int i) = 0;
25 virtual WxxObjectPtr get_pmc_keyed(int i) = 0;
26 virtual WxxObjectPtr get_pmc_keyed(const std::string &s) = 0;
27 virtual WxxObjectPtr get_pmc_keyed(const char *s) = 0;
28 virtual void set_pmc_keyed(int i, const WxxObjectPtr &value) = 0;
000b8f1 @NotFound implement 'exists'
authored
29 virtual int exists(const std::string &key) = 0;
0c910b8 @NotFound start reorganizing components
authored
30 virtual WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) = 0;
31 virtual WxxObjectPtr & get_attr_str(const std::string &s) = 0;
32 virtual void set_attr_str(const std::string &s, const WxxObjectPtr &value) = 0;
33 virtual WxxObjectPtr get_iter() = 0;
34 virtual WxxObjectPtr shift_pmc() = 0;
35
36 virtual WxxObjectPtr operator()(WxxObjectArray &args) = 0;
37 virtual WxxObjectPtr call_method(const std::string &methname, WxxObjectArray &args) = 0;
38 virtual void print() = 0;
39 virtual void print(WxxObjectPtr obj) = 0;
40 void incref() { ++numrefs; }
41 void decref()
42 {
43 --numrefs;
44 if (numrefs <= 0)
45 delete this;
46 }
47 protected:
48 int numrefs;
49 WxxObject()
50 {
51 numrefs = 0;
52 }
53 virtual ~WxxObject() { }
54 };
55
21f52be @NotFound more reorganization
authored
56 WxxObjectPtr wxx_getstdin();
57 WxxObjectPtr wxx_getstdout();
58 WxxObjectPtr wxx_getstderr();
59
0c910b8 @NotFound start reorganizing components
authored
60 } // namespace WinxedXX
61
62 #endif
63
64 // End of winxedxx_object.h
Something went wrong with that request. Please try again.