Ticket #23 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Description of basic data types

Reported by: michelpons Owned by: jasper
Priority: minor Milestone: Phase II
Component: COBIA SDK Reference Version: 1.0
Keywords: Cc:

Description

In the main page of the COBIA Reference, the section on "Basic data types" begins with "Data that is exchanged via interface methods is packed in a format defined by COBIA's basic data types. The following non-container basic data types are defined:". Then non-container basic data types are listed followed by a list of container data types.

Seems to me that a sentence could be inserted after the first one just to announce that there are both data types which are containers and ones which are not containers.

Also I am not entirely sure of the distinction made here because a container is supposedly so that its "instances are collections of other objects". Is it really the meaning given here?

Change History

comment:1 Changed 4 years ago by jasper

I think this follows immediately from what comes next - seems redundant to me.

Containers data types allocate memory in short. They all indeed contain instances of other objects in the sense that they are all variable length arrays (or in case of the value, it contains a string, which is a variable length array of characters).

The string is not typically considered a container (e.g. STL: http://www.cplusplus.com/reference/stl/) but I would not see why it is not, considering the fact that the string is an array of characters.

comment:2 Changed 4 years ago by jasper

Here's some opinions on whether std::string is a container type:

https://stackoverflow.com/questions/17259595/c-is-a-stdstring-a-container

(short answer: yes)

comment:3 Changed 4 years ago by jasper

  • Status changed from new to closed
  • Resolution set to fixed

In the particular case of COBIA, we could use elementary data types (non-container), I would suggest to keep container types, and describe as distinguishing feature that they are represented by an interface to read from and write to the container.

Changes made in r114:

Data that is exchanged via interface methods is packed in a format defined by COBIA's basic data types. The following elementary data types are defined:

  • COBIA::CapeReal?: representation of a real number. Missing value is represented by COBIA::CapeRealUndefined?, defined as IEEE NaN,
  • COBIA::CapeInteger?: representation of an integer number. Missing value is represented by COBIA::CapeIntegerUNDEFINED,
  • COBIA::CapeEnumeration?: base type of all CAPE-OPEN enumerations,
  • COBIA::CapeCharacter?: character used for string representations. Encoding depends on platform,
  • COBIA::CapeBoolean?: representation of a Boolean value,
  • COBIA::CapeByte?: element of a COBIA::ICapeArrayByte.

Container data types are represented by an interface: both for inbound and outbound data the caller passes an interface to the data to the method. The interface is used to read from and write to the container. The implementer of the interface provides functions that read and (optionally) write data directly into the callers address space. As opposed to most other interfaces in COBIA, life span of data interfaces is not determined by reference counting. The life span is managed by the caller. The callee can only assume that the life span is at least the function call. Container data types include:

  • COBIA::ICapeString: representation of a string value, in platform dependent encoding,
  • COBIA::ICapeValue: can contain an integer, real, Boolean or string value,
  • COBIA::ICapeArrayBoolean: representation of an array of Boolean values,
  • COBIA::ICapeArrayByte: representation of an array of bytes,
  • COBIA::ICapeArrayEnumeration: representation of an array of Enumeration values,
  • COBIA::ICapeArrayInteger: representation of an array of integer values,
  • COBIA::ICapeArrayReal: representation of an array of real values,
  • COBIA::ICapeArrayString: representation of an array of string values,
  • COBIA::ICapeArrayValue: representation of an array of values.
Last edited 4 years ago by jasper (previous) (diff)
Note: See TracTickets for help on using tickets.