Files Classes Functions Hierarchy
#include <visoperator.h>
Public Member Functions | |
| stringc | id () const |
| id | |
| void | handlecommand (bool &matches, viscmd &c) |
| Commands that have been added to the dictionary are linearly processed. | |
Static Public Member Functions | |
| static void | add (visoperator*x) |
| Assume added operator allocated with new. | |
| static void | process (vector< viscmd > &v) |
| Iterate through the vector processing commands. | |
| static void | build01 () |
| Build a dictionary. | |
Static Public Attributes | |
| static vector< visoperator* > | dictionary |
| Command list. | |
visoperator is designed to do most of the work.
Definition at line 46 of file visoperator.h.
| void visdictionary::add | ( | visoperator* | x | ) | [static] |
Assume added operator allocated with new.
Definition at line 27 of file visoperator.cpp.
References dictionary.
Referenced by vistest::test03().
00028 { 00029 assert(x!=0); 00030 dictionary.push_back(x); 00031 }
| void visdictionary::build01 | ( | ) | [static] |
Build a dictionary.
Definition at line 86 of file visoperator.cpp.
Referenced by vistest::test02().
00087 { 00088 add(new vispointxml); 00089 add(new vispoint2); 00090 add(new vispoint3); 00091 add(new visline); 00092 add(new visconvex); 00093 00094 }
Commands that have been added to the dictionary are linearly processed.
Implements visoperator.
Definition at line 49 of file visoperator.cpp.
00050 { 00051 matches=false; 00052 for (uint i=0; i<dictionary.size(); ++i) 00053 { 00054 if (dictionary[i]==0) 00055 continue; 00056 00057 dictionary[i]->handlecommand(matches,c); 00058 if (matches) 00059 return; 00060 } 00061 }
| stringc visdictionary::id | ( | ) | const [inline, virtual] |
| void visdictionary::process | ( | vector< viscmd > & | v | ) | [static] |
Iterate through the vector processing commands.
Definition at line 63 of file visoperator.cpp.
References dictionary.
Referenced by vistest::test02(), and vistest::test03().
00064 { 00065 bool res; 00066 00067 for (uint i=0; i<v.size(); ++i) 00068 { 00069 00070 if (v[i].enabled==false) 00071 continue; 00072 00073 res=false; 00074 for (uint k=0; k<dictionary.size(); ++k) 00075 { 00076 if (dictionary[k]==0) 00077 continue; 00078 00079 dictionary[k]->handlecommand(res,v[i]); 00080 if (res) 00081 k=dictionary.size()+1; 00082 } 00083 } 00084 }
vector< visoperator* > visdictionary::dictionary [static] |
1.5.8