ETSI's Bug Tracker - Part 05: TTCN-3 Runtime Interface
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0006257 | Part 05: TTCN-3 Runtime Interface | Technical | public | 10-08-2012 12:06 | 10-08-2012 12:08

Reporter | Ina Schieferdecker |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | block | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.5.1 (published 2013-04) | Fixed in Version | v4.5.1 (published 2013-04) |
Clause Reference(s) | TRI 8.5.2, TCI 10.5.2
Source (company - Author) | Mateusz Pusz/freettcn

Summary | 0006257: TRI & TCI identifiers in C++ interface mapping wrongly defined

Description

Some TRI and TCI interfaces C++ mappings inherit privately from TRI::QualifiedName. That makes impossible to call any of its interface methods. To make it straight lets assume that TM just received TciTestCaseIdList from TciTmRequired::tciGetTestCases() and wants to present the names to the user. How is it supposed to do it if it does not have the access to private interface of TciTestCaseId class (because public interface of QualifiedName ends as private one in privately inherited child class)? I think that aggregation:
class TciTestCaseId {
.....
const QualifiedName &id() const;
.....
};
or public inheritance if really needed:
class TciTestCaseId : public QualifiedName {
.....
};
should be used here to achieve the goal. Another issue here is the existence of non-virtual cloneQualifiedName() method which makes it not only unusable (no-one have access to it) but also unimplementable as you cannot create the same object from that level in inheritance hierarchy (object slicing).
Even with above problem solved the class does not have any virtual method which makes it really hard to implement its methods as the class does not have any internal members. Because of that the developer is forced to do some external database with contents of those classes (like a map of QualifiedName pointers pointing to its content) and use it with every access to the class interface. It is why I think all methods in that class should be done pure virtual.
I suggest:
1. Making all methods in QualifiedName virtual and pure virtual (see https://github.com/mpusz/FreeTTCN/blob/d2ff73bbb9f4bb5e49b5cabe2c156512e456056c/freettcn/lib/include/freettcn/etsi/types.h#L60 [^])
2. Make IDs inherit (TTCN_ID_IFACE_FIXED_1) or aggregate (TTCN_ID_IFACE_FIXED_2) QualifiedName (see https://github.com/mpusz/FreeTTCN/blob/d2ff73bbb9f4bb5e49b5cabe2c156512e456056c/freettcn/lib/include/freettcn/etsi/tci.h [^] and https://github.com/mpusz/FreeTTCN/blob/d2ff73bbb9f4bb5e49b5cabe2c156512e456056c/freettcn/lib/include/freettcn/etsi/tri.h [^])
I personaly think that aggregation is better here and will make the interface more consistent with other classes like TriComponentId (https://github.com/mpusz/FreeTTCN/blob/d2ff73bbb9f4bb5e49b5cabe2c156512e456056c/freettcn/lib/include/freettcn/etsi/tri.h#L66 [^]). However both solutions will make the interface implementable,
Best
Mat

Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

child of | 0005946 | closed | Ina Schieferdecker | Part 06: TTCN-3 Control Interface | TRI & TCI identifiers in C++ interface mapping wrongly defined

Attached Files |

Issue History
Date Modified | Username | Field | Change
10-08-2012 12:06 | Ina Schieferdecker | New Issue |
10-08-2012 12:06 | Ina Schieferdecker | Status | new => assigned
10-08-2012 12:06 | Ina Schieferdecker | Assigned To | => Ina Schieferdecker
10-08-2012 12:06 | Ina Schieferdecker | Clause Reference(s) | => TRI 8.5.2, TCI 10.5.2
10-08-2012 12:06 | Ina Schieferdecker | Source (company - Author) | => Mateusz Pusz/freettcn
10-08-2012 12:06 | Ina Schieferdecker | Issue generated from: 0005946 |
10-08-2012 12:06 | Ina Schieferdecker | Relationship added | child of 0005946
10-08-2012 12:07 | Ina Schieferdecker | Project | Part 06: TTCN-3 Control Interface => Part 05: TTCN-3 Runtime Interface
10-08-2012 12:08 | Ina Schieferdecker | Note Added: 0011028 |
10-08-2012 12:08 | Ina Schieferdecker | Status | assigned => closed
10-08-2012 12:08 | Ina Schieferdecker | Resolution | open => fixed
10-08-2012 12:08 | Ina Schieferdecker | Fixed in Version | => Edition 4.5.1
10-08-2012 12:08 | Ina Schieferdecker | Target Version | => Edition 4.5.1

Notes

(0011028)
Ina Schieferdecker
10-08-2012 12:08

Implemented as proposed.