HawkTracer  0.10.0
base_types.h File Reference
#include <hawktracer/macros.h>
#include <hawktracer/mkcreflect.h>
#include <inttypes.h>

Go to the source code of this file.

Macros

#define HT_TRUE   1
 Defines true value for the HT_Boolean type. More...
 
#define HT_FALSE   0
 Defines false value for the HT_Boolean type. More...
 
#define HT_INVALID_KLASS_ID   ((HT_EventKlassId)-1)
 Defines an invalid klass identifier. More...
 
#define HT_INVALID_FEATURE_ID   ((uint32_t)-1)
 Defines an invalid feature identifier. More...
 

Typedefs

typedef uint64_t HT_TimestampNs
 An unsigned integer used for representing timestamps in nanoseconds. More...
 
typedef uint64_t HT_EventId
 An unsigned integer used for event identifiers. More...
 
typedef uint64_t HT_DurationNs
 An unsigned integer used for representing duration in nanoseconds. More...
 
typedef int HT_Boolean
 A standard boolean type, possible values: HT_TRUE, HT_FALSE. More...
 
typedef uint8_tTEventPtr
 A pointer to a list of HT_Event (or derived) objects. More...
 
typedef uint32_t HT_ThreadId
 An unsigned integer used for thread identifiers. More...
 
typedef uint8_t HT_Byte
 An unsigned integer guaranteed to be 8 bits on all platforms. More...
 
typedef void(* HT_DestroyCallback) (void *data)
 A type of function called to destroy data element. More...
 

Enumerations

enum  HT_ErrorCode {
  HT_ERR_OK = 0, HT_ERR_UNKNOWN, HT_ERR_OUT_OF_MEMORY, HT_ERR_FEATURE_ALREADY_REGISTERED,
  HT_ERR_FEATURE_NOT_REGISTERED, HT_ERR_MAX_FEATURE_COUNT_REACHED, HT_ERR_LISTENER_CONTAINER_ALREADY_REGISTERED, HT_ERR_CANT_OPEN_FILE,
  HT_ERR_CANT_START_TCP_SERVER, HT_ERR_CANT_CREATE_LISTENER_CONTAINER, HT_ERR_INVALID_FORMAT, HT_ERR_INVALID_ARGUMENT,
  HT_ERR_OUT_OF_RANGE, HT_ERR_MISSING_ARGUMENT
}
 Defines list of possible errors returned by library functions. More...
 
enum  HT_Endianness { HT_ENDIANNESS_LITTLE = 0, HT_ENDIANNESS_BIG = 1 }
 Defines supported byte ordering. More...
 
enum  HT_MKCREFLECT_Types_Ext {
  HT_MKCREFLECT_TYPES_EXT_STRUCT = MKCREFLECT_TYPES_STRUCT, HT_MKCREFLECT_TYPES_EXT_STRING = MKCREFLECT_TYPES_STRING, HT_MKCREFLECT_TYPES_EXT_INTEGER = MKCREFLECT_TYPES_INTEGER, HT_MKCREFLECT_TYPES_EXT_FLOAT = MKCREFLECT_TYPES_FLOAT,
  HT_MKCREFLECT_TYPES_EXT_DOUBLE = MKCREFLECT_TYPES_DOUBLE, HT_MKCREFLECT_TYPES_EXT_POINTER = MKCREFLECT_TYPES_POINTER, HT_MKCREFLECT_TYPES_EXT_UNSIGNED_INTEGER = 99
}
 Defines list of data types of event fields. More...
 

Variables

HT_DECLS_BEGIN typedef uint32_t HT_EventKlassId
 An unsigned integer used for event klass identifiers. More...
 

Macro Definition Documentation

◆ HT_FALSE

#define HT_FALSE   0

Defines false value for the HT_Boolean type.

◆ HT_INVALID_FEATURE_ID

#define HT_INVALID_FEATURE_ID   ((uint32_t)-1)

Defines an invalid feature identifier.

◆ HT_INVALID_KLASS_ID

