4 Data Types

This chapter describes the data types used FlowDesigner  and HARK . Users need to be aware of HARK  data types for the following two cases.

Data types used for setting node properties

The data types that can be currently set as a property of a node are the following five types.

Type

Meaning

Data type level

int 

Integral type

Primitive type

float 

Single-precision floating point type

Primitive type

string 

String type

Primitive type

bool 

Logical type

Primitive type

Object 

Object type

FlowDesigner -specific type

subnet_param 

Subnet parameter type

FlowDesigner -specific type

Since HARK  uses the basic C++ data types for int , float , string  and bool , their specifications conform to C++. Data types particular to FlowDesigner  are Object  and subnet_param . Object  is the generic name for data types in FlowDesigner . In HARK , Vector  or Matrix  are types of Object s that can be set as properties. As described later, since all types except for primitive types are Object s, any class whose values are able to be specified using text-type input can be used as a property. Even a primitive type can be designated as an Object  by wrapping it in an Object (e.g. $<$Int $>$, for example). subnet_param  is a special data type that is used for sharing one parameter with a label between multiple nodes.

Data types used for connections between nodes

Connection of nodes (inter-node communication) is achieved by connecting lines between the terminals of two nodes (indicated as a black point on the left and right of a node) in the GUI of FlowDesigner . Data types used in such cases are as follows.

Type

Meaning

Data type level

any 

Any type

FlowDesigner -specific type

int 

integral type

Primitive type

float 

Single-precision floating point real type

Primitive type

double 

Double-precision floating point real type

Primitive type

complex<float> 

single-precision floating point complex type

Primitive type

complex<double> 

Double-precision floating point complex type

primitive type

char 

Character type

Primitive type

 

String type

Primitive type

bool 

Logical type

Primitive type

Vector 

Array type

FlowDesigner object type

Matrix 

Matrix type

FlowDesigner object type

Int 

Integral type

FlowDesigner object type

Float 

Single-precision floating point real type

FlowDesigner object type

String 

String type

FlowDesigner object type

Complex 

Complex type

FlowDesigner object type

TrueObject 

Logical type (true)

FlowDesigner object type

FalseObject 

Logical type (false)

FlowDesigner object type

nilObject 

object type (nil)

FlowDesigner object type

ObjectRef 

Object reference type

FlowDesigner -specific type

Map 

Map type

HARK -specific type

Source 

Sound source information type

HARK -specific type

The any  data type is a discrete data type containing various data types and is defined specifically in FlowDesigner . Since the C++ primitive data types are used for int , float , double , complex<float> , complex<double> , char , string , bool , their specifications conform to C++. When a user attempts to use a primitive type as an Object , it is converted into GenericType<T>  automatically and can be treated as a class with the first letter in upper case, as a subclass of Object , such as Int  and Float . String  and Complex , however, are not GenericType and they are defined as stdstring and stdcomplex, respectively. Likewise, they are used when string  and complex are used as an Object  type. In this way, a data type defined as a subclass of Object  of FlowDesigner  are called "FlowDesigner  object type". TrueObject , FalseObject  and nilObject  are also defined as Object s that correspond to true, false and nil, respectively.

The types used most often as FlowDesigner  objects are Vector  and Matrix . These are FlowDesigner  object types that basically conform to the same data types in the C++ STL. ObjectRef  is a FlowDesigner -specific data type that is realized as a smart pointer for object types and is often used as elements of Vector , Matrix  and Map . Map  also conforms to the C++ STL and is a HARK -specific data type, not FlowDesigner . Source  is a HARK -specific data type, defined as a sound source information type.

The node’s terminal type

is displayed at the bottom of the screen in FlowDesigner  by focusing the cursor on a terminal of the node for which the user wishes to know the type. Figure 4.1 shows an example of focusing on an AUDIO terminal of a AudioStreamFromMic  node. The message "AUDIO (Matrix<float>  Windowed wave form). The row indices specify the channel, and the column indices are time" is displayed at the bottom of FlowDesigner , describing that the AUDIO port supports Matrix<float> , Windowed wave forms are output, and that the matrix rows indicate channel and the columns indicates time.

\includegraphics[width=120mm]{fig/types/MessageBar}
Figure 4.1: Display example of message bar

Terminals can be successfully connected when the data types of the terminals are the same. This is shown by black arrows when attempting to connect them. When a user connects terminals without meeting this condition, the connection is displayed with red arrows as a warning. The following section describes details of the above for each of the primitive type, FlowDesigner  object type, FlowDesigner -specific type and HARK -specific type.