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

TOPIC: Decode question

Decode question 21 Jun 2006 11:11 #6931

Hi everyone,
I'm working on a decode, and I need to know the modulename where are = declared
the types defined by the user, and I only have the type name = stored in a
string var but not TciType, hence I can't use the fuction = tciGetDefiningModule
because its argument must be TciType. Could anyone tell me if there is any
other way to achieve this = modulename?

Thanks & Regards
Sergio Lobato
Cetecom, Spain
The administrator has disabled public write access.

Decode question 21 Jun 2006 13:09 #6932

Hi Sergio,

where do you have the type name from? Accordingly to the TCI standard, the
decode operation of the interface TciCDProvided get called with two
parameters, one of them being the type as TciType. From this TCI Type you
will be able to get also the name of the module defining this type.

Best regards,
Valentin Zaharescu

Sergio Lobato López wrote:
> Hi everyone,
> I'm working on a decode, and I need to know the modulename where
> are declared the types defined by the user, and I only have the
> type name stored in a string var but not TciType, hence I can't use
> the fuction tciGetDefiningModule because its argument must be TciType.
> Could anyone tell me if there is any other way to achieve this
> modulename?
>
> Thanks & Regards
> Sergio Lobato
> Cetecom, Spain
>
>

--
Valentin Zaharescu

Testing Technologies IST GmbH
Rosenthaler Str. 13, 10119 Berlin, Germany

phone: +49 30 726 19 19 17
fax : +49 30 726 19 19 20
email: This email address is being protected from spambots. You need JavaScript enabled to view it.
web : www.testingtech.de

The administrator has disabled public write access.

Decode question 22 Jun 2006 06:59 #6933

Hi,
It is useful whenever we work with types defined in the same module, but = let's
suppose that we have a record type defined within a module A, and = one of its
fields is i.e. union type and has been defined in a module B, = and furthermore,
its fields (union) have been defined in other module C. = When tciDecode is
called, we only can retrieve the module name A, but = not the remaining modules.
The type name (string) is obtained from a table defined previously (PERL) which contains every type names. So I need to know the module = where
types are defined to achieve a TciType.
Thans very much,
Warm Regards,
Sergio Lobato

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 Valentin Zaharescu Enviado el:
miércoles, 21 de junio de 2006 15:10
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Decode question

Hi Sergio,

where do you have the type name from? Accordingly to the TCI standard, the
decode operation of the interface TciCDProvided get called with two
parameters, one of them being the type as TciType. From this TCI Type you
will be able to get also the name of the module defining this type.

Best regards,
Valentin Zaharescu

Sergio Lobato López wrote:
> Hi everyone,
> I'm working on a decode, and I need to know the modulename where
> are declared the types defined by the user, and I only have the
> type name stored in a string var but not TciType, hence I can't use
> the fuction tciGetDefiningModule because its argument must be TciType.
> Could anyone tell me if there is any other way to achieve this modulename?
>
> Thanks & Regards
> Sergio Lobato
> Cetecom, Spain
>
>

--
Valentin Zaharescu

Testing Technologies IST GmbH
Rosenthaler Str. 13, 10119 Berlin, Germany

phone: +49 30 726 19 19 17
fax : +49 30 726 19 19 20
email: This email address is being protected from spambots. You need JavaScript enabled to view it.
web : www.testingtech.de

The administrator has disabled public write access.

Decode question 22 Jun 2006 08:26 #6934

Hi Sergio

You may create value instance from the provided type and then step throug= h all
its fields. Smth like:

TciValue val = tciNewInstance(decHypothesis);

if (tciGetTypeClass(decHypothesis) == TCI_RECORD_TYPE) {
String *all_field_names = tciGetRecFieldNames(val);
for (int i = 0; all_field_names && all_field_names; i++)
{
String field_name = all_field_names;
TciValue field_val = tciGetRecFieldValue(val, field_name);
TciType field_type = tciGetType(field_val);
printf ("Type name of field %s is %s.%s\n", field_name,
tciGetDefiningModule(field_type), tciGetName(field_type)));
}
}

Best regards,
/Pavel Yakovenko


Original Message
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, June 22, 2006 9:59 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Decode question

