00001 #ifndef SAFETY_PROFILE_STREAMS_H 00002 #define SAFETY_PROFILE_STREAMS_H 00003 00004 #include "dds/DCPS/PoolAllocator.h" 00005 #include "dcps_export.h" 00006 00007 #include "ace/OS_NS_stdio.h" 00008 #include "tao/Basic_Types.h" 00009 00010 #ifndef OPENDDS_SAFETY_PROFILE 00011 #include <fstream> 00012 #include <iostream> 00013 #include <iomanip> 00014 #include <sstream> 00015 #endif //OPENDDS_SAFETY_PROFILE 00016 00017 namespace OpenDDS { 00018 namespace DCPS { 00019 00020 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(::CORBA::UShort to_convert); 00021 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(int to_convert); 00022 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(unsigned int to_convert, bool as_hex = false); 00023 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(long to_convert); 00024 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(long long to_convert); 00025 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(unsigned long long to_convert, bool as_hex = false); 00026 OpenDDS_Dcps_Export OPENDDS_STRING to_dds_string(unsigned long to_convert, bool as_hex = false); 00027 00028 template <typename T> 00029 inline OPENDDS_STRING 00030 to_dds_string(const T* to_convert) 00031 { 00032 const char* fmt = "%p"; 00033 const int buff_size = 20 + 1; // note +1 for null terminator 00034 char buf[buff_size]; 00035 ACE_OS::snprintf(&buf[0], buff_size, fmt, to_convert); 00036 return OPENDDS_STRING(buf); 00037 } 00038 00039 } // namespace DCPS 00040 } // namespace OpenDDS 00041 00042 #endif //SAFETY_PROFILE_STREAMS_H