#include <element.h>
Inheritance diagram for ComplexElement:
Public Methods | |
ComplexElement (const char *name, enum ComplexType type, Elements *elements) | |
~ComplexElement () | |
int | AssignPos (int currPos) |
Assign position to this element Return next pos. More... | |
void | Process (ostream &out) |
void | Output (ostream &out, Element *sel) |
Static Public Methods | |
ComplexElement * | Find (const char *name) |
Private Attributes | |
enum ComplexType | type |
std::auto_ptr< Elements > | elements |
Static Private Attributes | |
std::map< std::string, ComplexElement * > | all |
|
Definition at line 72 of file element.h. References all, ComplexType, and Element::name.
|
|
Definition at line 79 of file element.h. References all, and Element::name.
|
|
Assign position to this element Return next pos.
Implements Element. Definition at line 91 of file element.h. References elements, Element::len, Element::position, type, and Union. Referenced by Process().
00092 { 00093 position = currPos; 00094 00095 Elements::TV::iterator i = elements->v.begin(); 00096 Elements::TV::iterator end = elements->v.end(); 00097 int pos = currPos; 00098 int maxPos = currPos; 00099 for(; i!= end;++i) 00100 { 00101 pos = (*i)->AssignPos(pos); 00102 if (type==Union) 00103 { 00104 // union, calc maximun for result and then reset 00105 maxPos = maxPos > pos ? maxPos : pos; 00106 pos = currPos; 00107 } 00108 else 00109 { 00110 maxPos = pos; 00111 } 00112 } 00113 00114 len = maxPos - position; 00115 00116 return maxPos; 00117 } |
|
Definition at line 84 of file element.h. References all, and Element::name. Referenced by createDefinedElement().
|
|
Implements Element. Definition at line 119 of file element.h. References elements, Element::len, Element::name, and Element::position. Referenced by DefinedElement::Output(), and Process().
00120 { 00121 Elements::TV::iterator i = elements->v.begin(); 00122 Elements::TV::iterator end = elements->v.end(); 00123 out << "Complex " << name << " pos:" << position << " len:" << len << " {" << endl; 00124 for(; i!= end;++i) 00125 { 00126 (*i)->Output(out,NULL); 00127 } 00128 out << "};" << endl; 00129 } |
|
Definition at line 131 of file element.h. References AssignPos(), and Output(). Referenced by processElement().
|
|
Definition at line 70 of file element.h. Referenced by ComplexElement(), Find(), and ~ComplexElement(). |
|
|
|
Definition at line 65 of file element.h. Referenced by AssignPos(). |