![]() |
The Simons
|
By convention, all type names in the SCL are capitalised. The SCL defines five value-types: Boolean, Character, Natural, Integer and Decimal. These correspond to the C++ value-types bool, char, unsigned, int and double. In addition, the SCL defines a special enumerated type: Order, which stands for the result of a comparison. Finally, the empty type Void is also capitalised. This file also defines the default memory model (32-bit architecture is assumed, but this can be changed) and the unique null object reference.
Go to the source code of this file.
Defines | |
#define | MEMORY_MODEL 32 |
The underlying memory model architecture. | |
Typedefs | |
typedef bool | Boolean |
Boolean is the logical type. | |
typedef char | Character |
Character is the signed character type. | |
typedef unsigned int | Natural |
Natural is the unsigned natural number type. | |
typedef int | Integer |
Integer is the signed integer number type. | |
typedef double | Decimal |
Decimal is the double precision floating point number type. | |
typedef void | Void |
Void is the empty type. | |
Enumerations | |
enum | Order { NONE = -2, LESS = -1, EQUAL = 0, MORE = 1, SOME = 2 } |
Order is the symbolic comparison type. More... | |
Variables | |
const Null *const | null |
The unique null reference. |
|
The underlying memory model architecture. By default, the memory model is assumed to be a 32-bit architecture. The value of this macro should be reset if the software is compiled on a 64-bit architecture. However, if the GNU C++ compiler is used, this will automatically detect whether the target architecture is 32-bit or 64-bit and no further action is required. Otherwise, the value of this macro should be edited and set to 64 for compilation on a 64-bit architecture. The memory model affects how the identity of an Object is computed, which affects serialisation and deserialisation. |
|
Boolean is the logical type. Boolean corresponds to the simple C++ type bool. This usually occupies one byte. The constants false and true are the only members of this type, which also sometimes appear as 0 and 1. Boolean variables are initialised using values of the primitive bool type, eg: true. Boolean values are amenable to assignment, copying and the standard Boolean operators ! (logical not), && (logical and) and || (logical or). |
|
Character is the signed character type. Character corresponds to the simple C++ type char. This usually occupies one byte of storage. This type may encode characters in the range {0..255} where the first half of these are defined by the ASCII standard. The remainder from {128..255} are in the extended ASCII range, which is not standard across all platforms. Character variables are initialised using literals of the primitive char type, eg: 'c'. Character values are amenable to assignment, copying and standard Character functions. |
|
Decimal is the double precision floating point number type. Decimal corresponds to the simple C++ type double. This usually occupies eight bytes of storage. The 64 bits are partitioned to represent the sign, the exponent (power of ten) and the mantissa (significant digits) of the number. Arithmetic is usually precise to sixteen significant figures. Decimal variables are initialised with literals of the double precision floating point primitive type, eg: 42.0, but initialisation using int or unsigned values will be converted to double precision first. Decimal values are amenable to assignment, copying and standard arithmetical operators + (plus), - (minus, negate), * (times) and / (divide). |
|
Integer is the signed integer number type. Integer corresponds to the simple C++ type int. This usually occupies four bytes of storage, using the high-order bit to represent the sign of the number. The highest Integer number is a power of two smaller than the highest Natural number. Integer numbers are used for indexing and iterating through things. Arithmetic is modulo the largest positive and negative Integer values, wrapping when these are exceeded. Integer values are initialised with literals of the primitive signed int type, eg: 42. Integer values are amenable to assignment, copying and standard arithmetical operators + (plus), - (minus, negate), * (times), / (divide), % (modulo) and mutating operators ++ (increment), -- (decrement). |
|
Natural is the unsigned natural number type. Natural corresponds to the simple C++ type unsigned. This usually occupies four bytes of storage, using the high-order bit to represent part of the number. The highest Natural number is a power of two larger than the highest Integer number. Natural numbers are used for counting and measuring the size of things. Arithmetic is modulo the largest Natural number, wrapping round when this, or zero, is exceeded. Natural values are initialised with literals of the primitive unsigned type, eg: 42U, since initialisation with primitive signed values may wrap. Natural values are amenable to assignment, copying and standard arithmetical operators + (plus), - (minus), * (times), / (divide), % (modulo) and mutating operators ++ (increment), -- (decrement). |
|
Void is the empty type. Void corresponds to the simple C++ type void. It is the trivial type of procedures that return no result, and usually occupies no storage. It is provided in the SCL simply to observe the convention that all type names must be capitalised. |
|
Order is the symbolic comparison type. Order is a symbolic type, standing for the result of a comparison between two Objects. Order consists of the set of constants {NONE, LESS, EQUAL, MORE, SOME}, where NONE means incomparable and disjoint, LESS means less than, EQUAL means equal to, MORE means greater than and SOME means incomparable and overlapping. Totally ordered comparisons always yield results in {LESS, EQUAL, MORE}. Partially ordered comparisons may also yield NONE for disjoint values and SOME for intersecting values. |
|
The unique null reference. All empty ObjectID variables are initialised to null, the vacuous object. This is so that reference-counting may be more efficient, avoiding zero-pointer checks. The unique null instance is provided as a global variable. |