ACDK Guide - a simple class
Translation: Xue Changyu We now think you introduce ACDK object class
This chapter contains content:
C - Simple ACDK-class ACDK class
C - class because ACDK is still C , you can define a normal C class by habit
Class Aclass {INT_VAL; public: aclass (): _VAL (42) {}};
Simple ACDK-class to define an ACDK-class, you need to let him inherit in ACDK :: Lang :: Object or other ACDK-class:
#include
// Define raclass, aclassarray, and raclassautAACDK_DECL_CLASS (ACLASS);
Class ACLASS: EXTENDS ACDK :: Lang :: Object {INT _VAL; public: ACLASS (INT Number): Object (), _VAL (Number) {}}}}
Raclass ACLASS = New Aclass (42);
Another example of an ACDK class Another ACDK class with header files and source files, respectively:
// aclass.h # include
// Define raclass, aclassarray, and raclassautAACDK_DECL_CLASS (ACLASS);
Class ACLASS: EXTENDS ACDK :: Lang :: Object {private: int _val; // Basic Type RString _Label; // Member Public: Aclass (int Number = 0): Object (), _val (number), _Label (New String ( "")) // initializes an empty string {} virtual RString getLabel () {return _label;} virtual void setLabel (RString newlabel} {_label = newlabel;} virtual int calcLengthOfOldLabel (); static int calcLengthOfString (RString str); }
// aclass.cpp // virtual functions INTACLASS :: CalclengthofoldLabel () {i (_Label == nil) Return_val; return_val = _label-> length ();
// Static Intaclass :: Calclength The {Raclass Aclass = New Aclass (); aclass-> setLabel (STR); Return Aclass-> CalclengthofoldLabel ();
This is an article I am free to translate, introducing the distributed framework acceptk. This is a foreign country, but there is no project in China. I hope everyone can like it because it is very casual, so there is no school translation of the content in the text, so it is inevitable that many shortages, please forgive
Translation: Xue Changyu 2004-12Changning@ynmail.com