# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

opcode_call_lib_method.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_OP_CODE_CALL_LIB_METHOD_H
00027 #define NL_OP_CODE_CALL_LIB_METHOD_H
00028 
00029 namespace NLAISCRIPT
00030 {
00032 
00033 
00035         class CLibMemberMethod: public IOpRunCode
00036         {               
00037         public:
00038                 static const NLAIC::CIdentType IdLibMemberMethod;
00039         private:                
00040                 sint32 _Id;             
00041         public:                 
00042                 CLibMemberMethod(sint32 id):_Id(id)
00043                 {                       
00044                 }
00045 
00046                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00047                 
00048                 void getDebugResult(std::string &str,CCodeContext &context) const;              
00049 
00050                 const NLAIC::IBasicType *clone() const
00051                 {
00052                         NLAIC::IBasicType *x = new CLibMemberMethod(_Id);
00053                         return x;
00054                 }
00055                 const NLAIC::IBasicType *newInstance() const
00056                 {
00057                         return clone();
00058                 }
00059                 const NLAIC::CIdentType &getType() const
00060                 {
00061                         return IdLibMemberMethod;
00062                 }
00063 
00064                 
00065 
00066                 void save(NLMISC::IStream &os)
00067                 {               
00068                         sint32 n = (sint32) _Id;
00069                         os.serial(n);
00070                 }
00071 
00072                 void load(NLMISC::IStream &is) 
00073                 {                       
00074                         sint32 n;
00075                         is.serial(n);
00076                         _Id = n;
00077                 }
00078                 
00079                         
00080                 virtual ~CLibMemberMethod()
00081                 {                       
00082                 }
00083 
00084         };
00085 
00087         class CLibMemberInheritedMethod: public IOpRunCode
00088         {
00089         public:
00090                 static const NLAIC::CIdentType IdLibMemberInheritedMethod;
00091         private:                
00092                 sint32 _Inheritance;
00093                 sint32 _Id;             
00094         public:                 
00095                 CLibMemberInheritedMethod(sint32 inheritance,sint32 id):_Inheritance(inheritance),_Id(id)
00096                 {                       
00097                 }
00098 
00099                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);          
00100                 
00101                 void getDebugResult(std::string &str,CCodeContext &context) const;
00102 
00103                 const NLAIC::IBasicType *clone() const
00104                 {
00105                         NLAIC::IBasicType *x = new CLibMemberInheritedMethod(_Inheritance,_Id);
00106                         return x;
00107                 }
00108                 const NLAIC::IBasicType *newInstance() const
00109                 {
00110                         return clone();
00111                 }
00112                 const NLAIC::CIdentType &getType() const
00113                 {
00114                         return IdLibMemberInheritedMethod;
00115                 }               
00116 
00117                 void save(NLMISC::IStream &os)
00118                 {
00119                         sint32 n = (sint32) _Id;
00120                         os.serial(n);
00121                         n = (sint32) _Inheritance;
00122                         os.serial(n);
00123                 }
00124 
00125                 void load(NLMISC::IStream &is) 
00126                 {                               
00127                         sint32 n;
00128                         is.serial(n);
00129                         _Id = n;
00130                         is.serial(n);
00131                         _Inheritance = n;
00132                 }               
00133 
00134                 virtual ~CLibMemberInheritedMethod()
00135                 {                       
00136                 }
00137 
00138         };
00139 
00143         class CLibMemberMethodi: public IOpRunCode
00144         {
00145         public:
00146                 static const NLAIC::CIdentType IdLibMemberMethodi;
00147         private:                
00148                 sint32 _Inheritance;
00149                 sint32 _Id;
00150                 std::list<sint32> _I;           
00151         public:                 
00152                 CLibMemberMethodi(sint32 inheritance,sint32 id,std::list<sint32> i): _Inheritance(inheritance),_Id(id),_I(i)
00153                 {                       
00154                 }
00155 
00156                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);          
00157                 
00158                 void getDebugResult(std::string &str,CCodeContext &context) const;
00159 
00160                 const NLAIC::IBasicType *clone() const
00161                 {
00162                         NLAIC::IBasicType *x = new CLibMemberMethodi(_Inheritance,_Id,_I);
00163                         return x;
00164                 }
00165                 const NLAIC::IBasicType *newInstance() const
00166                 {
00167                         return clone();
00168                 }
00169                 const NLAIC::CIdentType &getType() const
00170                 {
00171                         return IdLibMemberMethodi;
00172                 }               
00173 
00174                 void save(NLMISC::IStream &os)
00175                 {               
00176                         sint32 n = (sint32) _Id;
00177                         os.serial(n);
00178                         n = (sint32) _Inheritance;
00179                         os.serial(n);
00180                         std::list<sint32> &i = (std::list<sint32> &)_I;
00181                         os.serialCont(i);
00182                 }
00183 
00184                 void load(NLMISC::IStream &is) 
00185                 {                               
00186                         sint32 n;
00187                         is.serial(n);
00188                         _Id = n;
00189                         is.serial(n);
00190                         _Inheritance = n;
00191                         is.serialCont(_I);
00192                 }               
00193 
00194                 virtual ~CLibMemberMethodi()
00195                 {                       
00196                 }
00197 
00198         };
00199 
00201         class CLibCallMethod: public IOpRunCode
00202         {               
00203         public:
00204                 static const NLAIC::CIdentType IdLibCallMethod;
00205         private:                
00206                 sint32 _Id;
00207                 NLAIAGENT::IObjectIA *_Lib;
00208         public:                 
00209                 CLibCallMethod(sint32 id,const NLAIAGENT::IObjectIA &lib):_Id(id),_Lib((NLAIAGENT::IObjectIA*)lib.clone())
00210                 {                       
00211                 }
00212 
00213                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00214                 
00215                 void getDebugResult(std::string &str,CCodeContext &context) const;
00216                 
00217                 const NLAIC::IBasicType *clone() const
00218                 {
00219                         NLAIC::IBasicType *x = new CLibCallMethod(_Id,*_Lib);
00220                         return x;
00221                 }
00222                 const NLAIC::IBasicType *newInstance() const
00223                 {
00224                         return clone();
00225                 }
00226                 const NLAIC::CIdentType &getType() const
00227                 {
00228                         return IdLibCallMethod;
00229                 }
00230 
00231                 
00232 
00233                 void save(NLMISC::IStream &os)
00234                 {
00235                         sint32 n = (sint32) _Id;
00236                         os.serial(n);
00237                         os.serial( (NLAIC::CIdentType &) _Lib->getType() );
00238                         _Lib->save(os);
00239                 }
00240 
00241                 void load(NLMISC::IStream &is) 
00242                 {
00243                         sint32 n;
00244                         is.serial(n);
00245                         _Id = n;
00246                         _Lib->release();
00247                         NLAIC::CIdentTypeAlloc id;
00248                         is.serial( id );
00249                         _Lib = (NLAIAGENT::IObjectIA *)id.allocClass();
00250                         _Lib->load(is);
00251                 }
00252                 
00253                         
00254                 virtual ~CLibCallMethod()
00255                 {
00256                         _Lib->release();
00257                 }
00258 
00259         };      
00260 
00262         class CLibCallInheritedMethod: public IOpRunCode
00263         {
00264         public:
00265                 static const NLAIC::CIdentType IdLibCallInheritedMethod;
00266         private:                
00267                 sint32 _Inheritance;
00268                 sint32 _Id;
00269                 NLAIAGENT::IObjectIA *_Lib;
00270         public:                 
00271                 CLibCallInheritedMethod(sint32 inheritance,sint32 id,const NLAIAGENT::IObjectIA &lib):_Inheritance(inheritance),_Id(id),_Lib((NLAIAGENT::IObjectIA*)lib.clone())
00272                 {                       
00273                 }
00274 
00275                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);          
00276                 
00277                 void getDebugResult(std::string &str,CCodeContext &context) const;
00278 
00279                 const NLAIC::IBasicType *clone() const
00280                 {
00281                         NLAIC::IBasicType *x = new CLibCallInheritedMethod(_Inheritance,_Id,*_Lib);
00282                         return x;
00283                 }
00284                 const NLAIC::IBasicType *newInstance() const
00285                 {
00286                         return clone();
00287                 }
00288                 const NLAIC::CIdentType &getType() const
00289                 {
00290                         return IdLibCallInheritedMethod;
00291                 }               
00292 
00293                 void save(NLMISC::IStream &os)
00294                 {               
00295                         sint32 n = (sint32) _Id;
00296                         os.serial(n);
00297                         n = (sint32) _Inheritance;
00298                         os.serial(n);
00299                         os.serial( (NLAIC::CIdentType &) _Lib->getType() );
00300                         _Lib->save(os);
00301                 }
00302 
00303                 void load(NLMISC::IStream &is) 
00304                 {                               
00305                         sint32 n;
00306                         is.serial(n);
00307                         _Id = n;
00308                         is.serial(n);
00309                         _Inheritance = n;
00310 
00311                         _Lib->release();
00312                         NLAIC::CIdentTypeAlloc id;
00313                         is.serial( id );
00314                         _Lib =  (NLAIAGENT::IObjectIA *)id.allocClass();
00315                         _Lib->load(is);
00316 
00317                 }               
00318 
00319                 virtual ~CLibCallInheritedMethod()
00320                 {
00321                         _Lib->release();
00322                 }
00323 
00324         };      
00325         class CLibCallMethodi: public IOpRunCode
00326         {
00327         public:
00328                 static const NLAIC::CIdentType IdLibCallMethodi;
00329         private:                
00330                 sint32 _Inheritance;
00331                 sint32 _Id;
00332                 std::list<sint32> _I;
00333                 NLAIAGENT::IObjectIA *_Lib;
00334         public:                 
00335                 CLibCallMethodi(sint32 inheritance,sint32 id,std::list<sint32> i,const NLAIAGENT::IObjectIA &lib):
00336                                                 _Inheritance(inheritance),_Id(id),_I(i),_Lib((NLAIAGENT::IObjectIA*)lib.clone())
00337                 {                       
00338                 }
00339 
00340                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);          
00341                 
00342                 void getDebugResult(std::string &str,CCodeContext &context) const;              
00343 
00344                 const NLAIC::IBasicType *clone() const
00345                 {
00346                         NLAIC::IBasicType *x = new CLibCallMethodi(_Inheritance,_Id,_I,*_Lib);
00347                         return x;
00348                 }
00349                 const NLAIC::IBasicType *newInstance() const
00350                 {
00351                         return clone();
00352                 }
00353                 const NLAIC::CIdentType &getType() const
00354                 {
00355                         return IdLibCallMethodi;
00356                 }               
00357 
00358                 void save(NLMISC::IStream &os)
00359                 {
00360                         sint32 n = (sint32) _Id;
00361                         os.serial(n);
00362                         n = (sint32) _Inheritance;
00363                         os.serial(n);
00364                         os.serial( (NLAIC::CIdentType &) _Lib->getType() );
00365                         _Lib->save(os);
00366                         std::list<sint32> &i = (std::list<sint32> &)_I;
00367                         os.serialCont(i);
00368                 }
00369 
00370                 void load(NLMISC::IStream &is) 
00371                 {                               
00372                         sint32 n;
00373                         is.serial(n);
00374                         _Id = n;
00375                         is.serial(n);
00376                         _Inheritance = n;
00377 
00378                         _Lib->release();
00379                         NLAIC::CIdentTypeAlloc id;
00380                         is.serial( id );
00381                         _Lib =  (NLAIAGENT::IObjectIA *)id.allocClass();
00382                         _Lib->load(is);
00383                         is.serialCont ( _I );
00384                 }               
00385 
00386                 virtual ~CLibCallMethodi()
00387                 {
00388                         _Lib->release();
00389                 }
00390 
00391         };
00392 
00393         class CLibStackMemberMethod: public IOpRunCode
00394         {               
00395         public:
00396                 static const NLAIC::CIdentType IdLibStackMemberMethod;
00397         protected:              
00398                 sint32 _Id;
00399                 sint32 _H;
00400                 std::list<sint32> _I;
00401         public:
00402                 CLibStackMemberMethod(const CLibStackMemberMethod &a):_Id(a._Id),_H(a._H),_I(a._I)
00403                 {
00404                 }
00405                 CLibStackMemberMethod(sint32 h,sint32 id,std::list<sint32> i):_Id(id),_H(h),_I(i)
00406                 {                       
00407                 }
00408 
00409                 virtual NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00410                 
00411                 virtual void getDebugResult(std::string &str,CCodeContext &context) const;              
00412 
00413                 const NLAIC::IBasicType *clone() const
00414                 {
00415                         NLAIC::IBasicType *x = new CLibStackMemberMethod(_Id,_H,_I);
00416                         return x;
00417                 }
00418                 const NLAIC::IBasicType *newInstance() const
00419                 {
00420                         return clone();
00421                 }
00422                 const NLAIC::CIdentType &getType() const
00423                 {
00424                         return IdLibStackMemberMethod;
00425                 }
00426 
00427                 
00428 
00429                 void save(NLMISC::IStream &os)
00430                 {
00431                         sint32 n = (sint32) _Id;
00432                         os.serial(n);
00433                         n = (sint32) _H;
00434                         os.serial(n);                   
00435                         std::list<sint32> &i = (std::list<sint32> &)_I;
00436                         os.serialCont(i);
00437                 }
00438 
00439                 void load(NLMISC::IStream &is) 
00440                 {
00441                         sint32 n;
00442                         is.serial(n);
00443                         _Id = n;
00444                         is.serial(n);
00445                         _H = n;                                         
00446                         is.serialCont ( _I );
00447                 }
00448                 
00449                         
00450                 virtual ~CLibStackMemberMethod()
00451                 {                       
00452                 }
00453 
00454         };      
00455 
00456         class CLibStackNewMemberMethod: public CLibStackMemberMethod
00457         {               
00458         public:
00459                 static const NLAIC::CIdentType IdLibStackNewMemberMethod;
00460         public:
00461                 CLibStackNewMemberMethod(const CLibStackNewMemberMethod &a):CLibStackMemberMethod(a)
00462                 {
00463 
00464                 }
00465 
00466                 CLibStackNewMemberMethod(sint32 h,sint32 id,std::list<sint32> i):CLibStackMemberMethod(h,id,i)
00467                 {
00468                         
00469                 }
00470 
00471                 virtual void getDebugResult(std::string &str,CCodeContext &context) const;
00472                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00473 
00474                 const NLAIC::IBasicType *clone() const
00475                 {
00476                         NLAIC::IBasicType *x = new CLibStackNewMemberMethod(*this);
00477                         return x;
00478                 }
00479                 const NLAIC::IBasicType *newInstance() const
00480                 {
00481                         return clone();
00482                 }
00483 
00484                 const NLAIC::CIdentType &getType() const
00485                 {
00486                         return IdLibStackNewMemberMethod;
00487                 }
00488 
00489                 virtual ~CLibStackNewMemberMethod()
00490                 {                       
00491                 }
00492         };
00493 
00494 
00495         class CLibHeapMemberMethod: public CLibStackMemberMethod
00496         {               
00497         public:
00498                 static const NLAIC::CIdentType IdLibHeapMemberMethod;
00499         private:
00500                 sint32 _Index;
00501         public: 
00502                 CLibHeapMemberMethod(const CLibHeapMemberMethod &a):CLibStackMemberMethod(a),_Index(a._Index)
00503                 {
00504                 }
00505 
00506                 CLibHeapMemberMethod(sint32 h,sint32 id,std::list<sint32> i, sint32 index):CLibStackMemberMethod(h,id,i) , _Index(index)
00507                 {                       
00508                 }
00509 
00510                 NLAIAGENT::TProcessStatement runOpCode(CCodeContext &context);
00511                 
00512                 void getDebugResult(std::string &str,CCodeContext &context) const;
00513 
00514                 const NLAIC::IBasicType *clone() const
00515                 {
00516                         NLAIC::IBasicType *x = new CLibHeapMemberMethod(*this);
00517                         return x;
00518                 }
00519                 const NLAIC::IBasicType *newInstance() const
00520                 {
00521                         return clone();
00522                 }
00523                 const NLAIC::CIdentType &getType() const
00524                 {
00525                         return IdLibHeapMemberMethod;
00526                 }
00527 
00528                 
00529 
00530                 void save(NLMISC::IStream &os)
00531                 {
00532                         sint32 n = (sint32) _Index;
00533                         os.serial(n);
00534                         CLibStackMemberMethod::save(os);
00535                 }
00536 
00537                 void load(NLMISC::IStream &is) 
00538                 {                               
00539                         sint32 n;
00540                         is.serial(n);
00541                         _Index = n;
00542                         CLibStackMemberMethod::load(is);
00543                 }
00544                 
00545                         
00546                 virtual ~CLibHeapMemberMethod()
00547                 {                       
00548                 }
00549 
00550         };
00552 }
00553 #endif