Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Component Name

Component Name 15 Mar 2007 10:41 #7057

Hi all,

Let's suppose a component defined as:



type component MyCompType {

port PortTypeOne PCO1;

port PortTypeTwo PCO2

}



var MyCompType MyCompInst := MyCompType.create;



Then, how can I achieve the component name created in the SA?, that means, in the SA I need to know "MyCompInst".



Thank you in advance,

Best Regards,

Sergio Lobato
The administrator has disabled public write access.

Component Name 15 Mar 2007 11:24 #7058

Hi



If tool you are using conforms to edition 3.1.1 then you have compName field
in the TriComponentId object.

But "MyCompInst" is the name of a variable holding component reference, not
the component name.

You need to write something like:

var MyCompType MyCompInst := MyCompType.create("MyCompInst");

otherwise compName will have some tool-dependent name.



Best regards,

Pavel



_____

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
[This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio Lobato Lopez
Sent: Thursday, March 15, 2007 1:42 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Component Name



Hi all,

Let's suppose a component defined as:



type component MyCompType {

port PortTypeOne PCO1;

port PortTypeTwo PCO2

}



var MyCompType MyCompInst := MyCompType.create;



Then, how can I achieve the component name created in the SA?, that means,
in the SA I need to know "MyCompInst".



Thank you in advance,

Best Regards,

Sergio Lobato
The administrator has disabled public write access.

Component Name 15 Mar 2007 11:38 #7059

Hi Sergio,

good news. If you are using an edition 3 capable environment you could
use something like:

*var *MyCompType MyCompInst := MyCompType.*create*("MyCompInst");

This is defined in 21.2.1 of TTCN-3.

Here are the relevant statements:
"Optionally, a name can be associated with the newly created component
instance. The test system shall associate the names 'MTC' to the MTC and
'SYSTEM' to the test system interface automatically at creation.
Associated component names are not required to be unique.

NOTE: The component instance name is used for logging purposes (see
clause 19.11) only and shall not be used to refer to the component
instance (the component reference shall be used for this purpose) and
has no effect on matching.
"

Of course you can use any other charstring expression as argument.

While the standard notes, that this information is used for logging
purposes you can assume that this information is also present in the
TriComponentId as component name.

If no component name is provided then the componentid will be used
instead, I assume ;-)

Best regards,
Theo


Sergio Lobato López schrieb:
> Hi all,
>
> Let’s suppose a component defined as:
>
>
>
> *type component *MyCompType {
>
> *port *PortTypeOne PCO1;
>
> *port *PortTypeTwo PCO2
>
> }
>
>
>
> *var *MyCompType MyCompInst := MyCompType.*create*;
>
>
>
> Then, how can I achieve the component name created in the SA?, that
> means, in the SA I need to know “MyCompInst”.
>
>
>
> Thank you in advance,
>
> Best Regards,
>
> Sergio Lobato
>
>
>
The administrator has disabled public write access.

Component Name 15 Mar 2007 13:21 #7061

Ooops, Theo, but no way I can assume that this information is present in the TriComponentId as component name, at least as the sole definition of component instance reference. At least it shall be prefixed with some unique component identification to make sense. The reason is that nowhere in the standard it is mentioned to my memory that human-readable component name assigned by a test suite writer in the 'create' statement has to be unique, while uniqueness is definitely a property of a sensible component reference implementation. In fact, the standard does not require uniqueness of a human-readable component name explicitly (clause 22.1 of Ed. 3). Please correct me if I miss something. Or possibly you meant that you do this kind of prefixing already or that there is some kind of extension out there.

Best regards,
Alexey

Theofanis Vassiliou-Gioles <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote:While the standard notes, that this information is used for logging
purposes you can assume that this information is also present in the
TriComponentId as component name.

If no component name is provided then the componentid will be used
instead, I assume ;-)
The administrator has disabled public write access.

Component Name 15 Mar 2007 13:56 #7062

Dear Alexey,

you are right with respect to the ComponentId. At least that was what I
meant ;-) But I was more referring to the *component name*.

