/* ( (c) Copyright, Real-Time Innovations, 2003-2024. * All rights reserved. * No duplications, whole or partial, manual or electronic, may be made * without express written permission. Any such copies, or * revisions thereof, must display this notice unaltered. * This code contains trade secrets of Real-Time Innovations, Inc. */ #ifndef cdr_log_h #define cdr_log_h #ifndef cdr_dll_h #include "cdr/cdr_dll.h" #endif #ifndef log_common_h #include "log/log_common.h" #endif #ifndef log_category_h #include "log/log_category.h" #endif #ifndef reda_worker_h #include "reda/reda_worker.h" #endif #ifndef osapi_activityContext_h #include "osapi/osapi_activityContext.h" #endif #ifdef __cplusplus extern "C" { #endif /*e \mainpage * * RTI's API to CDR for serializing/deserializing CDR primitive types. * * The RTI CDR library contains functions to manipulate the data represented * in the CDR format. The common methods are: * * * * We support all CDR primitive data types. You are responsible for ensuring * that your application includes the proper headers to define these types, * or that these are native types that exist on your system and are fully * compliant with the CDR definition of these types. */ /*e \ingroup RTICdrLog * Submodule ID for error code */ /* NOTE: When a new submodule is added to CDR, it must be given * a number and entered here. Because of the use of this id * for logging, there are 16 submodule id's: 0x0000, 0x1000,... * ..., 0xF000. * It is suggested we put the modules here in an order that * respects their dependencies: modules with a lower number * cannot depend on modules with a higher number. */ #define SUBMODULE_CDR_STREAM (0x0000) #define SUBMODULE_CDR_TYPE_CODE (0x0001) #define SUBMODULE_CDR_TYPE_OBJECT (0x0002) /*e \ingroup RTICdrLog * Stream submodule mask for logging. */ #define RTI_CDR_SUBMODULE_MASK_STREAM (0x0001) /*e \ingroup RTICdrLog * Type code submodule mask for logging. */ #define RTI_CDR_SUBMODULE_MASK_TYPE_CODE (0x0002) /*e \ingroup RTICdrLog * TypeObject submodule mask for logging. */ #define RTI_CDR_SUBMODULE_MASK_TYPE_OBJECT (0x0004) /*e \ingroup RTICdrLog * Mask for turning on logging for all submodules. */ #define RTI_CDR_SUBMODULE_MASK_ALL RTI_LOG_SUBMODULE_MASK_ALL /*e \ingroup RTICdrLog * serialization failed. */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_SERIALIZE_FAILURE_s; /*e \ingroup RTICdrLog * deserialization failed. */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_DESERIALIZE_FAILURE_s; /*e \ingroup RTICdrLog * skip failed. */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_SKIP_FAILURE_s; /*e \ingroup RTICdrLog * the encapsulation is not valid */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_INVALID_ENCAPSULATION_ID_d; /*e \ingroup RTICdrLog * sequence length exceeds maximum */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_EXCEED_SEQ_MAX_LENGTH_dd; /*e \ingroup RTICdrLog * sample length exceeds maximum channel length */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_EXCEED_MAX_CHANNEL_LENGTH_uu; /*e \ingroup RTICdrLog * Invalid enum value for enumerator when serializing */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_SERIALIZE_INVALID_ENUMERATOR_ds; /*e \ingroup RTICdrLog * Invalid enum value for enumerator when deserializing */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_DESERIALIZE_INVALID_ENUMERATOR_ds; /*e \ingroup RTICdrLog * Out of bounds uncompressed length from a compressed sample */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_DESERIALIZE_UNCOMPRESSED_LENGTH_FAILURE_uu; /*e \ingroup RTICdrLog * Unassignable sample of type */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_UNASSIGNABLE_SAMPLE_OF_TYPE_s; /*e \ingroup RTICdrLog * Found an unknown enumerator and initializing enumeration to default */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_XTYPES_DESERIALIZE_UNKNOWN_ENUM_ORDINAL_sssdd; /*e \ingroup RTICdrLog * Found an unknown discriminator and initializing union to default */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_XTYPES_DESERIALIZE_UNKNOWN_UNION_DISCRIMINATOR_s; /*e \ingroup RTICdrLog * Found an unknown discriminator and initializing union to default */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_XTYPES_DESERIALIZE_UNKNOWN_UNION_DISCRIMINATOR_sss; /*e \ingroup RTICdrLog * TypeObject not assignable (reason why, and two elements that are unassignable) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_ASSIGNABLE_sss; /*e \ingroup RTICdrLog * TypeObject not assignable (reason why, and element that makes it unassignable) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_ASSIGNABLE_ss; /*e \ingroup RTICdrLog * TypeObject unassignable member * (reason why, and member name and ID that makes it unassignable) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_MEMBER_NOT_ASSIGNABLE_ssd; /*e \ingroup RTICdrLog * TypeObject unassignable collection bounds * (the two integers are the destination and source bounds) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_COLLECTION_BOUNDS_NOT_ASSIGNABLE_dd; /*e \ingroup RTICdrLog * TypeObject unassignable union labels * (the two strings are the field names and the integer is the discriminator * value for that label) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_UNION_LABEL_NOT_ASSIGNABLE_dss; /*e \ingroup RTICdrLog * TypeObject not assignable (reason why) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_ASSIGNABLE_s; /*e \ingroup RTICdrLog * TypeObject error (related type ID and reason) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_ERROR_ds; /*e \ingroup RTICdrLog * TypeObject not equivalent */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_EQUIVALENT_ss; /*e \ingroup RTICdrLog * TypeObjects not equal: takes the name of both types */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_EQUAL_ss; /*e \ingroup RTICdrLog * TypeObject members not equal * (reason why, and member name and ID) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_MEMBER_NOT_EQUAL_ssd; /*e \ingroup RTICdrLog * TypeObject not equal (reason why) */ extern RTICdrDllVariable const struct RTILogMessage RTI_CDR_LOG_TYPE_OBJECT_NOT_EQUAL_s; /*i * \ingroup RTICdrLog * @brief See \ref RTILogCategory_log */ #define RTICdrLogger_log(instrumentationBit__, logMessage__, worker__, ...) \ RTILogCategory_log( \ RTICdrLog_g_instrumentationMask, \ RTICdrLog_g_submoduleMask, \ RTI_CDR_CURRENT_SUBMODULE, \ (instrumentationBit__), \ MODULE_CDR, \ (logMessage__), \ (worker__), \ __VA_ARGS__) #define RTICdrLogMessage_log(INSTRUMENT_BIT, ...) \ RTILogMessage_log( \ RTICdrLog_g_instrumentationMask, \ RTICdrLog_g_submoduleMask, \ RTI_CDR_CURRENT_SUBMODULE, \ RTI_LOG_PRINT_FORMAT_MASK_ALL, \ (INSTRUMENT_BIT), \ MODULE_CDR, \ __VA_ARGS__) #define RTICdrLog_logWithFunctionName(INSTRUMENT_BIT, FUNCTION_NAME, ...) \ RTILogMessage_logWithFunctionName( \ RTICdrLog_g_instrumentationMask, \ RTICdrLog_g_submoduleMask, \ RTI_CDR_CURRENT_SUBMODULE, \ RTI_LOG_PRINT_FORMAT_MASK_ALL, \ (INSTRUMENT_BIT), \ MODULE_CDR, \ (FUNCTION_NAME), \ __VA_ARGS__) #define RTICdrLog_fatal(...) \ RTICdrLogMessage_log(RTI_LOG_BIT_FATAL_ERROR, __VA_ARGS__) #define RTICdrLog_exception(...) \ RTICdrLogMessage_log(RTI_LOG_BIT_EXCEPTION, __VA_ARGS__) #define RTICdrLog_warn(...) \ RTICdrLogMessage_log(RTI_LOG_BIT_WARN, __VA_ARGS__) #ifdef __cplusplus } /* extern "C" */ #endif #endif /* cdr_log_h */