Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/.forward-declarations/include/DDS/Generic/generic_logger.h
T
berrux-dev 5381c65fee Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules
Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.
2026-09-24 10:10:25 +02:00

84 lines
1.8 KiB
C++

#pragma once
#ifdef BUILD_RTI
// Real implementation with RTI NGL logger
#include <NGLLogger/INGLLogger.h>
#include <ddsgen_export.h>
#include <string>
namespace DDS
{
enum class DataType
{
DATA_TYPE_UNKNOWN = 0,
DATA_WRITER = 1,
DATA_READER = 2,
DYNAMIC_DATA_WRITER = 3,
DYNAMIC_DATA_READER = 4,
DATA_TOPIC_SERVER = 8,
DATA_TOPIC_CLIENT = 9,
FUNCTION_TOPIC_SERVER = 12,
FUNCTION_TOPIC_CLIENT = 13
};
using LOGGER_T = NGL::INGLLogger&;
DDSGEN_EXPORT LOGGER_T getLogger(const char *name, DataType dt);
inline LOGGER_T getLogger(const std::string &loggerName, DataType dt)
{
return getLogger(loggerName.data(), dt);
}
} // namespace DDS
#else
// Stub header for BUILD_RTI=OFF
#include <NGLLogger/INGLLogger.h>
#include <ddsgen_export.h>
#include <string>
namespace DDS
{
// DataType enum - same as original, no RTI dependency
enum class DataType
{
DATA_TYPE_UNKNOWN = 0,
DATA_WRITER = 1,
DATA_READER = 2,
DYNAMIC_DATA_WRITER = 3,
DYNAMIC_DATA_READER = 4,
DATA_TOPIC_SERVER = 8,
DATA_TOPIC_CLIENT = 9,
FUNCTION_TOPIC_SERVER = 12,
FUNCTION_TOPIC_CLIENT = 13
};
// Logger type alias
using LOGGER_T = NGL::INGLLogger&;
// Stub implementation for getLogger
// Returns a dummy logger reference - in real usage, this would need proper initialization
DDSGEN_EXPORT inline LOGGER_T getLogger(const char *name, DataType dt) {
// Stub: return a static dummy logger
// In production code with BUILD_RTI=OFF, this should be replaced with actual logger
static NGL::INGLLogger* dummy_logger = nullptr;
return *dummy_logger;
}
// Inline overload for std::string
inline LOGGER_T getLogger(const std::string &loggerName, DataType dt)
{
return getLogger(loggerName.data(), dt);
}
} // namespace DDS
#endif