%description: Customize cObject-rooted class, abstract fields %file: {}.msg class {MyClass} extends cObject { properties: customize = true; fields: int b; abstract int i; } %global: #include "{}_m.h" class {MyClass} : public {MyClass_Base} { private: int m; public: {MyClass}(const char *name=NULL) : {MyClass_Base}(name) {m=0;} {MyClass}(const {MyClass}& other) : {MyClass_Base}() {operator=(other);setName(other.name());} {MyClass}& operator=(const {MyClass}& other) {{MyClass_Base}::operator=(other); m=other.m; return *this;} virtual cObject *dup() {return new {MyClass}(*this);} virtual int getI() const {return m;} virtual void setI(int i) {m=i;} }; Register_Class({MyClass}); %activity: #define PRINT(X) ev << #X << ":" << X << endl {MyClass} x("myclass"); ev << (dynamic_cast(&x)!=0 ? "cObject" : "generic") << endl; ev << x.className() << ":" << x.name() << endl; x.setB(11); PRINT(x.getB()); x.setI(11); PRINT(x.getI()); %contains: stdout cObject {MyClass}:myclass x.getB():11 x.getI():11