But lets take a look at the TRI standard. It says:
> 5.3.1 [...]
> TriComponentIdType A value of type TriComponentIdType includes an identifier,
a name and the component
> type. The distinct value of the latter is the component type name as specified
in the
> TTCN-3 ATS. This abstract type is mainly used to resolve TRI communication
> operations on TSI ports that have mappings to many test component ports.

Then I have taken a look on the language mapping. (I must admit, I first
looked into the java mapping which says:

> 6.3.2.3 TriComponentIdType
> public interface TriComponentId {
> public String getComponentId();
> public String getComponentName();
> public String getComponentTypeName();
> public TriPortIdList getPortList();
> public boolean equals(TriComponentId port);
> }

> 6.3.2.3.1 Methods
> - getComponentId()
> Returns a representation of this unique component identifier.
> - getComponentName()
> Returns the component name as defined in the TTCN-3 specification. If no name
is provided, an empty
> string is returned.

The C mapping says:
> TriComponentId typedef struct TriComponentId
> {
> BinaryString compInst;
> String compName;
> QualifiedName compType;
> } TriComponentId;

which in fact contains the same information.

So, if you are using
compType.create("CompName");

I would assume that this information is included in the compName element
of the TriComponentId. The uniqueness will be guaranteed by the whole
struct (in C) or the object in java.

Best regards,
Theo


Alexey Mednonogov schrieb:
> Ooops, Theo, but no way I can assume that this information is present in
> the TriComponentId as component name, at least as the sole definition of
> component instance reference. At least it shall be prefixed with some
> unique component identification to make sense. The reason is that
> nowhere in the standard it is mentioned to my memory that human-readable
> component name assigned by a test suite writer in the 'create' statement
> has to be unique, while uniqueness is definitely a property of a
> sensible component reference implementation. In fact, the standard does
> not require uniqueness of a human-readable component name explicitly
> (clause 22.1 of Ed. 3). Please correct me if I miss something. Or
> possibly you meant that you do this kind of prefixing already or that
> there is some kind of extension out there.
>
> Best regards,
> Alexey
>
> */Theofanis Vassiliou-Gioles <This email address is being protected from spambots. You need JavaScript enabled to view it.>/* wrote:
>
> While the standard notes, that this information is used for logging
> purposes you can assume that this information is also present in the
> TriComponentId as component name.
>
> If no component name is provided then the componentid will be used
> instead, I assume ;-)
>
>
>
>
The administrator has disabled public write access.

Component Name 15 Mar 2007 14:34 #7063

Hi Alexey,
With TriComponentId you can achieve the component type, and a field to handle the component instance, but never the name.
So it is really difficult to distinct any component using those fields, specially when components used are defined using the same component type. :)

Anyway, thanks Pavel, Theo & Alexey for your contribution.
Best Regards
Sergio

Mensaje original
De: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Theofanis Vassiliou-Gioles
Enviado el: jueves, 15 de marzo de 2007 14:57
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Component Name

Dear Alexey,

you are right with respect to the ComponentId. At least that was what I
meant ;-) But I was more referring to the *component name*.

But lets take a look at the TRI standard. It says:
> 5.3.1 [...]
> TriComponentIdType A value of type TriComponentIdType includes an identifier, a name and the component
> type. The distinct value of the latter is the component type name as specified in the
> TTCN-3 ATS. This abstract type is mainly used to resolve TRI communication
> operations on TSI ports that have mappings to many test component ports.

Then I have taken a look on the language mapping. (I must admit, I first
looked into the java mapping which says:

> 6.3.2.3 TriComponentIdType
> public interface TriComponentId {
> public String getComponentId();
> public String getComponentName();
> public String getComponentTypeName();
> public TriPortIdList getPortList();
> public boolean equals(TriComponentId port);
> }

> 6.3.2.3.1 Methods
> - getComponentId()
> Returns a representation of this unique component identifier.
> - getComponentName()
> Returns the component name as defined in the TTCN-3 specification. If no name is provided, an empty
> string is returned.

The C mapping says:
> TriComponentId typedef struct TriComponentId
> {
> BinaryString compInst;
> String compName;
> QualifiedName compType;
> } TriComponentId;

which in fact contains the same information.

So, if you are using
compType.create("CompName");

I would assume that this information is included in the compName element
of the TriComponentId. The uniqueness will be guaranteed by the whole
struct (in C) or the object in java.

Best regards,
Theo


Alexey Mednonogov schrieb:
> Ooops, Theo, but no way I can assume that this information is present in
> the TriComponentId as component name, at least as the sole definition of
> component instance reference. At least it shall be prefixed with some
> unique component identification to make sense. The reason is that
> nowhere in the standard it is mentioned to my memory that human-readable
> component name assigned by a test suite writer in the 'create' statement
> has to be unique, while uniqueness is definitely a property of a
> sensible component reference implementation. In fact, the standard does
> not require uniqueness of a human-readable component name explicitly
> (clause 22.1 of Ed. 3). Please correct me if I miss something. Or
> possibly you meant that you do this kind of prefixing already or that
> there is some kind of extension out there.
>
> Best regards,
> Alexey
>
> */Theofanis Vassiliou-Gioles <This email address is being protected from spambots. You need JavaScript enabled to view it.>/* wrote:
>
> While the standard notes, that this information is used for logging
> purposes you can assume that this information is also present in the
> TriComponentId as component name.
>
> If no component name is provided then the componentid will be used
> instead, I assume ;-)
>
>
>
>
The administrator has disabled public write access.

Component Name 15 Mar 2007 15:50 #7064

Hi Theo,

Ok, now I see what you mean, compName field. Yes, this has changed since Ed. 2. Thanks for pointing this out.

Best regards,
Alexey

Theofanis Vassiliou-Gioles <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote: Dear Alexey,

you are right with respect to the ComponentId. At least that was what I
meant ;-) But I was more referring to the *component name*.

But lets take a look at the TRI standard. It says:
> 5.3.1 [...]
> TriComponentIdType A value of type TriComponentIdType includes an identifier, a name and the component
> type. The distinct value of the latter is the component type name as specified in the
> TTCN-3 ATS. This abstract type is mainly used to resolve TRI communication
> operations on TSI ports that have mappings to many test component ports.

Then I have taken a look on the language mapping. (I must admit, I first
looked into the java mapping which says:

> 6.3.2.3 TriComponentIdType
> public interface TriComponentId {
> public String getComponentId();
> public String getComponentName();
> public String getComponentTypeName();
> public TriPortIdList getPortList();
> public boolean equals(TriComponentId port);
> }

> 6.3.2.3.1 Methods
> - getComponentId()
> Returns a representation of this unique component identifier.
> - getComponentName()
> Returns the component name as defined in the TTCN-3 specification. If no name is provided, an empty
> string is returned.

The C mapping says:
> TriComponentId typedef struct TriComponentId
> {
> BinaryString compInst;
> String compName;
> QualifiedName compType;
> } TriComponentId;

which in fact contains the same information.

So, if you are using
compType.create("CompName");

I would assume that this information is included in the compName element
of the TriComponentId. The uniqueness will be guaranteed by the whole
struct (in C) or the object in java.

Best regards,
Theo


Alexey Mednonogov schrieb:
> Ooops, Theo, but no way I can assume that this information is present in
> the TriComponentId as component name, at least as the sole definition of
> component instance reference. At least it shall be prefixed with some
> unique component identification to make sense. The reason is that
> nowhere in the standard it is mentioned to my memory that human-readable
> component name assigned by a test suite writer in the 'create' statement
> has to be unique, while uniqueness is definitely a property of a
> sensible component reference implementation. In fact, the standard does
> not require uniqueness of a human-readable component name explicitly
> (clause 22.1 of Ed. 3). Please correct me if I miss something. Or
> possibly you meant that you do this kind of prefixing already or that
> there is some kind of extension out there.
>
> Best regards,
> Alexey
>
> */Theofanis Vassiliou-Gioles /* wrote:
>
> While the standard notes, that this information is used for logging
> purposes you can assume that this information is also present in the
> TriComponentId as component name.
>
> If no component name is provided then the componentid will be used
> instead, I assume ;-)
>
>
>
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin