219 lines
5.6 KiB
C++
219 lines
5.6 KiB
C++
/* (c) Copyright 2003-2021, Real-Time Innovations, Inc. All rights reserved. */
|
|
/*
|
|
* @(#)ndds_utility_cpp.h generated by: makeheader Tue Apr 7 22:56:40 2026
|
|
*
|
|
* built from: ndds_utility_cpp.ifcxx
|
|
*/
|
|
|
|
#ifndef ndds_utility_cpp_h
|
|
#define ndds_utility_cpp_h
|
|
|
|
|
|
#ifndef dds_cpp_dll_h
|
|
#include "dds_cpp/dds_cpp_dll.h"
|
|
#endif
|
|
#ifndef dds_cpp_infrastructure_h
|
|
#include "dds_cpp/dds_cpp_infrastructure.h"
|
|
#endif
|
|
#ifndef dds_cpp_domain_h
|
|
#include "dds_cpp/dds_cpp_domain.h"
|
|
#endif
|
|
#ifndef ndds_utility_c_h
|
|
#include "ndds/ndds_utility_c.h"
|
|
#endif
|
|
|
|
class DDSCPPDllExport NDDSUtilityHeapMonitoring {
|
|
public:
|
|
/*e \dref_HeapMonitoring_enable */
|
|
static DDS_Boolean enable();
|
|
|
|
/*e \dref_HeapMonitoring_enable_w_params
|
|
*/
|
|
static DDS_Boolean enable(
|
|
const NDDS_Utility_HeapMonitoringParams_t& params);
|
|
|
|
/*e \dref_HeapMonitoring_disable */
|
|
static void disable();
|
|
|
|
/*e \dref_HeapMonitoring_pause */
|
|
static DDS_Boolean pause();
|
|
|
|
/*e \dref_HeapMonitoring_resume */
|
|
static DDS_Boolean resume();
|
|
|
|
/*e \dref_HeapMonitoring_take_heap_snapshot */
|
|
static DDS_Boolean take_heap_snapshot(
|
|
const char *filename,
|
|
DDS_Boolean print_details);
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
static DDS_Boolean enable_function_history();
|
|
|
|
};
|
|
|
|
class DDSCPPDllExport NDDSUtilityNetworkCapture {
|
|
public:
|
|
/*e \dref_NetworkCapture_enable */
|
|
static DDS_Boolean enable();
|
|
|
|
/*e \dref_NetworkCapture_disable */
|
|
static DDS_Boolean disable();
|
|
|
|
/*e \dref_NetworkCapture_set_default_params */
|
|
static DDS_Boolean set_default_params(
|
|
const NDDS_Utility_NetworkCaptureParams_t& params);
|
|
|
|
/*e \dref_NetworkCapture_start */
|
|
static DDS_Boolean start(
|
|
const char *filename);
|
|
|
|
/*e \dref_NetworkCapture_start_for_participant */
|
|
static DDS_Boolean start(
|
|
DDSDomainParticipant *participant,
|
|
const char *filename);
|
|
|
|
/*e \dref_NetworkCapture_start_w_params */
|
|
static DDS_Boolean start(
|
|
const char *filename,
|
|
const NDDS_Utility_NetworkCaptureParams_t& params);
|
|
|
|
/*e \dref_NetworkCapture_start_w_params_for_participant */
|
|
static DDS_Boolean start(
|
|
DDSDomainParticipant *participant,
|
|
const char *filename,
|
|
const NDDS_Utility_NetworkCaptureParams_t& params);
|
|
|
|
/*e \dref_NetworkCapture_stop */
|
|
static DDS_Boolean stop();
|
|
|
|
/*e \dref_NetworkCapture_stop_for_participant */
|
|
static DDS_Boolean stop(DDSDomainParticipant *participant);
|
|
|
|
/*e \dref_NetworkCapture_pause */
|
|
static DDS_Boolean pause();
|
|
|
|
/*e \dref_NetworkCapture_pause_for_participant */
|
|
static DDS_Boolean pause(DDSDomainParticipant *participant);
|
|
|
|
/*e \dref_NetworkCapture_resume */
|
|
static DDS_Boolean resume();
|
|
|
|
/*e \dref_NetworkCapture_resume_for_participant */
|
|
static DDS_Boolean resume(DDSDomainParticipant *participant);
|
|
|
|
};
|
|
|
|
class DDSCPPDllExport NDDSUtility {
|
|
public:
|
|
/*e \dref_Utilities_sleep */
|
|
static void sleep(const struct DDS_Duration_t& durationIn);
|
|
|
|
/*e \dref_Utilities_spin */
|
|
static void spin(DDS_UnsignedLongLong spinCount);
|
|
|
|
/*e \dref_Utilities_get_spin_per_microsecond */
|
|
static DDS_UnsignedLongLong get_spin_per_microsecond();
|
|
|
|
/* ------------------ Deprecated Heap Monitoring API ------------------- */
|
|
/*e \dref_Utilities_enable_heap_monitoring */
|
|
static DDS_Boolean enable_heap_monitoring();
|
|
|
|
/*e \dref_Utilities_disable_heap_monitoring */
|
|
static void disable_heap_monitoring();
|
|
|
|
/*e \dref_Utilities_pause_heap_monitoring */
|
|
static DDS_Boolean pause_heap_monitoring();
|
|
|
|
/*e \dref_Utilities_resume_heap_monitoring */
|
|
static DDS_Boolean resume_heap_monitoring();
|
|
|
|
/*e \dref_Utilities_take_heap_snapshot */
|
|
static DDS_Boolean take_heap_snapshot(
|
|
const char *filename,
|
|
DDS_Boolean print_details);
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
static DDS_Boolean enable_function_history();
|
|
};
|
|
|
|
class NDDSStackManagedThread_impl;
|
|
|
|
class DDSCPPDllExport NDDSStackManagedThread {
|
|
|
|
public:
|
|
/*i \dref_StackManagedThread_get_name
|
|
*/
|
|
virtual const char * get_name() = 0;
|
|
|
|
/*i \dref_StackManagedThread_get_stack_size
|
|
*/
|
|
virtual DDS_Long get_stack_size() = 0;
|
|
|
|
/*i \dref_StackManagedThread_get_stack_usage_max
|
|
*/
|
|
virtual DDS_Long get_stack_usage_max() = 0;
|
|
|
|
protected:
|
|
|
|
virtual ~NDDSStackManagedThread() {};
|
|
|
|
};
|
|
|
|
class DDSCPPDllExport NDDSThreadStackAllocator {
|
|
|
|
public:
|
|
|
|
/*i \dref_ThreadStackAllocator_create_stack
|
|
*/
|
|
virtual void * create_stack(DDS_Long * stack_size_in_bytes) = 0;
|
|
|
|
virtual ~NDDSThreadStackAllocator() {};
|
|
};
|
|
|
|
class NDDSStackManagedThreadFactory_impl;
|
|
|
|
class DDSCPPDllExport NDDSStackManagedThreadFactory : public DDSThreadFactory {
|
|
|
|
void* create_thread(
|
|
const char * thread_name,
|
|
const DDS_ThreadSettings_t & settings,
|
|
DDSThreadFactory_OnSpawnedFunction on_spawned,
|
|
void * thread_param);
|
|
|
|
void delete_thread(void * thread);
|
|
|
|
|
|
public:
|
|
|
|
/*i \dref_StackManagedThreadFactory_get_thread_count
|
|
*/
|
|
DDS_Long get_thread_count();
|
|
|
|
/*i \dref_StackManagedThreadFactory_get_thread_at
|
|
*/
|
|
NDDSStackManagedThread * get_thread_at(DDS_Long index);
|
|
|
|
/*i \dref_StackManagedThreadFactory_print_threads_stack_summary
|
|
*/
|
|
void print_threads_stack_summary();
|
|
|
|
/*i \dref_StackManagedThreadFactory_new
|
|
*/
|
|
NDDSStackManagedThreadFactory(
|
|
NDDSThreadStackAllocator * thread_stack_allocator);
|
|
|
|
NDDSStackManagedThreadFactory();
|
|
|
|
~NDDSStackManagedThreadFactory();
|
|
|
|
private:
|
|
|
|
NDDSStackManagedThreadFactory_impl * _impl;
|
|
};
|
|
|
|
#endif /* ndds_utility_cpp_h */
|