Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 60 lines (52 sloc) 1.794 kB
0c910b8 @NotFound start reorganizing components
authored
1 #ifndef INCLUDE_WINXEDXX_OBJECT_H
2 #define INCLUDE_WINXEDXX_OBJECT_H
3
4 // winxedxx_object.h
5 // Revision 10-may-2011
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;
29 virtual WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) = 0;
30 virtual WxxObjectPtr & get_attr_str(const std::string &s) = 0;
31 virtual void set_attr_str(const std::string &s, const WxxObjectPtr &value) = 0;
32 virtual WxxObjectPtr get_iter() = 0;
33 virtual WxxObjectPtr shift_pmc() = 0;
34
35 virtual WxxObjectPtr operator()(WxxObjectArray &args) = 0;
36 virtual WxxObjectPtr call_method(const std::string &methname, WxxObjectArray &args) = 0;
37 virtual void print() = 0;
38 virtual void print(WxxObjectPtr obj) = 0;
39 void incref() { ++numrefs; }
40 void decref()
41 {
42 --numrefs;
43 if (numrefs <= 0)
44 delete this;
45 }
46 protected:
47 int numrefs;
48 WxxObject()
49 {
50 numrefs = 0;
51 }
52 virtual ~WxxObject() { }
53 };
54
55 } // namespace WinxedXX
56
57 #endif
58
59 // End of winxedxx_object.h
Something went wrong with that request. Please try again.