If you're hacky enough, you can now call into auto-generated interfaces from
[wvapps.git] / xplcidl / mymulti.h
blobfd42450e0c14427f51ae45dfb31ae5f7dc2e8124
1 #ifndef __MYMULTI_H
2 #define __MYMULTI_H
4 #include "IObject.h"
5 #include "IMulti.hpp"
6 #include <xplc/utils.h>
7 #include "wvstring.h"
9 class MyMulti : public IMulti
11 IMPLEMENT_IOBJECT(MyMulti);
12 public:
13 WvString s;
15 MyMulti(WvStringParm _s)
16 : s(_s)
17 { printf("creating '%s'\n", s.cstr()); }
19 virtual ~MyMulti()
20 { printf("deleting '%s'\n", s.cstr()); }
22 virtual const char *getString() { return s.edit(); }
23 virtual void setString(const char *_s) { s = _s; }
25 virtual int getInt() { return s.num(); }
26 virtual void setInt(int i) { s = i; }
28 virtual bool getBool() { return !!s; }
29 virtual void setBool(bool b) { s = b; }
31 // FIXME: this is a hack to make things slightly less ugly when
32 // typecasting, because C++ can't deal with lots of IObject-based parents.
33 operator IObject*()
34 { return (IString *)this; }
37 #endif // __MYMULTI_H