Hi,
It is useful whenever we work with types defined in the same module, but let's
suppose that we have a record type defined within a module A, and o= ne of its
fields is i.e. union type and has been defined in a module B, and furthermore,
its fields (union) have been defined in other module C. When tciDecode is
called, we only can retrieve the module name A, but not the remaining modules.
The type name (string) is obtained from a table defined previously (PERL) which
contains every type names. So I need to know the module where types are defined
to achieve a TciType.
Thans very much,
Warm Regards,
Sergio Lobato

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 Valentin Zaharescu Enviado el:
miércoles, 21 de junio de 2006 15:10
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Decode question

Hi Sergio,

where do you have the type name from? Accordingly to the TCI standard, the
decode operation of the interface TciCDProvided get called with two
parameters, one of them being the type as TciType. From this TCI Type you
will be able to get also the name of the module defining this type.

Best regards,
Valentin Zaharescu

Sergio Lobato López wrote:
> Hi everyone,
> I'm working on a decode, and I need to know the modulename where
> are declared the types defined by the user, and I only have the
> type name stored in a string var but not TciType, hence I can't use
> the fuction tciGetDefiningModule because its argument must be TciType.
> Could anyone tell me if there is any other way to achieve this
> modulename?
>
> Thanks & Regards
> Sergio Lobato
> Cetecom, Spain
>
>

--
Valentin Zaharescu

Testing Technologies IST GmbH
Rosenthaler Str. 13, 10119 Berlin, Germany

phone: +49 30 726 19 19 17
fax : +49 30 726 19 19 20
email: This email address is being protected from spambots. You need JavaScript enabled to view it.
web : www.testingtech.de

The administrator has disabled public write access.

Decode question 22 Jun 2006 11:36 #6935

Hi all,
Thanks very much for your help, it has been really useful, our problem = is
solved. Thanks Best Regards,

Sergio Lobato
Cetecom, Spain.

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 Pavel Yakovenko Enviado el: jueves, 22
de junio de 2006 10:26
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Decode question

Hi Sergio

You may create value instance from the provided type and then step = through all
its fields. Smth like:

TciValue val = tciNewInstance(decHypothesis);

if (tciGetTypeClass(decHypothesis) == TCI_RECORD_TYPE) {
String *all_field_names = tciGetRecFieldNames(val);
for (int i = 0; all_field_names && all_field_names; i++)
{
String field_name = all_field_names;
TciValue field_val = tciGetRecFieldValue(val, field_name);
TciType field_type = tciGetType(field_val);
printf ("Type name of field %s is %s.%s\n", field_name, =
tciGetDefiningModule(field_type), tciGetName(field_type)));
}
}

Best regards,
/Pavel Yakovenko


Original Message
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, June 22, 2006 9:59 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Decode question

Hi,
It is useful whenever we work with types defined in the same module, but = let's
suppose that we have a record type defined within a module A, and = one of its
fields is i.e. union type and has been defined in a module B, = and furthermore,
its fields (union) have been defined in other module C. = When tciDecode is
called, we only can retrieve the module name A, but = not the remaining modules.
The type name (string) is obtained from a table defined previously (PERL) which contains every type names. So I need to know the module = where
types are defined to achieve a TciType.
Thans very much,
Warm Regards,
Sergio Lobato

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 Valentin Zaharescu Enviado el: =
miércoles, 21 de junio de 2006 15:10
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Decode question

Hi Sergio,

where do you have the type name from? Accordingly to the TCI standard, = the
decode operation of the interface TciCDProvided get called with two =
parameters, one of them being the type as TciType. From this TCI Type = you will
be able to get also the name of the module defining this type.

Best regards,
Valentin Zaharescu

Sergio Lobato López wrote:
> Hi everyone,
> I'm working on a decode, and I need to know the modulename where
> are declared the types defined by the user, and I only have the
> type name stored in a string var but not TciType, hence I can't use
> the fuction tciGetDefiningModule because its argument must be TciType.
> Could anyone tell me if there is any other way to achieve this modulename?
>
> Thanks & Regards
> Sergio Lobato
> Cetecom, Spain
>
>

--
Valentin Zaharescu

Testing Technologies IST GmbH
Rosenthaler Str. 13, 10119 Berlin, Germany

phone: +49 30 726 19 19 17
fax : +49 30 726 19 19 20
email: This email address is being protected from spambots. You need JavaScript enabled to view it.
web : www.testingtech.de

The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin