Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
types.h File Reference

Fixed-size integer types and the sizes, signature types and mnemonics of Bond types. More...

#include "bond/conf.h"
#include "bond/private/types.h"

Namespaces

namespace  Bond

Macros

#define BOND_SIGNATURE_TYPE_LIST
 An X-macro that lists the signature types used to describe the parameters and return values of functions in CBO files.
#define BOND_SIGNATURE_TYPE_ITEM(type, bondType, apiType)
#define BOND_NATIVE_GETTER_SUFFIX   "@get"
 Suffix appended to the qualified name of a native struct member to form the name of the native function that reads its value.
#define BOND_NATIVE_SETTER_SUFFIX   "@set"
 Suffix appended to the qualified name of a native struct member to form the name of the native function that writes its value.

Enumerations

enum  Bond::PointerSize { Bond::POINTER_32BIT , Bond::POINTER_64BIT }
 The size of pointers on a target platform. More...
enum  Bond::SignatureType {
  Bond::SIG_VOID , Bond::SIG_BOOL , Bond::SIG_CHAR , Bond::SIG_UCHAR ,
  Bond::SIG_SHORT , Bond::SIG_USHORT , Bond::SIG_INT , Bond::SIG_UINT ,
  Bond::SIG_LONG , Bond::SIG_ULONG , Bond::SIG_FLOAT , Bond::SIG_DOUBLE ,
  Bond::SIG_POINTER , Bond::SIG_AGGREGATE
}
 Enumeration of the types of function parameters and return values in CBO files. More...

Functions

uint32_t Bond::GetPointerSize (PointerSize pointerSize)
 Returns the number of bytes in a pointer of the given size.
BOND_API const char * Bond::GetBondTypeMnemonic (SignatureType signatureType)
 Returns the mnemonic of the given signature type as it is named in Bond, e.g. "int".
BOND_API char * Bond::ExpandBondTypeMnemonic (char *buffer, size_t length, SignatureType signatureType, uint32_t size)
 Writes the mnemonic of the given signature type as it is named in Bond to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".
BOND_API const char * Bond::GetApiTypeMnemonic (SignatureType signatureType)
 Returns the mnemonic of the given signature type as it is named in the C++ API, e.g. "int32_t".
BOND_API char * Bond::ExpandApiTypeMnemonic (char *buffer, size_t length, SignatureType signatureType, uint32_t size)
 Writes the mnemonic of the given signature type as it is named in the C++ API to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".

Variables

const uint32_t Bond::BOND_VOID_SIZE = 0
 Size in bytes of the Bond void type.
const uint32_t Bond::BOND_BOOL_SIZE = 1
 Size in bytes of the Bond bool type.
const uint32_t Bond::BOND_CHAR_SIZE = 1
 Size in bytes of the Bond char type.
const uint32_t Bond::BOND_UCHAR_SIZE = 1
 Size in bytes of the Bond uchar type.
const uint32_t Bond::BOND_SHORT_SIZE = 2
 Size in bytes of the Bond short type.
const uint32_t Bond::BOND_USHORT_SIZE = 2
 Size in bytes of the Bond ushort type.
const uint32_t Bond::BOND_INT_SIZE = 4
 Size in bytes of the Bond int type.
const uint32_t Bond::BOND_UINT_SIZE = 4
 Size in bytes of the Bond uint type.
const uint32_t Bond::BOND_LONG_SIZE = 8
 Size in bytes of the Bond long type.
const uint32_t Bond::BOND_ULONG_SIZE = 8
 Size in bytes of the Bond ulong type.
const uint32_t Bond::BOND_FLOAT_SIZE = 4
 Size in bytes of the Bond float type.
const uint32_t Bond::BOND_DOUBLE_SIZE = 8
 Size in bytes of the Bond double type.
const uint32_t Bond::BOND_DEFAULT_STRUCT_SIZE = 4
 Minimum size in bytes of a struct whose layout is computed by the compiler.
const uint32_t Bond::BOND_DEFAULT_STRUCT_ALIGN = BOND_DEFAULT_STRUCT_SIZE
 Minimum alignment in bytes of a struct whose layout is computed by the compiler.
const int32_t Bond::BOND_SLOT_SIZE = 8
 Size in bytes of a slot on the operand stack of the VM.
const PointerSize Bond::BOND_NATIVE_POINTER_SIZE = (sizeof(void *) == 8) ? POINTER_64BIT : POINTER_32BIT
 The size of pointers on the platform for which the code is compiled.

Detailed Description

Fixed-size integer types and the sizes, signature types and mnemonics of Bond types.

The fixed-size integer types are obtained from <cstdint> by default. That can be replaced by defining USER_BOND_TYPES_HEADER. A replacement must provide int8_t through uint64_t and size_t, the BOND_PRI* and BOND_SCN* printf and scanf format macros for 32 and 64-bit integers (e.g. BOND_PRId32, BOND_SCNu64), and the BOND_<TYPE>MIN and BOND<TYPE>_MAX constants for the Bond integer types and size_t (e.g. BOND_CHAR_MAX, BOND_SIZE_MAX) in the Bond namespace.

Macro Definition Documentation

◆ BOND_SIGNATURE_TYPE_ITEM

#define BOND_SIGNATURE_TYPE_ITEM ( type,
bondType,
apiType )
Value:
SIG_ ## type,