![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: simpleDDMStringUtil.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00009 #ifndef stringUtil_H_ 00010 #define stringUtil_H_ 00011 00012 // Utility for converting strings between narrow and wide formats 00013 00014 #include <string> 00015 #include <sstream> 00016 00017 std::wstring DtToWString(const char* in_val); 00018 std::string DtToString(const std::wstring &in_val); 00019 std::string usage(); 00020 00021 00022 // Convert narrow C string to wide string 00023 inline std::wstring DtToWString(const char* in_val) 00024 { 00025 std::wstring temp; 00026 while (*in_val != '\0') 00027 temp += *in_val++; 00028 return temp; 00029 } 00030 00031 // Convert narrow string to wide string 00032 inline std::string DtToString(const std::wstring &in_val) 00033 { 00034 std::string temp; 00035 std::wstring::const_iterator b = in_val.begin(); 00036 const std::wstring::const_iterator e = in_val.end(); 00037 while (b != e) 00038 { 00039 temp += static_cast<char>(*b); 00040 ++b; 00041 } 00042 return temp; 00043 } 00044 00045 00046 00047 inline std::string usage() 00048 { 00049 std::ostringstream ostr; 00050 ostr << "Usage:\n" 00051 00052 << std::setw( 20 ) << " -fedFile " 00053 << "specify the Fed file name \n" 00054 << std::setw ( 32 ) << " " << "1.3 Default: (MAKSimpleDDM.fed) \n" 00055 << std::setw ( 32 ) << " " << "1516 Default: (MAKSimpleDDM.xml) \n" 00056 << "\nSubscriber parameters\n" 00057 00058 << std::setw( 20 ) << " -maxSubscribe " 00059 << "Simple DDM uses just one extent and dimension, \n" 00060 << std::setw( 32 ) << " " << "this is the subscribers upper range \n" 00061 << std::setw( 32 ) << " " << "(in seconds)\n" 00062 00063 << std::setw( 20 ) << " -minSubscribe " 00064 << "Simple DDM uses just one extent and dimension, \n" 00065 << std::setw( 32 ) << " " << "this is the subscriber's lower range \n" 00066 << std::setw( 32 ) << " " << "(in seconds)\n" 00067 00068 << std::setw( 20 ) << " -maxSubscribeH " 00069 << "Simple DDM uses just one extent and dimension, \n" 00070 << std::setw( 32 ) << " " << "this is the subscribers upper range\n" 00071 << std::setw( 32 ) << " " << "(in hours)\n" 00072 00073 << std::setw( 20 ) << " -minSubscribeH " 00074 << "Simple DDM uses just one extent and dimension, \n" 00075 << std::setw( 32 ) << " " << "this the subscriber's lower range \n" 00076 << std::setw( 32 ) << " " << "(in hours)\n" 00077 00078 << std::setw( 20 ) << " -scopeAdvisories " 00079 << "Whether or not the user wants to receive \n" 00080 << std::setw( 32 ) << " " << "scoping advisory notices (0 || 1)\n" 00081 00082 00083 << "\nPublisher parameters\n" 00084 00085 << std::setw( 20 ) << " -isPublisher " 00086 << "Whether the application should as publisher or \n" 00087 << std::setw( 32 ) << " " << "subscriber. (default 0)\n" 00088 00089 << std::setw( 20 ) << " -clockWise " 00090 << "Whether the object moves in CW or CCW direction \n" 00091 << std::setw( 32 ) << " " << "1 = CW (default)\n" 00092 00093 << std::setw( 20 ) << " -increment " 00094 << "Increment that the publisher will advance by in seconds\n" 00095 << std::setw( 32 ) << " " << "modified by multiplier\n" 00096 00097 << std::setw( 20 ) << " -multiplier " 00098 << "Multiplier for both advancement upon the extent\n" 00099 << std::setw( 32 ) << " " << "and lookahead on the extent\n" 00100 00101 << std::setw( 20 ) << " -wait " 00102 << "Time interval (in milliseconds) to wait inbetween each update cycle.\n" 00103 00104 << std::setw( 20 ) << " -range " 00105 << "Lookahead multiplier that the listening range \n" 00106 << std::setw( 32 ) << " " << "will subscribe to\n" 00107 00108 << std::setw( 20 ) << " -sendRangeTolerance " 00109 << " Describes a percentage of the sending range, \n" 00110 << std::setw( 32 ) << " " << "how close the sender can get to the \n" 00111 << std::setw( 32 ) << " " << "extents of the sending range before \n" 00112 << std::setw( 32 ) << " " << "the Lower and Upper Bound of the \n" 00113 << std::setw( 32 ) << " " << "sender are re-sent\n" 00114 00115 << std::setw( 20 ) << " -timeZone" 00116 << " Sets the UTC zone of the publisher \n" 00117 << std::setw( 32 ) << " " << "Acceptable Values are from 0 .. 23 \n" 00118 << std::setw( 32 ) << " " << " Default value is 0, representing GMT\n" 00119 00120 << std::setw( 20 ) << " -printUpdate " 00121 << "When GUI is disabled, prints a dot for each update to better\n" 00122 << std::setw( 32 ) << " " << "distinguish bounds changes\n" 00123 00124 00125 << "\nDisplay Options \n" 00126 << std::setw( 20 ) << " -displayRegion " 00127 << "Whether or not there is distinction in shading \n" 00128 << std::setw( 32 ) << " " << "in extent of a region and the entire \n" 00129 << std::setw( 32 ) << " " << "dimension (0 || 1)\n" 00130 00131 #ifdef SIMPLEDDMGUI 00132 << std::setw( 20 ) << " -useGUI " 00133 << "Whether the application should run in GUI or \n" 00134 << std::setw( 32 ) << " " << "console mode. \n" 00135 #endif 00136 << std::endl; 00137 00138 return ostr.str(); 00139 } 00140 00141 #endif 00142 00143 00144