# 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  

test_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 #ifndef NL_TEST_METHOD_H
00026 #define NL_TEST_METHOD_H
00027 
00028 namespace NLAISCRIPT
00029 {
00039         class CLibTest: public NLAIAGENT::IObjectIA
00040         {
00041         public:
00043                 enum  TMethodNumDef {
00044                         //TIsAgent, ///Test if an expression is an agent;
00045                         TIsNULL, 
00046                         TRand1,
00047                         TRand2,
00048                         TDiscretRand,
00049                         TConst,
00050 /*                      TIdle,
00051                         TWalk,
00052                         TYes,
00053                         TNo,
00054                         TWave,
00055                         TBow, */
00056                         TLastM 
00057                 };
00058 
00059                 enum TTypeCheck{
00060                         CheckAll,
00061                         CheckCount,
00062                         DoNotCheck
00063                 };
00064 
00066                 struct CMethodCall
00067                 {
00068                         CMethodCall(const char *name, int i,NLAIAGENT::IObjectIA *a,TTypeCheck checkArg,int argCount, NLAIAGENT::IObjectIA *r): 
00069                                         MethodName (name),ArgType(a),ReturnValue(r)
00070                         {
00071                                 Index = i;
00072                                 CheckArgType = checkArg;
00073                                 ArgCount = argCount;
00074                         }
00075 
00076                         ~CMethodCall()
00077                         {
00078                                 if(ReturnValue != NULL) ReturnValue->release();
00079                                 if(ArgType != NULL) ArgType->release();
00080                         }
00082                         NLAIAGENT::CStringVarName MethodName;
00084                         NLAIAGENT::IObjectIA *ArgType;
00086                         NLAIAGENT::IObjectIA *ReturnValue;
00088                         TTypeCheck CheckArgType;                        
00090                         sint ArgCount;
00092                         sint32 Index;                           
00093                 };
00095                 static CMethodCall **StaticMethod;//[];
00096 
00097         public:
00098                 static const NLAIC::CIdentType IdLibTest;
00099 
00100         public:
00101                 CLibTest();             
00102 
00104 
00105                 virtual sint32 isClassInheritedFrom(const NLAIAGENT::IVarName &) const;
00106                 
00107                 virtual sint32 getMethodIndexSize() const
00108                 {
00109                         return 0;
00110                 }
00111 
00112                 double rand(double,double) const;
00113                 sint dRand(sint, sint) const;
00114                 virtual NLAIAGENT::tQueue isMember(const NLAIAGENT::IVarName *className,const NLAIAGENT::IVarName *mathodName,const NLAIAGENT::IObjectIA &) const;              
00115                 virtual NLAIAGENT::IObjectIA::CProcessResult runMethodeMember(sint32 heritance, sint32 index, NLAIAGENT::IObjectIA *);
00116                 virtual NLAIAGENT::IObjectIA::CProcessResult runMethodeMember(sint32 index,NLAIAGENT::IObjectIA *);
00117 
00118                 const NLAIAGENT::IObjectIA::CProcessResult &run(){return NLAIAGENT::IObjectIA::ProcessRun;}
00119                 bool isEqual(const NLAIAGENT::IBasicObjectIA &a) const{ return true;}   
00121 
00123 
00124                 const NLAIC::IBasicType *clone() const
00125                 {
00126                         NLAIC::IBasicType *x = new CLibTest();
00127                         return x;            
00128                 }
00129 
00130                 const NLAIC::IBasicType *newInstance() const 
00131                 {
00132                         return clone();
00133                 }
00134 
00135                 const NLAIC::CIdentType &getType() const
00136                 {
00137                         return IdLibTest;
00138                 }
00139 
00140                 virtual void getDebugString(std::string &t) const
00141                 {
00142                         t = "lib for serveral testing state";
00143                 }
00144 
00145                 void save(NLMISC::IStream &os)
00146                 {
00147                         
00148                 }
00149 
00150                 void load(NLMISC::IStream &is) 
00151                 {                               
00152                 }
00154 
00155         public:
00156                 static void initClass();
00157                 static void releaseClass();
00158         };
00159 }
00160 #endif