![]() |
Telelogic TAU (steve huntington) | ![]() |
Topic Title: How to use Pointer Operatior "->" in TAU G2 2.4? Topic Summary: TAU, G2, Pointer Created On: 31-May-2005 00:36 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Dear members.
Now I'm modeling software stack using TAU G2 Ver 2.4. I want to use pointer operator "->", but I cannot use it? How can I use it? I think that TAU already provided the functionality, becasue TTDCppPredefined Package has the ->(Any,Any) operation. but I can't use "->". so, Instead of using "->", now I used the pointer as the following. MyClass myClass; CPtr pStruct.GetValue().op1(); Now Can I use pStruct->op1(); instead of pStruct.GetValue().op1(); Thanks in advance. |
|
![]() |
|
![]() |
|
Hi Younghae Jung,
You can not use the "->" operator. The GetValue serves the purpose of '->' operator . And one more advantage is as follows. Class Child{ public Operation1(); public Operation2(); } CPtr<child> childPtr = new child(); //To call the Operaions there are two diffrent ways //Method 1 childPtr.GetValue().Operation1(); childPtr.GetValue().Operation2(); //Method 2 child c; c = cast c.Operation1(); c.Operation2(); In the above apporch we can minimize the usage of GetValue. Hope this helps With Best Regards Madan Edited: 3-Jun-2005 at 21:51 by Madan Mohan Tito A |
|
![]() |
|
![]() |
|
Thank you for your advice.
You said to me that "-" operator is not available on TAU. but, TTDCppPredefined Package has the ->(Any,Any) operation. I want to know how to use the operator "->(Any, Any)" in TTDCppPredefined Package.?????? Edited: 10-Jun-2005 at 12:26 by Jongil Park |
|
![]() |
|
![]() |
|
The C++ Application Generator automatically determines which member access operator
to use depending on the C++ type of the operand. So if the operand is of value type the '.' operator is used, and if the operand is of pointer type the '->' operator is used. In UML you always use the '.' syntax. The reason why the CppPredefined package contains a UML representation of '->' is to have a representation to use while transforming the UML model to a "C++ model" (which then is printed to C++ files). Strictly speaking the operation is thus for internal use only, and should really have been hidden... |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.