22 #ifndef UniSetTypes_H_
23 #define UniSetTypes_H_
36 #include <omniORB4/CORBA.h>
37 #include "UniSetTypes_i.hh"
38 #include "IOController_i.hh"
41 #include "PassiveTimer.h"
44 inline void msleep( uniset::timeout_t m )
46 std::this_thread::sleep_for(std::chrono::milliseconds(m));
74 return KeyType((
id * node) + (
id + 2 * node));
87 UniversalIO::IOType getIOType(
const std::string& s ) noexcept;
88 std::string iotype2str(
const UniversalIO::IOType& t ) noexcept;
89 std::ostream& operator<<( std::ostream& os,
const UniversalIO::IOType t );
104 static const long ChannelBreakValue = std::numeric_limits<long>::max();
110 IDList(
const std::vector<std::string>& v );
117 inline size_t size()
const noexcept
121 inline bool empty()
const noexcept
126 std::list<ObjectId> getList() noexcept;
130 IDSeq* getIDSeq()
const;
137 std::list<ObjectId> lst;
152 inline bool operator < (
const ObjectInfo& o )
const
158 typedef std::list<NodeInfo> ListOfNode;
167 int uni_atoi(
const char* str ) noexcept;
168 inline int uni_atoi(
const std::string& str ) noexcept
173 char* uni_strdup(
const std::string& src );
175 std::string
timeToString(time_t tm = time(0),
const std::string& brk =
":") noexcept;
176 std::
string dateToString(time_t tm = time(0), const std::
string& brk = "/") noexcept;
178 struct timeval
to_timeval( const std::chrono::system_clock::duration& d );
179 struct timespec
to_timespec( const std::chrono::system_clock::duration& d );
182 inline
bool operator==( const struct timespec& r1, const struct timespec& r2 )
184 return ( r1.tv_sec == r2.tv_sec && r1.tv_nsec == r2.tv_nsec );
187 inline bool operator!=(
const struct timespec& r1,
const struct timespec& r2 )
189 return !(operator==(r1, r2));
193 IDList
explode(
const std::string& str,
char sep =
',' );
194 std::vector<std::string> explode_str(
const std::string& str,
char sep =
',' );
206 std::list<ParamSInfo>
getSInfoList(
const std::string& s, std::shared_ptr<uniset::Configuration> conf =
nullptr );
211 std::list<uniset::ConsumerInfo>
getObjectsList(
const std::string& s, std::shared_ptr<uniset::Configuration> conf =
nullptr );
214 bool is_digit(
const std::string& s ) noexcept;
221 std::string
replace_all(
const std::string& src,
const std::string& from,
const std::string& to );
230 int _argc,
const char*
const* _argv,
231 const std::string& defval =
"" ) noexcept
233 for(
int i = 1; i < (_argc - 1) ; i++ )
235 if( name == _argv[i] )
242 inline int getArgInt(
const std::string& name,
243 int _argc,
const char*
const* _argv,
244 const std::string& defval =
"" ) noexcept
256 inline int findArgParam(
const std::string& name,
int _argc,
const char*
const* _argv )
258 for(
int i = 1; i < _argc; i++ )
260 if( name == _argv[i] )
279 float fcalibrate(
float raw,
float rawMin,
float rawMax,
float calMin,
float calMax,
bool limit =
true );
280 long lcalibrate(
long raw,
long rawMin,
long rawMax,
long calMin,
long calMax,
bool limit =
true );
283 long setinregion(
long raw,
long rawMin,
long rawMax);
285 long setoutregion(
long raw,
long rawMin,
long rawMax);
290 bool file_exist(
const std::string& filename );
294 bool check_filter( UniXML::iterator& it,
const std::string& f_prop,
const std::string& f_val =
"" ) noexcept;
297 template<typename InputIterator,
298 typename OutputIterator,
302 OutputIterator destBegin,
307 if( p(*begin) ) &(destBegin++) = *begin;