Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 31-May-2005 00:36
User is offline View Users Profile Print this message


younghae jung

Posts: 5
Joined: 6-Oct-2003

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 pmyClass;

pStruct.GetValue().op1();

Now Can I use pStruct->op1(); instead of pStruct.GetValue().op1();

Thanks in advance.
Report this to a Moderator Report this to a Moderator
 3-Jun-2005 21:48
User is offline View Users Profile Print this message


Madan Mohan Tito A

Posts: 3
Joined: 16-Mar-2005

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;


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 (childPtr);
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
Report this to a Moderator Report this to a Moderator
 10-Jun-2005 12:25
User is offline View Users Profile Print this message


Jongil Park

Posts: 4
Joined: 10-Jun-2005

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
Report this to a Moderator Report this to a Moderator
 24-Jan-2006 09:17
User is offline View Users Profile Print this message


Mattias Mohlin

Posts: 6
Joined: 24-Jan-2006

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...
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.