Declarative Objectivity (DO) Language : Attribute Structures : Basic Data Attributes
Basic Data Attributes
Basic data attributes are attributes that can hold Boolean, character, or numeric values.
      
Basic Values
Logical Type
Settings
Options1
Quick Look
Boolean values
(8-bit)
Boolean
available: Boolean
Character values
(8-bit, 16-bit, or 32-bit)
Character
Storage:
B8
B16
B32
state: Character {
  Storage: B16
}
 
Integer values 2
(signed or unsigned; 8-bit, 16-bit, 32-bit, or 64-bit)
Integer
 
Encoding:
Signed
Unsigned
doors: Integer {
  Encoding: Signed,
  Storage: B8
}
 
Storage
B8
B16
B32
B64
Real or floating-point values
(32-bit or 64-bit)
Real
Storage
B32
B64
rateFactor: Real {
  Storage: B32
}
GUID values
(128-bit)
Guid
reservationId: Guid
1. You can omit settings for default options, which are indicated in boldface.
2. Ranges of integer values are shown in Value Ranges of Integer Types below.
Discussion 
For general syntax information, see About Attribute Structures.
For examples of literal Boolean, character, and numeric values, see Literal Expressions.
Specifying the Attribute Type
A basic data attribute has one of the following logical types:
Logical Type
Description
Boolean
8-bit values that are either true or false
Character
Characters within a string
Integer
Signed or unsigned whole numbers
Real
Real (floating-point) numbers with a fractional part. Conforms to IEEE Standard 754 floating-point representation.
Guid
128-bit Globally Unique Identifiers (GUIDs) or Universally Unique Identifiers (UUIDs)
Specifying Type Characteristics
A basic data attribute uses the following settings to specify detailed type characteristics:
Setting
Specifies
Options
Encoding:
The representation used for Integer values
Signed
Represents positive and negative integers.
Unsigned
Represents only non-negative integers.
Storage:
The amount of space reserved for values of the logical type in persistent storage.
Bn
n bits.
Value Ranges of Integer Types
The following table shows the ranges of values that can an integer attribute of a particular encoding and storage can hold:
 
Integer Encoding
Integer Storage
Lowest Value
Highest Value
Description
Signed
B8
-128
+127
8-bit signed integer type
B16
-32,768
+32,767
16-bit signed integer type
B32
-2,147,483,648
+2,147,483,647
32-bit signed integer type
B64
-(263)
+263-1
64-bit signed integer type
Unsigned
B8
0
+255
8-bit unsigned integer type
B16
0
+65,535
16-bit unsigned integer type
B32
0
+4,294,967,295
32-bit unsigned integer type
B64
0
+264-1
64-bit unsigned integer type