Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

func.h File Reference

Go to the source code of this file.

Enumerations

enum  ByteOrder { LittleEndian, BigEndian }
enum  ComplexType { Union, Struct }

Functions

ElementscreateElements (Element *element)
ElementsaddElement (Elements *elements, Element *element)
ElementcreateElement (enum ComplexType type, Elements *elements, char *name)
ElementcreateDefinedElement (char *type, char *name, char *number)
ElementcreateSimpleElement (int type, char *name, char *number)
void setByteOrder (enum ByteOrder bo)
void processElement (enum ComplexType type, char *name, Elements *elements)


Enumeration Type Documentation

enum ByteOrder
 

Enumeration values:
LittleEndian 
BigEndian 

Definition at line 7 of file func.h.

Referenced by setByteOrder().

00007 { LittleEndian, BigEndian };

enum ComplexType
 

Enumeration values:
Union 
Struct 

Definition at line 8 of file func.h.

Referenced by ComplexElement::ComplexElement(), createElement(), and processElement().

00008 { Union, Struct };


Function Documentation

Elements* addElement Elements   elements,
Element   element
 

Definition at line 26 of file func.cpp.

References Elements::Add().

00027 {
00028         elements->Add(element);
00029         return elements;
00030 }

Element* createDefinedElement char *    type,
char *    name,
char *    number
 

Definition at line 55 of file func.cpp.

References ComplexElement::Find(), and readNum().

00056 {
00057         int n = readNum(number);
00058         
00059         // find complex element
00060         ComplexElement *ce = ComplexElement::Find(type);
00061         free(type);
00062         
00063         // !!! give some error
00064         if (!ce)
00065                 throw std::runtime_error("");
00066 
00067         return new DefinedElement(name, ce, n);
00068 }

Element* createElement enum ComplexType    type,
Elements   elements,
char *    name
 

Definition at line 33 of file func.cpp.

References ComplexType.

00034 {
00035         Element *e = new ComplexElement(name,type,elements);
00036         free(name);
00037         return e;
00038 }

Elements* createElements Element   element
 

Definition at line 18 of file func.cpp.

References Elements::Add().

00019 {
00020         Elements* e = new Elements();
00021         e->Add(element);
00022         return e;
00023 }

Element* createSimpleElement int    type,
char *    name,
char *    number
 

Definition at line 73 of file func.cpp.

References readNum().

00074 {
00075         int n = readNum(number);
00076         
00077         Element* res;
00078         if (type==0)
00079                 res = new PaddingElement(name,n==0?1:n);
00080         else
00081                 res = new SimpleElement(name,type<0,type<0?-type:type,n);
00082         free(name);
00083         return res;
00084 }

void processElement enum ComplexType    type,
char *    name,
Elements   elements
 

Definition at line 87 of file func.cpp.

References ComplexType, and ComplexElement::Process().

00088 {
00089         ComplexElement *ce = new ComplexElement(name,type,elements);
00090         free(name);
00091         
00092         ce->Process(cout);
00093 }

void setByteOrder enum ByteOrder    bo
 

Definition at line 9 of file func.cpp.

References byteOrder, and ByteOrder.

00010 {
00011         byteOrder = bo;
00012 }


Generated on Mon Jan 13 22:20:35 2003 for perdr by doxygen1.2.15