#define HT_INVALID_KLASS_ID   ((HT_EventKlassId)-1)

Defines an invalid klass identifier.

◆ HT_TRUE

#define HT_TRUE   1

Defines true value for the HT_Boolean type.

Typedef Documentation

◆ HT_Boolean

typedef int HT_Boolean

A standard boolean type, possible values: HT_TRUE, HT_FALSE.

◆ HT_Byte

typedef uint8_t HT_Byte

An unsigned integer guaranteed to be 8 bits on all platforms.

◆ HT_DestroyCallback

typedef void(* HT_DestroyCallback) (void *data)

A type of function called to destroy data element.

It should free all the memory and resources held by the data element.

Parameters
datathe element to be destroyed.

◆ HT_DurationNs

typedef uint64_t HT_DurationNs

An unsigned integer used for representing duration in nanoseconds.

◆ HT_EventId

typedef uint64_t HT_EventId

An unsigned integer used for event identifiers.

◆ HT_ThreadId

typedef uint32_t HT_ThreadId

An unsigned integer used for thread identifiers.

◆ HT_TimestampNs

typedef uint64_t HT_TimestampNs

An unsigned integer used for representing timestamps in nanoseconds.

◆ TEventPtr

typedef uint8_t* TEventPtr

A pointer to a list of HT_Event (or derived) objects.

Enumeration Type Documentation

◆ HT_Endianness

Defines supported byte ordering.

Enumerator
HT_ENDIANNESS_LITTLE 

Little-endian order.

HT_ENDIANNESS_BIG 

Big-endian order.

◆ HT_ErrorCode

Defines list of possible errors returned by library functions.

Enumerator
HT_ERR_OK 

No error.

HT_ERR_UNKNOWN 

Unknown error.

HT_ERR_OUT_OF_MEMORY 

Memory allocation failed.

This is very serious error, and most likely your entire application is broken at this point of time.

HT_ERR_FEATURE_ALREADY_REGISTERED 

Try to register a timeline feature using ID which is already taken by some other feature.

HT_ERR_FEATURE_NOT_REGISTERED 

Try to use feature that has not been registered in the system.

HT_ERR_MAX_FEATURE_COUNT_REACHED 

Try to register too many features in the system.

HT_ERR_LISTENER_CONTAINER_ALREADY_REGISTERED 

Try to register container with name already used in registry.

This error is used internally, and is never returned by public API. TODO: consider removing it from public enum.

HT_ERR_CANT_OPEN_FILE 

Cannot open file.

HT_ERR_CANT_START_TCP_SERVER 

Cannot start tcp server.

This error might have many root causes, some of them are: socket can't be open, library is not able to bind to a port.

HT_ERR_CANT_CREATE_LISTENER_CONTAINER 

Unable to create listener container.

This is most likely caused by HT_ERR_OUT_OF_MEMORY occured internally in the library.

HT_ERR_INVALID_FORMAT 

Format of an input data is invalid.

HT_ERR_INVALID_ARGUMENT 

Invalid argument.

HT_ERR_OUT_OF_RANGE 

Out of range.

HT_ERR_MISSING_ARGUMENT 

Missing argument.

◆ HT_MKCREFLECT_Types_Ext

Defines list of data types of event fields.

Enumerator
HT_MKCREFLECT_TYPES_EXT_STRUCT 

Data type struct.

HT_MKCREFLECT_TYPES_EXT_STRING 

Data type string.

HT_MKCREFLECT_TYPES_EXT_INTEGER 

Data type integer.

HT_MKCREFLECT_TYPES_EXT_FLOAT 

Data type float.

HT_MKCREFLECT_TYPES_EXT_DOUBLE 

Data type double.

HT_MKCREFLECT_TYPES_EXT_POINTER 

Data type pointer.

HT_MKCREFLECT_TYPES_EXT_UNSIGNED_INTEGER 

Data type unsigned integer.

Variable Documentation

◆ HT_EventKlassId

HT_DECLS_BEGIN typedef uint32_t HT_EventKlassId

An unsigned integer used for event klass identifiers.