whosrdaddy
Vendor
I have the following class in C(++, I think)
the part I have problems with, is the "operator" part.
It seems that per operator type (like ==, +=, <, >, and so on) you can include a method function.
How would I do this in Delphi?
like in this case the "operator=" would be something like Assign in Delphi? or is this the name of the method?
Can someone clarify this for me? I Don't have the time to read a book about C++ and I need to know fast!
TIA!
//Daddy
-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
Code:
#DisableSH
[navy][i]// for automatic syntax highlighting see faq102-6487
[/i][/navy][b]class[/b] PASN_Integer : [b]public[/b] PASN_ConstrainedObject
[navy][i]{
PCLASSINFO(PASN_Integer, PASN_ConstrainedObject);
public:
PASN_Integer(unsigned val = 0);
PASN_Integer(unsigned tag, TagClass tagClass, unsigned val = 0);
PASN_Integer & operator=(unsigned value);
operator unsigned() const { return value; }[/i][/navy]
unsigned GetValue() [b]const[/b] [navy][i]{ return value; }[/i][/navy]
void SetValue(unsigned v) [navy][i]{ operator=(v); }[/i][/navy]
[b]virtual[/b] Comparison Compare([b]const[/b] PObject & obj) [b]const[/b];
[b]virtual[/b] PObject * Clone() [b]const[/b];
[b]virtual[/b] void PrintOn(ostream & strm) [b]const[/b];
[b]virtual[/b] void SetConstraintBounds(ConstraintType [b]type[/b], int lower, unsigned upper);
[b]virtual[/b] PString GetTypeAsString() [b]const[/b];
[b]virtual[/b] PINDEX GetDataLength() [b]const[/b];
[b]virtual[/b] BOOL Decode(PASN_Stream &);
[b]virtual[/b] void Encode(PASN_Stream &) [b]const[/b];
[teal]#[/teal]ifdef P_INCLUDE_PER
BOOL DecodePER(PPER_Stream & strm);
void EncodePER(PPER_Stream & strm) [b]const[/b];
[teal]#[/teal]endif
...
the part I have problems with, is the "operator" part.
It seems that per operator type (like ==, +=, <, >, and so on) you can include a method function.
How would I do this in Delphi?
like in this case the "operator=" would be something like Assign in Delphi? or is this the name of the method?
Can someone clarify this for me? I Don't have the time to read a book about C++ and I need to know fast!
TIA!
//Daddy
-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!