37#include <omniORB4/CORBA.h>
38#include "UniSetTypes_i.hh"
39#include "IOController_i.hh"
42#include "PassiveTimer.h"
45inline void msleep( uniset::timeout_t m )
47 std::this_thread::sleep_for(std::chrono::milliseconds(m));
87 uint64_t hash64(
const std::string& str )
noexcept;
88 uint64_t hash64(
const char* buf,
size_t sz )
noexcept;
89 uint32_t hash32(
const std::string& str )
noexcept;
90 uint32_t hash32(
const char* buf,
size_t sz )
noexcept;
97 UniversalIO::IOType getIOType(
const std::string& s )
noexcept;
98 std::string iotype2str(
const UniversalIO::IOType& t )
noexcept;
99 std::ostream& operator<<( std::ostream& os,
const UniversalIO::IOType t );
114 const long ChannelBreakValue = std::numeric_limits<long>::max();
120 IDList(
const std::vector<std::string>& v );
121#if __cplusplus >= 201703L
122 IDList(
const std::vector<std::string_view>& v );
130 inline size_t size()
const noexcept
134 inline bool empty()
const noexcept
139 std::list<ObjectId> getList()
const noexcept;
140 const std::list<ObjectId>& ref()
const noexcept;
144 IDSeq* getIDSeq()
const;
151 std::list<ObjectId> lst;
161 xmlNode* xmlnode = {
nullptr };
163 inline bool operator < (
const ObjectInfo& o )
const
169 typedef std::list<NodeInfo> ListOfNode;
175 int uni_atoi(
const char* str )
noexcept;
176 int uni_atoi(
const std::string& str )
noexcept;
177#if __cplusplus >= 201703L
178 int uni_atoi_sv( std::string_view str )
noexcept;
181 char* uni_strdup(
const std::string& src );
183 std::string
timeToString(time_t tm = time(0),
const std::string& brk =
":") noexcept;
190 uniset::Timespec_var to_uniset_timespec( const
std::chrono::system_clock::duration& d );
192 int64_t timespec_to_nanosec( const struct timespec& tm );
196 std::vector<
std::
string> explode_str( const
std::
string& str,
char sep = ',' );
197#if __cplusplus >= 201703L
198 IDList split_by_id( std::string_view str,
char sep =
',' );
199 std::vector<std::string_view> split_sv( std::string_view str,
char sep =
',' );
212 std::list<ParamSInfo>
getSInfoList(
const std::string& s, std::shared_ptr<uniset::Configuration> conf =
nullptr );
213#if __cplusplus >= 201703L
214 std::list<ParamSInfo> getSInfoList_sv( std::string_view s, std::shared_ptr<uniset::Configuration> conf =
nullptr );
218 std::list<uniset::ConsumerInfo>
getObjectsList(
const std::string& s, std::shared_ptr<uniset::Configuration> conf =
nullptr );
224 bool is_digit(
const std::string& s )
noexcept;
225#if __cplusplus >= 201703L
226 bool is_digit_sv( std::string_view s )
noexcept;
234 std::string
replace_all(
const std::string& src,
const std::string& from,
const std::string& to );
244 int _argc,
const char*
const* _argv,
245 const std::string& defval =
"" ) noexcept
247 for(
int i = 1; i < (_argc - 1) ; i++ )
249 if( name == _argv[i] )
258 int _argc,
const char*
const* _argv,
259 const std::string& defval,
const std::string& defval2 =
"") noexcept
266 if( !defval.empty() )
272 inline int getArgInt(
const std::string& name,
273 int _argc,
const char*
const* _argv,
274 const std::string& defval =
"" ) noexcept
279 inline int getArgPInt(
const std::string& name,
280 int _argc,
const char*
const* _argv,
281 const std::string& strdefval,
int defval )
noexcept
285 if( param.empty() && strdefval.empty() )
301 inline int findArgParam(
const std::string& name,
int _argc,
const char*
const* _argv )
303 for(
int i = 1; i < _argc; i++ )
305 if( name == _argv[i] )
324 float fcalibrate(
float raw,
float rawMin,
float rawMax,
float calMin,
float calMax,
bool limit =
true );
325 long lcalibrate(
long raw,
long rawMin,
long rawMax,
long calMin,
long calMax,
bool limit =
true );
326 double dcalibrate(
double raw,
double rawMin,
double rawMax,
double calMin,
double calMax,
bool limit =
true );
329 long setinregion(
long raw,
long rawMin,
long rawMax);
331 long setoutregion(
long raw,
long rawMin,
long rawMax);
336 bool file_exist(
const std::string& filename );
337 bool directory_exist(
const std::string& path );
341 bool check_filter( UniXML::iterator& it,
const std::string& f_prop,
const std::string& f_val =
"" ) noexcept;
342 bool check_filter_re( UniXML::iterator& it, const
std::
string& f_prop, const
std::regex& re ) noexcept;
370 inline bool operator==(
const struct timespec &r1,
const struct timespec &r2)
372 return (r1.tv_sec == r2.tv_sec && r1.tv_nsec == r2.tv_nsec);
374 inline bool operator!=(
const struct timespec &r1,
const struct timespec &r2)
376 return !(operator==(r1, r2));
Definition UniSetTypes.h:117
Definition UniSetTypes.h:346
ThresholdState
Definition IOController_i.idl:203
Definition Calibration.h:27
struct timeval to_timeval(const std::chrono::system_clock::duration &d)
const ObjectId AdminID
Definition UniSetTypes.h:75
std::list< ParamSInfo > getSInfoList(const std::string &s, std::shared_ptr< uniset::Configuration > conf=nullptr)
Definition UniSetTypes.cc:487
std::string dateToString(time_t tm=time(0), const std::string &brk="/") noexcept
Definition UniSetTypes.cc:701
int uni_atoi(const char *str) noexcept
Преобразование строки в число (воспринимает префикс 0, как 8-ное, префикс 0x, как 16-ное,...
Definition UniSetTypes.cc:771
int findArgParam(const std::string &name, int _argc, const char *const *_argv)
Definition UniSetTypes.h:301
std::list< std::string > ListObjectName
Definition UniSetTypes.h:92
bool is_digit(const std::string &s) noexcept
Definition UniSetTypes.cc:386
CORBA::Object_ptr ObjectPtr
Definition UniSetTypes.h:94
std::string getArgParam(const std::string &name, int _argc, const char *const *_argv, const std::string &defval="") noexcept
Definition UniSetTypes.h:243
LampCommand
Definition UniSetTypes.h:106
@ lmpBLINK2
Definition UniSetTypes.h:110
@ lmpBLINK
Definition UniSetTypes.h:109
@ lmpON
Definition UniSetTypes.h:108
@ lmpOFF
Definition UniSetTypes.h:107
@ lmpBLINK3
Definition UniSetTypes.h:111
KeyType key(const uniset::ObjectId id, const uniset::ObjectId node)
Definition UniSetTypes.cc:980
CORBA::Object_var ObjectVar
Definition UniSetTypes.h:95
uint64_t KeyType
Definition UniSetTypes.h:77
uniset::Timespec_var now_to_uniset_timespec()
Definition UniSetTypes.cc:913
long ThresholdId
Definition UniSetTypes_i.idl:31
std::string replace_all(const std::string &src, const std::string &from, const std::string &to)
Definition UniSetTypes.cc:856
const ThresholdId DefaultThresholdId
Definition UniSetTypes.h:72
std::string timeToString(time_t tm=time(0), const std::string &brk=":") noexcept
Definition UniSetTypes.cc:690
struct timespec now_to_timespec()
Definition UniSetTypes.cc:907
sequence< ObjectId > IDSeq
Definition UniSetTypes_i.idl:89
const char BadSymbols[]
Definition UniSetTypes.h:58
struct timespec to_timespec(const std::chrono::system_clock::duration &d)
const ThresholdId DefaultTimerId
Definition UniSetTypes.h:73
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
IDList explode(const std::string &str, char sep=',')
Definition UniSetTypes.cc:336
std::list< uniset::ConsumerInfo > getObjectsList(const std::string &s, std::shared_ptr< uniset::Configuration > conf=nullptr)
Definition UniSetTypes.cc:557
char checkBadSymbols(const std::string &str)
Definition UniSetTypes.cc:940
std::string BadSymbolsToStr()
Definition UniSetTypes.cc:955
std::string getArg2Param(const std::string &name, int _argc, const char *const *_argv, const std::string &defval, const std::string &defval2="") noexcept
Definition UniSetTypes.h:257
long ObjectId
Definition UniSetTypes_i.idl:30
Definition IOController_i.idl:83
Definition IOController_i.idl:58
Definition IOController_i.idl:144
Definition IOController_i.idl:210
Definition UniSetTypes.h:156
std::string repName
Definition UniSetTypes.h:158
std::string textName
Definition UniSetTypes.h:159
std::string name
Definition UniSetTypes.h:160
Definition UniSetTypes.h:203