# 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  

ai_assert.cpp

Go to the documentation of this file.
00001 /* Copyright, 2000 Nevrax Ltd.
00002  *
00003  * This file is part of NEVRAX <MODULE_NAME>.
00004  * NEVRAX <MODULE_NAME> is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2, or (at your option)
00007  * any later version.
00008 
00009  * NEVRAX <MODULE_NAME> is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012  * General Public License for more details.
00013 
00014  * You should have received a copy of the GNU General Public License
00015  * along with NEVRAX <MODULE_NAME>; see the file COPYING. If not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00017  * MA 02111-1307, USA.
00018  */
00019 
00020 #include "nel/ai/logic/ai_assert.h"
00021 #include "nel/ai/logic/varset.h"
00022 #include "nel/ai/logic/clause.h"
00023 #include "nel/ai/logic/valueset.h"
00024 #include "nel/ai/agent/agent_digital.h"
00025 #include "nel/ai/logic/operator.h"
00026 #include "nel/ai/logic/fo_operator.h"
00027 #include "nel/ai/logic/fact.h"
00028 
00029 namespace NLAILOGIC
00030 {
00031         using namespace NLAIAGENT;
00032         
00033         
00034         IBaseAssert::IBaseAssert(const IVarName &n )
00035         {
00036                 _Name = (IVarName *) n.clone();
00037         }
00038 
00039         IBaseAssert::~IBaseAssert()
00040         {
00041                 if      ( _Name )
00042                         _Name->release();
00043 
00044                 sint32 i;
00045                 for (i = 0; i < (sint32) _Inputs.size(); i++ )
00046                         _Inputs[i]->release();  
00047 
00048                 for (i = 0; i < (sint32) _Outputs.size(); i++ )
00049                         _Outputs[i]->release();
00050         }
00051 
00052         void IBaseAssert::addInput(IBaseOperator *op)
00053         {
00054                 _Inputs.push_back( op );
00055                 op->incRef();
00056         }
00057 
00058         const std::vector<IBaseOperator *> &IBaseAssert::getInputs()
00059         {
00060                 return _Inputs;
00061         }
00062 
00063         void IBaseAssert::addOutput(IBaseOperator *op)
00064         {
00065                 _Outputs.push_back( op );
00066         }
00067 
00068         const std::vector<IBaseOperator *> &IBaseAssert::getOutputs()
00069         {
00070                 return _Outputs;
00071         }
00072 }