#include <constraint_type.h>
Inheritance diagram for NLAISCRIPT::CConstraintChkMethodeType:
Nevrax France
Definition at line 39 of file constraint_type.h.
NLMISC::IStreamable method. | |
virtual std::string | getClassName () |
virtual void | serial (NLMISC::IStream &) throw (NLMISC::EStream) |
Public Types | |
enum | ConstraintTypeEnum { constraintMethode, constraintChkMethodeType, operandSimple, operandSimpleListOr, operandAnyObject, operandVoid, operandUnknown, operationType, operationTypeGD, operandListType, constraintStackComp, constraintDebug, constraintFindRun } |
Public Member Functions | |
void | addConstraint (IConstraint *c) |
Add a constraint dependency. We add a constraint dependency when a given constraint want the result of an other constraint. | |
CConstraintChkMethodeType (IConstraint *constraint, int lin, int col) | |
sint32 | decRef () |
Decrement the reference of an object. | |
virtual void | getDebugString (std::string &t) const |
const sint32 & | getRef () const |
get the refence count. | |
void | incRef () |
Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list. | |
void | popConstraint (IConstraint *c) |
pop the last constaint dependency. | |
virtual void | release () |
Release allow to release the pointer. The last release when the _Ref is nul delete the object. | |
void | runConnexcion () |
When a constraint is resoved,we call all dependency. | |
virtual | ~CConstraintChkMethodeType () |
IConstraint method. | |
void | addIndex (int i, CCodeBrancheRun *c) |
const IConstraint * | clone () const |
Get a clone pointer memory. | |
bool | dependOn (const IConstraint *c) const |
If this constraint depond on other constraint. | |
int | getColone () const |
get the colone of the expression that it have to be resolve by constraint in the code source. | |
const NLAIC::CIdentType * | getConstraintTypeOf () |
Type of the expression that it have to be resolve by constraint. | |
void | getError (char *) const |
get an error string when the constraint is'nt stisfied. | |
const char * | getInfo () |
Get a string info. | |
int | getLine () const |
get the line of the expression that it have to be resolve by constraint in the code source. | |
ConstraintTypeEnum | getTypeOfClass () const |
get the type of class. the type must be in the ConstraintTypeEnum enumeration. | |
bool | operator== (const IConstraint &) const |
void | run (IConstraint *) |
Run with a IConstraint dependency. | |
void | run (CCompilateur &) |
Run with a CCompilateur dependency. | |
bool | satisfied () |
If the constraint is resolved. | |
Private Attributes | |
IConstraint * | _Constraint |
Type of unresolving expression. | |
NLAIC::CIdentType * | _Ident |
Type of expression after the constraint is resolve. | |
bool | _RunIsDone |
Attribut need for IConstraint method. | |
int | _Col |
int | _Lin |
bool | _Satisfied |
char * | _TxtInfo |
|
This enum define all IConstraint class type defined. That is'nt very clean because it is'nt very objects way to do jobs but that make easy to make job with out make heavy the hisarchy class. Because the best way is to derive class form NLAIC::IBasicInterface but we have to register class in class factory, define a save an load ..., in short make a lot of work for an internal work. If later peopole need this kind of class we'll clean it.
Definition at line 138 of file constraint.h.
00139 { 00141 constraintMethode, 00143 constraintChkMethodeType, 00145 operandSimple, 00147 operandSimpleListOr, 00149 operandAnyObject, 00151 operandVoid, 00153 operandUnknown, 00155 operationType, 00157 operationTypeGD, 00159 operandListType, 00161 constraintStackComp, 00163 constraintDebug, 00165 constraintFindRun 00166 }; |
|
Definition at line 29 of file constraint_type.cpp. References _RunIsDone, getInfo(), and NLAIC::stringGetBuild(). Referenced by clone().
00029 : 00030 _Constraint(constraint),_Satisfied(false),_Lin(lin),_Col(col) 00031 { 00032 _Ident = NULL; 00033 ((CConstraintMethode *)constraint)->addConstraint(this); 00034 std::string text; 00035 text = NLAIC::stringGetBuild("constraint<CConstraintChkMethodeType> for %s",((IConstraint *)_Constraint)->getInfo()); 00036 _TxtInfo = new char [strlen(text.c_str()) + 1]; 00037 strcpy(_TxtInfo,text.c_str()); 00038 _RunIsDone = false; 00039 } |
|
Definition at line 85 of file constraint_type.cpp. References _RunIsDone, and NLAIC::IPointerGestion::release().
00086 { 00087 if(!_RunIsDone) ((CConstraintMethode *)_Constraint)->popConstraint(this); 00088 _Constraint->release(); 00089 delete _TxtInfo; 00090 } |
|
Add a constraint dependency. We add a constraint dependency when a given constraint want the result of an other constraint.
Definition at line 207 of file constraint.h. References NLAISCRIPT::IConstraint::_ConstraintList. Referenced by NLAISCRIPT::COperandUnknown::COperandUnknown().
00208 { 00209 _ConstraintList.push_back(c); 00210 } |
|
Add a op-code dependency. the integer n is the index of the opcode in in the opcodePtr pointer. Implements NLAISCRIPT::IConstraint. Definition at line 76 of file constraint_type.cpp.
00077 { 00078 } |
|
Get a clone pointer memory.
Implements NLAISCRIPT::IConstraint. Definition at line 41 of file constraint_type.cpp. References CConstraintChkMethodeType(), and x.
00042 { 00043 IConstraint *x = new CConstraintChkMethodeType(_Constraint,_Lin,_Col); 00044 return x; 00045 } |
|
Decrement the reference of an object.
Definition at line 93 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIC::IPointerGestion::release(), and NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00094 {
00095 return --_Ref;
00096 }
|
|
If this constraint depond on other constraint.
Implements NLAISCRIPT::IConstraint. Definition at line 83 of file constraint_type.h. References NLAISCRIPT::IConstraint::dependOn().
00084 { 00085 return c == _Constraint || _Constraint->dependOn(c); 00086 } |
|
Implements NLMISC::IClassable. Reimplemented in NLAIC::CIdentType. Definition at line 116 of file abstract_interface.h. Referenced by NLAISCRIPT::CAgentClass::isClassInheritedFrom().
00117 { 00118 return std::string("<unnamed>"); 00119 } |
|
get the colone of the expression that it have to be resolve by constraint in the code source.
Implements NLAISCRIPT::IConstraint. Definition at line 78 of file constraint_type.h.
00079 { 00080 return _Col; 00081 } |
|
Type of the expression that it have to be resolve by constraint.
Implements NLAISCRIPT::IConstraint. Definition at line 92 of file constraint_type.h.
00093 { 00094 return _Ident; 00095 } |
|
|
get an error string when the constraint is'nt stisfied.
Implements NLAISCRIPT::IConstraint. Definition at line 80 of file constraint_type.cpp.
00081 { 00082 strcpy(txt,_TxtInfo); 00083 } |
|
Get a string info.
Implements NLAISCRIPT::IConstraint. Definition at line 65 of file constraint_type.h. Referenced by CConstraintChkMethodeType().
00066 { 00067 return _TxtInfo; 00068 } |
|
get the line of the expression that it have to be resolve by constraint in the code source.
Implements NLAISCRIPT::IConstraint. Definition at line 74 of file constraint_type.h.
00075 { 00076 return _Lin; 00077 } |
|
get the refence count.
Definition at line 99 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00100 {
00101 return _Ref;
00102 }
|
|
get the type of class. the type must be in the ConstraintTypeEnum enumeration.
Implements NLAISCRIPT::IConstraint. Definition at line 99 of file constraint_type.h. Referenced by operator==().
00100 { 00101 return constraintChkMethodeType; 00102 } |
|
|
Implements NLAISCRIPT::IConstraint. Definition at line 67 of file constraint_type.cpp. References NLAISCRIPT::IConstraint::getTypeOfClass(), and getTypeOfClass().
00068 { 00069 if(getTypeOfClass() == c.getTypeOfClass() && *((const CConstraintChkMethodeType &)c)._Constraint == *_Constraint) 00070 { 00071 return true; 00072 } 00073 return false; 00074 } |
|
pop the last constaint dependency.
Definition at line 32 of file constraint.cpp. References NLAISCRIPT::IConstraint::_ConstraintList. Referenced by NLAISCRIPT::COperandUnknown::~COperandUnknown().
00033 { 00034 std::list<IConstraint *>::iterator it = _ConstraintList.begin(); 00035 while(it != _ConstraintList.end()) 00036 { 00037 if(*it == c) 00038 { 00039 _ConstraintList.erase(it); 00040 break; 00041 } 00042 it ++ ; 00043 } 00044 } |
|
|
Run with a IConstraint dependency.
Implements NLAISCRIPT::IConstraint. Definition at line 57 of file constraint_type.cpp. References _RunIsDone.
00058 { 00059 if(c == _Constraint) 00060 { 00061 //_Constraint = NULL; 00062 _RunIsDone = true; 00063 _Ident = (NLAIC::CIdentType *)((CConstraintMethode *)c)->getConstraintTypeOf(); 00064 } 00065 } |
|
Run with a CCompilateur dependency.
Implements NLAISCRIPT::IConstraint. Definition at line 47 of file constraint_type.cpp. References NLAISCRIPT::IConstraint::run(), and NLAISCRIPT::IConstraint::runConnexcion().
00048 { 00049 if(_Ident == NULL) 00050 { 00051 _Constraint->run(c); 00052 _Ident = (NLAIC::CIdentType *)((CConstraintMethode *)_Constraint)->getConstraintTypeOf(); 00053 } 00054 runConnexcion(); 00055 } |
|
When a constraint is resoved,we call all dependency.
Definition at line 214 of file constraint.h. References NLAISCRIPT::IConstraint::_ConstraintList, and NLAISCRIPT::IConstraint::run(). Referenced by run(), NLAISCRIPT::CConstraintFindRun::setOpCode(), and NLAISCRIPT::CConstraintMethode::setOpCode().
00215 { 00216 while(_ConstraintList.size()) 00217 { 00218 IConstraint *a = _ConstraintList.back(); 00219 _ConstraintList.pop_back(); 00220 a->run(this); 00221 } 00222 } |
|
If the constraint is resolved.
Implements NLAISCRIPT::IConstraint. Definition at line 60 of file constraint_type.h.
00061 { 00062 return _Satisfied; 00063 } |
|
Implements NLMISC::IStreamable. Reimplemented in NLAIC::CIdentType, NLAIC::IBasicInterface, NLAISCRIPT::COperandVoid, NLAISCRIPT::COperandAnyObject, NLAISCRIPT::COperandSimple, NLAISCRIPT::COperandSimpleListOr, NLAISCRIPT::COperandUnknown, NLAISCRIPT::COperationType, NLAISCRIPT::COperationTypeGD, and NLAISCRIPT::COperandListType. Definition at line 120 of file abstract_interface.h. Referenced by NLAISCRIPT::CFindRunMsg::save().
00121 { 00122 } |
|
Definition at line 50 of file constraint_type.h. |
|
Type of unresolving expression.
Definition at line 45 of file constraint_type.h. |
|
Type of expression after the constraint is resolve.
Definition at line 43 of file constraint_type.h. |
|
Definition at line 49 of file constraint_type.h. |
|
Definition at line 53 of file constraint_type.h. Referenced by CConstraintChkMethodeType(), run(), and ~CConstraintChkMethodeType(). |
|
Definition at line 48 of file constraint_type.h. |
|
Definition at line 51 of file constraint_type.h. |