26 #error C++ is required
30 #include <sys/types.h>
37 #if defined(__arch64__) || defined(__x86_64__) \
38 || defined(__amd64__) || defined(__ia64__) \
39 || defined(__alpha__) || defined(__sparcv9) || defined(__mips64)
47 #if defined(WIN32) || defined(_WIN32)
61 typedef signed __int8 int8_t;
62 typedef unsigned __int8 u_int8_t;
63 typedef unsigned __int8 uint8_t;
64 typedef signed __int16 int16_t;
65 typedef unsigned __int16 u_int16_t;
66 typedef unsigned __int16 uint16_t;
67 typedef signed __int32 int32_t;
68 typedef unsigned __int32 u_int32_t;
69 typedef unsigned __int32 uint32_t;
70 typedef signed __int64 int64_t;
71 typedef unsigned __int64 u_int64_t;
72 typedef unsigned __int64 uint64_t;
75 typedef int socklen_t;
76 typedef unsigned long in_addr_t;
79 #define strcasecmp _stricmp
83 #define strncasecmp _strnicmp
86 #define vsnprintf _vsnprintf
87 #define snprintf _snprintf
88 #define strdup _strdup
89 #define strtoll _strtoi64
95 #define getpid _getpid
97 #define mkdir(p,m) _mkdir(p)
98 #define unlink _unlink
100 #define O_RDWR _O_RDWR
101 #define O_RDONLY _O_RDONLY
102 #define O_WRONLY _O_WRONLY
103 #define O_APPEND _O_APPEND
104 #define O_BINARY _O_BINARY
105 #define O_EXCL _O_EXCL
106 #define O_CREAT _O_CREAT
107 #define O_TRUNC _O_TRUNC
110 #define S_IRUSR _S_IREAD
111 #define S_IWUSR _S_IWRITE
113 #define S_IRWXU (_S_IREAD|_S_IWRITE)
115 #ifdef LIBYATE_EXPORTS
116 #define YATE_API __declspec(dllexport)
118 #ifndef LIBYATE_STATIC
119 #define YATE_API __declspec(dllimport)
123 #define FMT64 "%I64d"
124 #define FMT64U "%I64u"
128 #include <sys/time.h>
129 #include <sys/socket.h>
131 #if defined(__FreeBSD__)
132 #include <netinet/in_systm.h>
135 #include <netinet/in.h>
136 #include <netinet/ip.h>
137 #include <netinet/tcp.h>
138 #include <arpa/inet.h>
155 #if _WORDSIZE == 64 && !defined(__APPLE__)
160 #define FMT64U "%llu"
167 #define LLONG_MAX _I64_MAX
169 #define LLONG_MAX 9223372036854775807LL
175 #define LLONG_MIN _I64_MIN
177 #define LLONG_MIN (-LLONG_MAX - 1LL)
183 #define ULLONG_MAX _UI64_MAX
185 #define ULLONG_MAX 18446744073709551615ULL
190 #define O_LARGEFILE 0
193 #ifndef IPTOS_LOWDELAY
194 #define IPTOS_LOWDELAY 0x10
195 #define IPTOS_THROUGHPUT 0x08
196 #define IPTOS_RELIABILITY 0x04
198 #ifndef IPTOS_MINCOST
199 #define IPTOS_MINCOST 0x02
202 #define IPPROTO_SCTP 132
211 #define RAND_MAX 2147483647
219 #ifdef HAVE_GCC_FORMAT_CHECK
220 #define FORMAT_CHECK(f) __attribute__((format(printf,(f),(f)+1)))
222 #define FORMAT_CHECK(f)
225 #define YIGNORE(v) while (v) { break; }
227 #ifdef HAVE_BLOCK_RETURN
228 #define YSTRING(s) (*({static const String str("" s);&str;}))
229 #define YATOM(s) (*({static const String* str(0);str ? str : String::atom(str,"" s);}))
231 #define YSTRING(s) ("" s)
232 #define YATOM(s) ("" s)
235 #define YSTRING_INIT_HASH ((unsigned) -1)
258 DebugGoOn = DebugCrit,
287 YATE_API
bool debugAt(
int level);
318 : m_level(DebugFail), m_enabled(enabled), m_chain(0), m_name(0)
322 { m_name = 0; m_chain = 0; }
329 {
return m_chain ? m_chain->debugLevel() : m_level; }
343 {
return m_chain ? m_chain->debugEnabled() : m_enabled; }
350 { m_enabled = enable; m_chain = 0; }
371 {
return m_chain != 0; }
378 { m_chain = (chain !=
this) ? chain : 0; }
407 void DDebug(
int level,
const char* format, ...);
414 void DDebug(
const char* facility,
int level,
const char* format, ...);
421 void DDebug(
const DebugEnabler* local,
int level,
const char* format, ...);
428 void XDebug(
int level,
const char* format, ...);
435 void XDebug(
const char* facility,
int level,
const char* format, ...);
442 void XDebug(
const DebugEnabler* local,
int level,
const char* format, ...);
449 void NDebug(
int level,
const char* format, ...);
456 void NDebug(
const char* facility,
int level,
const char* format, ...);
463 void NDebug(
const DebugEnabler* local,
int level,
const char* format, ...);
466 #if defined(_DEBUG) || defined(DEBUG) || defined(XDEBUG)
475 #define DDebug do { break; } while
477 #define DDebug(arg...)
485 #define XDebug do { break; } while
487 #define XDebug(arg...)
495 #define NDebug do { break; } while
497 #define NDebug(arg...)
506 YATE_API
void Debug(
int level,
const char* format, ...) FORMAT_CHECK(2);
514 YATE_API
void Debug(const
char* facility,
int level, const
char* format, ...) FORMAT_CHECK(3);
522 YATE_API
void Debug(const DebugEnabler* local,
int level, const
char* format, ...) FORMAT_CHECK(3);
530 YATE_API
void Alarm(const
char* component,
int level, const
char* format, ...) FORMAT_CHECK(3);
538 YATE_API
void Alarm(const DebugEnabler* component,
int level, const
char* format, ...) FORMAT_CHECK(3);
547 YATE_API
void Alarm(const
char* component, const
char* info,
int level, const
char* format, ...) FORMAT_CHECK(4);
556 YATE_API
void Alarm(const DebugEnabler* component, const
char* info,
int level, const
char* format, ...) FORMAT_CHECK(4);
562 YATE_API
void Output(const
char* format, ...) FORMAT_CHECK(1);
591 explicit Debugger(
const char* name,
const char* format = 0, ...);
599 Debugger(
int level,
const char* name,
const char* format = 0, ...);
610 static void setOutput(
void (*outFunc)(
const char*,
int) = 0);
616 static void setIntOut(
void (*outFunc)(
const char*,
int) = 0);
622 static void setAlarmHook(
void (*alarmFunc)(
const char*,
int,
const char*,
const char*) = 0);
628 static void setRelayHook(
void (*relayFunc)(
int,
const char*,
const char*,
const char*) = 0);
635 static void enableOutput(
bool enable =
true,
bool colorize =
false);
641 static uint32_t getStartTimeSec();
647 static Formatting getFormatting();
654 static void setFormatting(Formatting format, uint32_t startTimeSec = 0);
662 static unsigned int formatTime(
char* buf, Formatting format = getFormatting());
672 static void relayOutput(
int level,
char* buffer,
const char* component = 0,
const char* info = 0);
712 constant
YSTRING(
const char*
string);
719 constant
YATOM(
const char*
string);
726 void YCLASS(
class type,
class base);
734 void YCLASS2(
class type,
class base1,
class base2);
743 void YCLASS3(
class type,
class base1,
class base2,
class base3);
758 void YCLASSIMP2(
class type,
class base1,
class base2);
767 void YCLASSIMP3(
class type,
class base1,
class base2,
class base3);
784 #define YCLASS(type,base) \
785 public: virtual void* getObject(const String& name) const \
786 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); }
788 #define YCLASS2(type,base1,base2) \
789 public: virtual void* getObject(const String& name) const \
790 { if (name == YATOM(#type)) return const_cast<type*>(this); \
791 void* tmp = base1::getObject(name); \
792 return tmp ? tmp : base2::getObject(name); }
794 #define YCLASS3(type,base1,base2,base3) \
795 public: virtual void* getObject(const String& name) const \
796 { if (name == YATOM(#type)) return const_cast<type*>(this); \
797 void* tmp = base1::getObject(name); \
798 if (tmp) return tmp; \
799 tmp = base2::getObject(name); \
800 return tmp ? tmp : base3::getObject(name); }
802 #define YCLASSIMP(type,base) \
803 void* type::getObject(const String& name) const \
804 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); }
806 #define YCLASSIMP2(type,base1,base2) \
807 void* type::getObject(const String& name) const \
808 { if (name == YATOM(#type)) return const_cast<type*>(this); \
809 void* tmp = base1::getObject(name); \
810 return tmp ? tmp : base2::getObject(name); }
812 #define YCLASSIMP3(type,base1,base2,base3) \
813 void* type::getObject(const String& name) const \
814 { if (name == YATOM(#type)) return const_cast<type*>(this); \
815 void* tmp = base1::getObject(name); \
816 if (tmp) return tmp; \
817 tmp = base2::getObject(name); \
818 return tmp ? tmp : base3::getObject(name); }
820 #define YOBJECT(type,pntr) (static_cast<type*>(GenObject::getObject(YATOM(#type),pntr)))
822 #define YNOCOPY(type) private: \
824 void operator=(const type&)
850 virtual bool alive()
const;
863 virtual const String& toString()
const;
870 virtual void* getObject(
const String& name)
const;
879 {
return obj ? obj->
getObject(name) : 0; }
886 {
return s_counting; }
893 { s_counting = enable; }
900 {
return m_counter; }
921 static ObjList& getObjCounters();
925 static bool s_counting;
943 {
if (obj) { obj->destruct(); obj = 0; } }
969 virtual void* getObject(
const String& name)
const;
977 virtual bool alive()
const;
1000 {
return m_refcount; }
1014 {
return obj && (obj->
refcount() > 0); }
1021 static bool efficientIncDec();
1029 virtual void zeroRefs();
1043 virtual void destroyed();
1089 {
return static_cast<Obj*
>(
m_pointer); }
1136 {
assign(
object);
return *
this; }
1142 inline operator Obj*()
const
1197 { m_pointer = value;
return *
this; }
1203 { m_pointer = object;
return *
this; }
1209 inline operator Obj*()
const
1210 {
return m_pointer; }
1216 {
return m_pointer; }
1222 {
return *m_pointer; }
1248 virtual void* getObject(
const String& name)
const;
1254 unsigned int length()
const;
1260 unsigned int count()
const;
1322 {
return at(index); }
1330 {
return at(index); }
1365 int index(
const String& str)
const;
1429 {
return m_delete; }
1436 { m_delete = autodelete; }
1442 static const ObjList& empty();
1456 void sort(
int (*callbackCompare)(
GenObject* obj1,
GenObject* obj2,
void* context),
void* context = 0);
1476 : m_length(0), m_objects(0), m_delete(autodelete)
1484 ObjVector(
unsigned int maxLen,
bool autodelete =
true);
1493 ObjVector(
ObjList& list,
bool move =
true,
unsigned int maxLen = 0,
bool autodelete =
true);
1505 virtual void* getObject(
const String& name)
const;
1512 {
return m_length; }
1518 unsigned int count()
const;
1532 {
return (index >= 0 && index < (
int)m_length) ? m_objects[index] : 0; }
1540 {
return at(index); }
1548 {
return at(index); }
1557 unsigned int assign(
ObjList& list,
bool move =
true,
unsigned int maxLen = 0);
1572 bool set(
GenObject* obj,
unsigned int index);
1586 int index(
const String& str)
const;
1598 {
return m_delete; }
1605 { m_delete = autodelete; }
1608 unsigned int m_length;
1629 explicit Array(
int columns = 0,
int rows = 0);
1641 virtual void* getObject(
const String& name)
const;
1649 bool addRow(
ObjList* row = 0,
int index = -1);
1657 bool addColumn(
ObjList* column = 0,
int index = -1);
1664 bool delRow(
int index);
1671 bool delColumn(
int index);
1679 GenObject*
get(
int column,
int row)
const;
1696 bool set(
GenObject* obj,
int column,
int row);
1710 {
return m_columns; }
1720 if (column >= 0 || column < m_columns)
1721 return static_cast<ObjList*
>(m_obj[column]);
1732 class StringMatchPrivate;
1745 inline explicit UChar(uint32_t code = 0)
1754 : m_chr((code < 0) ? 0 : code)
1762 : m_chr((unsigned char)code)
1769 inline explicit UChar(
unsigned char code)
1779 { m_chr = code; encode();
return *
this; }
1787 { m_chr = (
unsigned char)code; encode();
return *
this; }
1807 inline operator const char*()
const
1817 bool decode(
const char*& str, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
1851 String(
const char* value,
int len = -1);
1858 explicit String(
char value,
unsigned int repeat = 1);
1864 explicit String(int32_t value);
1870 explicit String(uint32_t value);
1876 explicit String(int64_t value);
1882 explicit String(uint64_t value);
1888 explicit String(
bool value);
1894 explicit String(
double value);
1918 virtual void* getObject(
const String& name)
const;
1924 static const String& empty();
1932 {
return value ?
"true" :
"false"; }
1939 {
return m_string; }
1946 {
return m_string ? m_string :
""; }
1953 inline const char*
safe(
const char* defStr)
const
1954 {
return m_string ? m_string : (defStr ? defStr :
""); }
1961 {
return m_length; }
1968 {
return !m_string; }
1977 static int lenUtf8(
const char* value, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
1985 inline int lenUtf8(uint32_t maxChar = 0x10ffff,
bool overlong =
false)
const
1986 {
return lenUtf8(m_string,maxChar,overlong); }
1996 int fixUtf8(
const char* replace = 0, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
2004 {
return str && (str[0] ==
'\357') && (str[1] ==
'\273') && (str[2] ==
'\277'); }
2011 {
return checkBOM(
c_str()); }
2019 {
return checkBOM(str) && (str += 3); }
2027 {
return checkBOM(str) && (str += 3); }
2034 {
return checkBOM(
c_str()) && &(*
this =
c_str() + 3); }
2042 if (m_hash == YSTRING_INIT_HASH)
2043 m_hash = hash(m_string);
2053 static unsigned int hash(
const char* value,
unsigned int h = 0);
2065 char at(
int index)
const;
2073 String substr(
int offs,
int len = -1)
const;
2090 virtual const String& toString()
const;
2102 int toInteger(
int defvalue = 0,
int base = 0,
int minvalue = INT_MIN,
2103 int maxvalue = INT_MAX,
bool clamp =
true)
const;
2112 int toInteger(
const TokenDict* tokens,
int defvalue = 0,
int base = 0)
const;
2124 long int toLong(
long int defvalue = 0,
int base = 0,
long int minvalue = LONG_MIN,
2125 long int maxvalue = LONG_MAX,
bool clamp =
true)
const;
2137 int64_t toInt64(int64_t defvalue = 0,
int base = 0, int64_t minvalue = LLONG_MIN,
2138 int64_t maxvalue = LLONG_MAX,
bool clamp =
true)
const;
2145 double toDouble(
double defvalue = 0.0)
const;
2152 bool toBoolean(
bool defvalue =
false)
const;
2158 bool isBoolean()
const;
2178 {
return at(index); }
2186 {
return at(index); }
2192 inline operator const char*()
const
2193 {
return m_string; };
2201 String& assign(
const char* value,
int len = -1);
2209 String& assign(
char value,
unsigned int repeat = 1);
2219 String& hexify(
void* data,
unsigned int len,
char sep = 0,
bool upCase =
false);
2226 {
return operator=(value.
c_str()); }
2234 {
return operator=(value ? value->
c_str() :
""); }
2241 String& operator=(
const char* value);
2247 String& operator=(
char value);
2253 String& operator=(int32_t value);
2259 String& operator=(uint32_t value);
2265 String& operator=(int64_t value);
2271 String& operator=(uint64_t value);
2278 {
return operator=(boolText(value)); }
2284 String& operator=(
double value);
2292 {
return append(value,-1); }
2298 String& operator+=(
char value);
2304 String& operator+=(int32_t value);
2310 String& operator+=(uint32_t value);
2316 String& operator+=(int64_t value);
2322 String& operator+=(uint64_t value);
2329 {
return operator+=(boolText(value)); }
2335 String& operator+=(
double value);
2340 bool operator==(
const char* value)
const;
2345 bool operator!=(
const char* value)
const;
2351 {
return (
this == &value) || ((hash() == value.
hash()) &&
operator==(value.
c_str())); }
2357 {
return (
this != &value) && ((hash() != value.
hash()) ||
operator!=(value.
c_str())); }
2362 bool operator&=(
const char* value)
const;
2367 bool operator|=(
const char* value)
const;
2373 {
return operator+=(value); }
2379 {
return operator+=(value); }
2385 {
return operator+=(value); }
2391 {
return operator+=(value); }
2397 {
return operator+=(value); }
2403 {
return operator+=(value); }
2409 {
return operator+=(value); }
2415 {
return operator+=(value); }
2421 String& operator>>(
const char* skip);
2426 String& operator>>(
char& store);
2436 String& operator>>(
int& store);
2441 String& operator>>(
unsigned int& store);
2446 String& operator>>(
bool& store);
2454 String& append(
const char* value,
int len);
2462 String& append(
const char* value,
const char* separator = 0,
bool force =
false);
2470 String& append(
const ObjList* list,
const char* separator = 0,
bool force =
false);
2479 {
return append(&list,separator,force); }
2486 String& append(
double value,
unsigned int decimals = 3);
2493 String& printf(
const char* format, ...) FORMAT_CHECK(2);
2500 String& printf(
unsigned int length, const
char* format, ...) FORMAT_CHECK(3);
2510 String& appendFixed(
unsigned int fixedLength, const
char* str,
unsigned int len = -1,
char fill = ' ',
int align = Left);
2519 inline
String& appendFixed(
unsigned int fixedLength, const
String& str,
char fill = ' ',
int align = Left)
2520 {
return appendFixed(fixedLength,str.c_str(),str.length(),fill,align); }
2528 int find(
char what,
unsigned int offs = 0)
const;
2536 int find(
const char* what,
unsigned int offs = 0)
const;
2543 int rfind(
char what)
const;
2550 int rfind(
const char* what)
const;
2559 bool startsWith(
const char* what,
bool wordBreak =
false,
bool caseInsensitive =
false)
const;
2568 bool endsWith(
const char* what,
bool wordBreak =
false,
bool caseInsensitive =
false)
const;
2581 bool startSkip(
const char* what,
bool wordBreak =
true,
bool caseInsensitive =
false);
2597 String& extractTo(
const char* sep,
bool& store);
2606 String& extractTo(
const char* sep,
int& store,
int base = 0);
2616 String& extractTo(
const char* sep,
int& store,
const TokenDict* tokens,
int base = 0);
2624 String& extractTo(
const char* sep,
double& store);
2632 {
return operator==(value); }
2639 bool matches(
const Regexp& rexp);
2646 int matchOffset(
int index = 0)
const;
2653 int matchLength(
int index = 0)
const;
2661 {
return substr(matchOffset(index),matchLength(index)); }
2674 int matchCount()
const;
2682 ObjList* split(
char separator,
bool emptyOK =
true)
const;
2690 static String msgEscape(
const char* str,
char extraEsc = 0);
2698 {
return msgEscape(
c_str(),extraEsc); }
2707 static String msgUnescape(
const char* str,
int* errptr = 0,
char extraEsc = 0);
2716 {
return msgUnescape(
c_str(),errptr,extraEsc); }
2724 static String sqlEscape(
const char* str,
char extraEsc = 0);
2732 {
return sqlEscape(
c_str(),extraEsc); }
2741 static String uriEscape(
const char* str,
char extraEsc = 0,
const char* noEsc = 0);
2750 static String uriEscape(
const char* str,
const char* extraEsc,
const char* noEsc = 0);
2759 {
return uriEscape(
c_str(),extraEsc,noEsc); }
2767 static String uriUnescape(
const char* str,
int* errptr = 0);
2775 {
return uriUnescape(
c_str(),errptr); }
2783 static const String* atom(
const String*& str,
const char* val);
2789 virtual void changed();
2792 void clearMatches();
2794 unsigned int m_length;
2796 mutable unsigned int m_hash;
2797 StringMatchPrivate* m_matches;
2806 {
return str ? str->
c_str() : (
const char*)0; }
2814 {
return str ? str :
""; }
2822 {
return str ? str->
safe() :
""; }
2830 {
return !(str && *str); }
2838 {
return !str || str->
null(); }
2843 YATE_API String
operator+(
const String& s1,
const String& s2);
2848 YATE_API String
operator+(
const String& s1,
const char* s2);
2853 YATE_API String
operator+(
const char* s1,
const String& s2);
2860 { dest = src;
return dest.
c_str(); }
2867 { dest += src;
return dest.
c_str(); }
2877 YATE_API
int lookup(
const char* str,
const TokenDict* tokens,
int defvalue = 0,
int base = 0);
2885 YATE_API
const char*
lookup(
int value,
const TokenDict* tokens,
const char* defvalue = 0);
2896 YATE_API
bool controlReturn(NamedList* params,
bool ret,
const char* retVal = 0);
2917 explicit Regexp(
const char* value,
bool extended =
false,
bool insensitive =
false);
2941 {
return m_regexp || (m_compile && doCompile()); }
2948 bool matches(
const char* value)
const;
2963 void setFlags(
bool extended,
bool insensitive);
2969 bool isExtended()
const;
2975 bool isCaseInsensitive()
const;
2981 virtual void changed();
2987 bool doCompile()
const;
2991 bool matches(
const char* value, StringMatchPrivate* matchlist)
const;
2992 mutable void* m_regexp;
2993 mutable bool m_compile;
3008 inline explicit Atom(
const char* value)
3045 :
String(text), m_level(level)
3053 :
String(original), m_level(original.level())
3069 {
return s_capturing; }
3076 {
return s_events; }
3083 inline static void append(
int level,
const char* text)
3084 {
if (text && *text) s_events.append(
new CapturedEvent(level,text)); }
3092 {
return s_events; }
3099 { s_capturing = capture; }
3104 static bool s_capturing;
3120 explicit NamedString(
const char* name,
const char* value = 0);
3133 virtual const String& toString()
const;
3140 virtual void* getObject(
const String& name)
const;
3202 {
return m_data ? m_data->getObject(name) : 0; }
3215 virtual void* getObject(
const String& name)
const;
3221 virtual void changed();
3247 {
return m_enabled; }
3254 { m_enabled = val; }
3296 explicit HashList(
unsigned int size = 17);
3308 virtual void* getObject(
const String& name)
const;
3321 unsigned int count()
const;
3330 {
return (index < m_size) ? m_lists[index] : 0; }
3338 {
return getList(hash % m_size); }
3346 {
return getHashList(str.
hash()); }
3403 return n ? n->
remove(delobj) : 0;
3427 unsigned int m_size;
3467 {
return m_length; }
3479 void assign(
ObjList& list,
int offset = 0);
3486 void assign(
HashList& list,
int offset = 0);
3494 GenObject*
get(
unsigned int index)
const;
3515 {
return m_current >= m_length; }
3527 unsigned int* m_hashes;
3528 unsigned int m_length;
3529 unsigned int m_current;
3558 inline explicit Time(
const struct timeval* tv)
3559 : m_time(fromTimeval(tv))
3566 inline explicit Time(
const struct timeval& tv)
3567 : m_time(fromTimeval(tv))
3582 {
return (u_int32_t)((m_time+500000) / 1000000); }
3589 {
return (m_time+500) / 1000; }
3601 inline operator u_int64_t()
const
3608 { m_time = usec;
return *
this; }
3614 { m_time += delta;
return *
this; }
3620 { m_time -= delta;
return *
this; }
3627 { toTimeval(tv, m_time); }
3634 static void toTimeval(
struct timeval* tv, u_int64_t usec);
3641 static u_int64_t fromTimeval(
const struct timeval* tv);
3649 {
return fromTimeval(&tv); }
3655 static u_int64_t now();
3661 static u_int64_t msecNow();
3667 static u_int32_t secNow();
3682 static unsigned int toEpoch(
int year,
unsigned int month,
unsigned int day,
3683 unsigned int hour,
unsigned int minute,
unsigned int sec,
int offset = 0);
3697 static bool toDateTime(
unsigned int epochTimeSec,
int& year,
unsigned int& month,
3698 unsigned int& day,
unsigned int& hour,
unsigned int& minute,
unsigned int& sec,
3699 unsigned int* wDay = 0);
3707 {
return (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)); }
3713 static int timeZone();
3738 inline u_int32_t
get()
const
3739 {
return m_random; }
3745 inline void set(u_int32_t seed)
3746 { m_random = seed; }
3758 static long int random();
3764 static void srandom(
unsigned int seed);
3804 DataBlock(
void* value,
unsigned int len,
bool copyData =
true,
unsigned int overAlloc = 0);
3816 virtual void* getObject(
const String& name)
const;
3836 inline unsigned char*
data(
unsigned int offs,
unsigned int len = 1)
const
3837 {
return (offs + len <= m_length) ? (
static_cast<unsigned char*
>(m_data) + offs) : 0; }
3845 inline int at(
unsigned int offs,
int defvalue = -1)
const
3846 {
return (offs < m_length) ?
static_cast<unsigned char*
>(m_data)[offs] : defvalue; }
3860 {
return m_length; }
3867 {
return m_overAlloc; }
3874 { m_overAlloc = bytes; }
3880 void clear(
bool deleteData =
true);
3889 DataBlock& assign(
void* value,
unsigned int len,
bool copyData =
true,
unsigned int allocated = 0);
3896 inline void append(
void* value,
unsigned int len) {
3912 void append(
const String& value);
3925 if (len != length())
3933 void truncate(
unsigned int len);
3947 {
return at(index); }
3955 {
return at(index); }
3966 { append(value);
return *
this; }
3972 { append(value);
return *
this; }
3983 const String& dFormat,
unsigned maxlen = 0);
3995 bool unHexify(
const char* data,
unsigned int len,
char sep);
4006 bool unHexify(
const char* data,
unsigned int len);
4022 String sqlEscape(
char extraEsc)
const;
4025 unsigned int allocLen(
unsigned int len)
const;
4027 unsigned int m_length;
4028 unsigned int m_allocated;
4029 unsigned int m_overAlloc;
4047 virtual void clear() = 0;
4053 virtual void finalize() = 0;
4060 virtual const unsigned char* rawDigest() = 0;
4068 { finalize();
return m_hex; }
4076 inline bool update(
const void* buf,
unsigned int len)
4077 {
return updateInternal(buf,len); }
4085 {
return updateInternal(data.
data(), data.
length()); }
4093 {
return updateInternal(str.
c_str(), str.
length()); }
4100 { update(value);
return *
this; }
4107 { update(data);
return *
this; }
4122 bool hmacStart(
DataBlock& opad,
const void* key,
unsigned int keyLen);
4131 {
return hmacStart(opad,key.
data(),key.
length()); }
4140 {
return hmacStart(opad,key.
c_str(),key.
length()); }
4157 bool hmac(
const void* key,
unsigned int keyLen,
const void* msg,
unsigned int msgLen);
4181 virtual unsigned int hashLength()
const = 0;
4187 virtual unsigned int hmacBlockSize()
const;
4203 virtual bool updateInternal(
const void* buf,
unsigned int len) = 0;
4225 MD5(
const MD5& original);
4232 MD5(
const void* buf,
unsigned int len);
4249 MD5& operator=(
const MD5& original);
4259 virtual void clear();
4265 virtual void finalize();
4272 virtual const unsigned char* rawDigest();
4289 bool updateInternal(
const void* buf,
unsigned int len);
4293 unsigned char m_bin[16];
4319 SHA1(
const void* buf,
unsigned int len);
4336 SHA1& operator=(
const SHA1& original);
4346 virtual void clear();
4352 virtual void finalize();
4359 virtual const unsigned char* rawDigest();
4386 bool updateInternal(
const void* buf,
unsigned int len);
4390 unsigned char m_bin[20];
4416 SHA256(
const void* buf,
unsigned int len);
4443 virtual void clear();
4449 virtual void finalize();
4456 virtual const unsigned char* rawDigest();
4473 bool updateInternal(
const void* buf,
unsigned int len);
4477 unsigned char m_bin[32];
4500 inline Base64(
void* src,
unsigned int len,
bool copyData =
true)
4513 void encode(
String& dest,
unsigned int lineLen = 0,
bool lineAtEnd =
false);
4526 bool decode(
DataBlock& dest,
bool liberal =
true);
4532 { append(value);
return *
this; }
4538 { append(data);
return *
this; }
4547 class NamedIterator;
4589 virtual void* getObject(
const String& name)
const;
4596 {
return m_params.length(); }
4603 {
return m_params.count(); }
4609 { m_params.clear(); }
4625 NamedList& addParam(
const char* name,
const char* value,
bool emptyOK =
true);
4635 m_params.setUnique(param);
4706 bool skipPrefix =
true,
bool replace =
false);
4713 bool hasSubParams(
const char* prefix)
const;
4727 int getIndex(
const String& name)
const;
4756 const char* getValue(
const String& name,
const char* defvalue = 0)
const;
4768 int getIntValue(
const String& name,
int defvalue = 0,
int minvalue = INT_MIN,
4769 int maxvalue = INT_MAX,
bool clamp =
true)
const;
4778 int getIntValue(
const String& name,
const TokenDict* tokens,
int defvalue = 0)
const;
4790 int64_t getInt64Value(
const String& name, int64_t defvalue = 0, int64_t minvalue = LLONG_MIN,
4791 int64_t maxvalue = LLONG_MAX,
bool clamp =
true)
const;
4799 double getDoubleValue(
const String& name,
double defvalue = 0.0)
const;
4807 bool getBoolValue(
const String& name,
bool defvalue =
false)
const;
4816 int replaceParams(
String& str,
bool sqlEsc =
false,
char extraEsc = 0)
const;
4826 void dump(
String& str,
const char* separator,
char quote = 0,
bool force =
false)
const;
4839 {
return &m_params; }
4846 {
return &m_params; }
4866 : m_list(&list), m_item(list.m_params.skipNull())
4874 : m_list(original.m_list), m_item(original.m_item)
4882 { m_list = &list; m_item = list.m_params.
skipNull();
return *
this; }
4889 { m_list = original.m_list; m_item = original.m_item;
return *
this; }
4907 { m_item = m_list->m_params.skipNull(); }
4944 explicit URI(
const char* uri);
4954 URI(
const char* proto,
const char* user,
const char* host,
int port = 0,
const char* desc = 0);
4987 { parse();
return m_desc; }
4994 { parse();
return m_proto; }
5001 { parse();
return m_user; }
5008 { parse();
return m_host; }
5015 { parse();
return m_port; }
5022 { parse();
return m_extra; }
5030 virtual void changed();
5031 mutable bool m_parsed;
5041 class SemaphorePrivate;
5042 class ThreadPrivate;
5061 virtual bool lock(
long maxwait = -1) = 0;
5067 virtual bool unlock() = 0;
5074 virtual bool locked()
const = 0;
5081 virtual bool check(
long maxwait = -1);
5089 virtual bool unlockAll();
5096 static void wait(
unsigned long maxwait);
5102 static unsigned long wait();
5110 static void startUsingNow();
5118 static void enableSafety(
bool safe =
true);
5124 static bool safety();
5133 friend class MutexPrivate;
5141 explicit Mutex(
bool recursive =
false,
const char* name = 0);
5165 virtual bool lock(
long maxwait = -1);
5171 virtual bool unlock();
5178 virtual bool locked()
const;
5184 const char* owner()
const;
5190 bool recursive()
const;
5208 static bool efficientTimedLock();
5211 MutexPrivate* privDataCopy()
const;
5212 MutexPrivate* m_private;
5234 MutexPool(
unsigned int len = 13,
bool recursive =
false,
const char* name = 0);
5248 inline unsigned int index(
void* ptr)
const
5249 {
return ((
unsigned int)(
unsigned long)ptr) % m_length; }
5259 {
return m_data[index(ptr)]; }
5267 {
return m_data[idx % m_length]; }
5272 unsigned int m_length;
5281 friend class SemaphorePrivate;
5289 explicit Semaphore(
unsigned int maxcount = 1,
const char* name = 0,
5290 unsigned int initialCount = 1);
5314 virtual bool lock(
long maxwait = -1);
5320 virtual bool unlock();
5327 virtual bool locked()
const;
5345 static bool efficientTimedLock();
5348 SemaphorePrivate* privDataCopy()
const;
5349 SemaphorePrivate* m_private;
5367 { m_lock = lck.
lock(maxwait) ? &lck : 0; }
5375 { m_lock = (lck && lck->
lock(maxwait)) ? lck : 0; }
5381 {
if (m_lock) m_lock->unlock(); }
5394 {
if (m_lock) m_lock->unlock(); m_lock = 0; }
5403 {
return (lck && (lck == m_lock)) ||
5404 (drop(),(lck && (m_lock = lck->
lock(maxwait) ? lck : 0))); }
5413 {
return acquire(&lck,maxwait); }
5419 inline void*
operator new(size_t);
5422 inline void*
operator new[](size_t);
5442 : m_mx1(0), m_mx2(0)
5443 { lock(mx1,mx2,maxwait); }
5452 : m_mx1(0), m_mx2(0)
5453 { lock(&mx1,&mx2,maxwait); }
5466 {
return m_mx1 != 0; }
5475 bool lock(
Mutex* mx1,
Mutex* mx2,
long maxwait = -1);
5485 {
return lock(&mx1,&mx2,maxwait); }
5497 inline void*
operator new(size_t);
5500 inline void*
operator new[](size_t);
5515 virtual void run() = 0;
5531 friend class ThreadPrivate;
5532 friend class MutexPrivate;
5533 friend class SemaphorePrivate;
5550 virtual void cleanup();
5568 bool running()
const;
5582 {
return m_locking || m_locks; }
5588 const char* name()
const;
5594 static const char* currentName();
5601 static void yield(
bool exitCheck =
false);
5608 static void idle(
bool exitCheck =
false);
5615 static void sleep(
unsigned int sec,
bool exitCheck =
false);
5622 static void msleep(
unsigned long msec,
bool exitCheck =
false);
5630 static void usleep(
unsigned long usec,
bool exitCheck =
false);
5636 static unsigned long idleUsec();
5642 static unsigned long idleMsec();
5648 static void idleMsec(
unsigned long msec);
5655 static Thread* current();
5668 static bool check(
bool exitNow =
true);
5679 void cancel(
bool hard =
false);
5686 {
return current() ==
this; }
5706 static NamedCounter* getCurrentObjCounter(
bool always =
false);
5721 static Priority priority(
const char* name, Priority defvalue = Normal);
5728 static const char* priority(Priority prio);
5734 static void killall();
5740 static void preExec();
5747 static int lastError();
5756 {
return errorString(buffer,lastError()); }
5768 static bool errorString(
String& buffer,
int code);
5776 Thread(
const char *name = 0, Priority prio = Normal);
5783 Thread(
const char *name,
const char* prio);
5791 ThreadPrivate* m_private;
5810 : m_saved(0), m_enabled(enable)
5819 : m_saved(0), m_enabled(enable && obj)
5828 : m_saved(0), m_enabled(enable)
5856 Unknown = AF_UNSPEC,
5859 AfUnsupported = AfMax,
5863 IPv6 = AfUnsupported + 1,
5868 Unix = AfUnsupported + 2,
5876 : m_address(0), m_length(0)
5885 m_address(0), m_length(0)
5893 explicit SocketAddr(
int family,
const void* raw = 0);
5900 SocketAddr(
const struct sockaddr* addr, socklen_t len = 0);
5919 bool operator==(
const SocketAddr& other)
const;
5927 {
return !operator==(other); }
5939 bool assign(
int family);
5946 void assign(
const struct sockaddr* addr, socklen_t len = 0);
5967 {
return m_length && m_address; }
5974 {
return !(m_length && m_address); }
5981 {
return m_address ? m_address->sa_family : 0; }
5988 {
return lookupFamily(family()); }
5995 {
return scopeId(address()); }
6003 {
return scopeId(address(),val); }
6028 virtual bool host(
const String& name);
6041 bool port(
int newport);
6048 {
return m_address; }
6055 {
return m_length; }
6062 {
return isNullAddr(m_host,family()); }
6076 static bool supports(
int family);
6083 static int family(
const String& addr);
6091 static bool stringify(
String& buf,
struct sockaddr* addr);
6102 int family = Unknown) {
6104 return sa.
host(host) ? copyAddr(buf,sa.
address()) : Unknown;
6114 static int copyAddr(uint8_t* buf,
struct sockaddr* addr);
6121 static inline unsigned int scopeId(
struct sockaddr* addr) {
6123 if (addr && addr->sa_family == AF_INET6)
6124 return ((
struct sockaddr_in6*)addr)->sin6_scope_id;
6135 static inline bool scopeId(
struct sockaddr* addr,
unsigned int val) {
6137 if (addr && addr->sa_family == AF_INET6) {
6138 ((
struct sockaddr_in6*)addr)->sin6_scope_id = val;
6163 int family = Unknown) {
6164 appendAddr(buf,addr,family) <<
":" << port;
6177 appendTo(buf,addr,port,family);
6187 static bool isNullAddr(
const String& addr,
int family = Unknown);
6210 static void split(
const String& buf,
String& addr,
int& port,
bool portPresent =
false);
6218 {
return lookup(family,s_familyName); }
6224 static const String& ipv4NullAddr();
6230 static const String& ipv6NullAddr();
6236 static const TokenDict* dictFamilyName();
6242 virtual void stringify();
6247 virtual void updateAddr()
const;
6249 struct sockaddr* m_address;
6282 virtual void* getObject(
const String& name)
const;
6288 virtual void timerTick(
const Time& when);
6299 virtual bool received(
void* buffer,
int length,
int flags,
const struct sockaddr* addr, socklen_t adrlen) = 0;
6306 {
return m_socket; }
6350 virtual bool terminate() = 0;
6356 virtual bool canRetry()
const;
6362 virtual bool inProgress()
const;
6368 virtual bool valid()
const = 0;
6375 virtual bool setBlocking(
bool block =
true);
6383 virtual int writeData(
const void* buffer,
int length) = 0;
6390 int writeData(
const char* str);
6406 {
return writeData(buf.
data(), buf.
length()); }
6414 virtual int readData(
void* buffer,
int length) = 0;
6420 virtual int64_t length();
6428 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6435 inline int64_t
seek(int64_t offset)
6436 {
return seek(SeekBegin,offset); }
6444 static bool allocPipe(
Stream*& reader,
Stream*& writer);
6458 static bool supportsPipes();
6464 static bool supportsPairs();
6503 : m_data(data), m_offset(0)
6532 virtual int writeData(
const void* buffer,
int len);
6540 virtual int readData(
void* buffer,
int len);
6547 {
return m_data.length(); }
6555 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6586 explicit File(HANDLE handle);
6605 virtual bool openPath(
const char* name,
bool canWrite =
false,
bool canRead =
true,
6606 bool create =
false,
bool append =
false,
bool binary =
false,
6607 bool pubReadable =
false,
bool pubWritable =
false);
6613 virtual bool terminate();
6619 void attach(HANDLE handle);
6632 {
return m_handle; }
6638 virtual bool canRetry()
const;
6644 virtual bool valid()
const;
6650 static HANDLE invalidHandle();
6657 virtual bool setBlocking(
bool block =
true);
6663 virtual int64_t length();
6671 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6679 virtual int writeData(
const void* buffer,
int length);
6687 virtual int readData(
void* buffer,
int length);
6694 bool getFileTime(
unsigned int& secEpoch);
6702 virtual bool md5(
String& buffer);
6711 static bool setFileTime(
const char* name,
unsigned int secEpoch,
int* error = 0);
6720 static bool getFileTime(
const char* name,
unsigned int& secEpoch,
int* error = 0);
6728 static bool exists(
const char* name,
int* error = 0);
6737 static bool rename(
const char* oldFile,
const char* newFile,
int* error = 0);
6745 static bool remove(
const char* name,
int* error = 0);
6754 static bool md5(
const char* name,
String& buffer,
int* error = 0);
6763 static bool mkDir(
const char* path,
int* error = 0,
int mode = -1);
6771 static bool rmDir(
const char* path,
int* error = 0);
6784 static bool listDirectory(
const char* path,
ObjList* dirs,
ObjList* files,
6793 static bool createPipe(
File& reader,
File& writer);
6818 LowDelay = IPTOS_LOWDELAY,
6819 MaxThroughput = IPTOS_THROUGHPUT,
6820 MaxReliability = IPTOS_RELIABILITY,
6821 MinCost = IPTOS_MINCOST,
6852 ExpeditedFwd = 0xb8,
6865 explicit Socket(SOCKET handle);
6873 Socket(
int domain,
int type,
int protocol = 0);
6887 virtual bool create(
int domain,
int type,
int protocol = 0);
6893 virtual bool terminate();
6899 void attach(SOCKET handle);
6912 {
return m_handle; }
6918 virtual bool canRetry()
const;
6924 virtual bool inProgress()
const;
6930 virtual bool valid()
const;
6936 static SOCKET invalidHandle();
6942 static int socketError();
6958 virtual bool setOption(
int level,
int name,
const void* value = 0, socklen_t length = 0);
6969 #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
6970 int value = on ? 1 : 0;
6971 return setOption(IPPROTO_IPV6,IPV6_V6ONLY,&value,
sizeof(value));
6985 virtual bool getOption(
int level,
int name,
void* buffer, socklen_t* length);
7008 virtual bool setTOS(
int tos);
7016 inline bool setTOS(
const char* tos,
int defTos = Normal)
7017 {
return setTOS(
lookup(tos,tosValues(),defTos)); }
7023 virtual int getTOS();
7030 virtual bool setBlocking(
bool block =
true);
7039 virtual bool setReuse(
bool reuse =
true,
bool exclusive =
false);
7047 virtual bool setLinger(
int seconds = -1);
7055 virtual bool bind(
struct sockaddr* addr, socklen_t addrlen);
7070 virtual bool listen(
unsigned int backlog = 0);
7078 virtual Socket* accept(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
7093 SOCKET acceptHandle(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
7108 static bool efficientSelect();
7115 static bool canSelect(SOCKET handle);
7121 virtual bool canSelect()
const;
7129 virtual bool connect(
struct sockaddr* addr, socklen_t addrlen);
7148 virtual bool connectAsync(
struct sockaddr* addr, socklen_t addrlen,
unsigned int toutUs,
7161 {
return connectAsync(addr.
address(),addr.
length(),toutUs,timeout); }
7169 virtual bool shutdown(
bool stopReads,
bool stopWrites);
7177 virtual bool getSockName(
struct sockaddr* addr, socklen_t* addrlen);
7192 virtual bool getPeerName(
struct sockaddr* addr, socklen_t* addrlen);
7210 virtual int sendTo(
const void* buffer,
int length,
const struct sockaddr* addr, socklen_t adrlen,
int flags = 0);
7221 {
return sendTo(buffer, length, addr.
address(), addr.
length(), flags); }
7230 virtual int send(
const void* buffer,
int length,
int flags = 0);
7238 virtual int writeData(
const void* buffer,
int length);
7249 virtual int recvFrom(
void* buffer,
int length,
struct sockaddr* addr = 0, socklen_t* adrlen = 0,
int flags = 0);
7259 int recvFrom(
void* buffer,
int length,
SocketAddr& addr,
int flags = 0);
7268 virtual int recv(
void* buffer,
int length,
int flags = 0);
7276 virtual int readData(
void* buffer,
int length);
7286 virtual bool select(
bool* readok,
bool* writeok,
bool* except,
struct timeval* timeout = 0);
7296 bool select(
bool* readok,
bool* writeok,
bool* except, int64_t timeout);
7310 void removeFilter(
SocketFilter* filter,
bool delobj =
false);
7315 void clearFilters();
7323 virtual void timerTick(
const Time& when);
7332 static bool createPair(
Socket& sock1,
Socket& sock2,
int domain = AF_UNIX);
7347 bool checkError(
int retcode,
bool strict =
false);
7358 bool applyFilters(
void* buffer,
int length,
int flags,
const struct sockaddr* addr = 0, socklen_t adrlen = 0);
7396 virtual bool bindx(
ObjList& addresses) = 0;
7403 virtual bool connectx(
ObjList& addresses) = 0;
7414 virtual int sendTo(
void* buffer,
int length,
int stream,
SocketAddr& addr,
int flags) = 0;
7432 virtual int sendMsg(
const void* buf,
int length,
int stream,
int& flags) = 0;
7443 virtual int recvMsg(
void* buf,
int length,
SocketAddr& addr,
int& stream,
int& flags) = 0;
7451 virtual bool setStreams(
int inbound,
int outbound) = 0;
7458 virtual bool subscribeEvents() = 0;
7466 virtual bool getStreams(
int& inbound,
int& outbound) = 0;
7473 virtual bool setPayload(u_int32_t payload) = 0;
7492 : m_ttl(ttl), m_order(order), m_pref(pref)
7499 : m_order(0), m_pref(0)
7528 virtual void dump(
String& buf,
const char* sep =
" ");
7575 virtual void dump(
String& buf,
const char* sep =
" ");
7608 inline SrvRecord(
int ttl,
int prio,
int weight,
const char* addr,
int port)
7609 :
DnsRecord(ttl,prio,weight), m_address(addr), m_port(port)
7617 {
return m_address; }
7631 virtual void dump(
String& buf,
const char* sep =
" ");
7667 NaptrRecord(
int ttl,
int ord,
int pref,
const char* flags,
const char* serv,
7668 const char* regexp,
const char* next);
7676 bool replace(
String& str)
const;
7683 virtual void dump(
String& buf,
const char* sep =
" ");
7697 {
return m_service; }
7704 {
return m_regmatch; }
7711 {
return m_template; }
7756 static bool available(Type type = Unknown);
7764 static bool init(
int timeout = -1,
int retries = -1);
7774 static int query(Type type,
const char* dname,
ObjList& result,
String* error = 0);
7783 static int srvQuery(
const char* dname,
ObjList& result,
String* error = 0);
7792 static int naptrQuery(
const char* dname,
ObjList& result,
String* error = 0);
7801 static int a4Query(
const char* dname,
ObjList& result,
String* error = 0);
7810 static int a6Query(
const char* dname,
ObjList& result,
String* error = 0);
7819 static int txtQuery(
const char* dname,
ObjList& result,
String* error = 0);
7848 {
return s_directions; }
7869 virtual void* getObject(
const String& name)
const;
7876 virtual bool valid(Direction dir = Bidir)
const;
7882 virtual unsigned int blockSize()
const = 0;
7888 virtual unsigned int initVectorSize()
const;
7895 unsigned int bufferSize(
unsigned int len)
const;
7902 bool bufferFull(
unsigned int len)
const;
7911 virtual bool setKey(
const void* key,
unsigned int len, Direction dir = Bidir) = 0;
7920 {
return setKey(key.
data(),key.
length(),dir); }
7929 virtual bool initVector(
const void* vect,
unsigned int len, Direction dir = Bidir);
7938 {
return initVector(vect.
data(),vect.
length(),dir); }
7947 virtual bool encrypt(
void* outData,
unsigned int len,
const void* inpData = 0) = 0;
7955 {
return encrypt(data.
data(),data.
length()); }
7964 virtual bool decrypt(
void* outData,
unsigned int len,
const void* inpData = 0) = 0;
7972 {
return decrypt(data.
data(),data.
length()); }
7994 :
String(name), m_format(format)
8008 {
return m_format; }
8017 virtual bool init(
bool comp =
true,
bool decomp =
true,
8036 virtual int compress(
const void* buf,
unsigned int len,
DataBlock& dest);
8046 virtual int decompress(
const void* buf,
unsigned int len,
DataBlock& dest);
8058 virtual int writeComp(
const void* buf,
unsigned int len,
bool flush) = 0;
8069 {
return writeComp(data.
data(),data.
length(),flush); }
8080 {
return writeComp(data.
c_str(),data.
length(),flush); }
8088 virtual int readComp(
DataBlock& buf,
bool flush) = 0;
8098 virtual int writeDecomp(
const void* buf,
unsigned int len,
bool flush) = 0;
8108 {
return writeDecomp(data.
data(),data.
length(),flush); }
8118 {
return writeDecomp(data.
c_str(),data.
length(),flush); }
8126 virtual int readDecomp(
DataBlock& buf,
bool flush) = 0;
8158 static u_int64_t startTime();
8165 static u_int64_t usecRunTime(Type type = WallTime);
8172 static u_int64_t msecRunTime(Type type = WallTime);
8179 static u_int32_t secRunTime(Type type = WallTime);
8186 static double runTime(Type type = WallTime);
A Mutex pool.
Definition: yateclass.h:5221
int sendTo(const void *buffer, int length, const SocketAddr &addr, int flags=0)
Definition: yateclass.h:7220
Time & operator=(u_int64_t usec)
Definition: yateclass.h:3607
String & operator+=(bool value)
Definition: yateclass.h:2328
A DNS record.
Definition: yateclass.h:7480
Internal helper class.
Definition: yateclass.h:1055
const char * c_safe(const char *str)
Definition: yateclass.h:2813
int count() const
Definition: yateclass.h:3272
bool null() const
Definition: yateclass.h:1967
Abstract interface for lockable objects.
Definition: yateclass.h:5048
int writeData(const DataBlock &buf)
Definition: yateclass.h:6405
RefPointer(const RefPointer< Obj > &value)
Definition: yateclass.h:1109
const char * debugColor(int level)
Compressor(const char *format, const char *name=0)
Definition: yateclass.h:7993
GenPointer()
Definition: yateclass.h:1173
DataBlock & operator+=(const DataBlock &value)
Definition: yateclass.h:3965
int locks() const
Definition: yateclass.h:5574
GenObject * operator[](unsigned int index) const
Definition: yateclass.h:1547
static bool alive(const RefObject *obj)
Definition: yateclass.h:1013
UChar & operator=(char code)
Definition: yateclass.h:1786
unsigned int index(void *ptr) const
Definition: yateclass.h:5248
void setDelete(bool autodelete)
Definition: yateclass.h:1604
bool hmacStart(DataBlock &opad, const DataBlock &key)
Definition: yateclass.h:4130
const char * c_str() const
Definition: yateclass.h:1938
GenObject * operator[](signed int index) const
Definition: yateclass.h:1539
A class that holds just a block of raw data.
Definition: yateclass.h:3774
ObjList * getList(unsigned int index) const
Definition: yateclass.h:3329
String sqlEscape(char extraEsc=0) const
Definition: yateclass.h:2731
int debugLevel() const
Definition: yateclass.h:328
ObjList * next() const
Definition: yateclass.h:1281
const String & getUser() const
Definition: yateclass.h:5000
u_int32_t sec() const
Definition: yateclass.h:3581
bool isNullAddr() const
Definition: yateclass.h:6061
UChar(uint32_t code=0)
Definition: yateclass.h:1745
Definition: yateclass.h:949
int value
Definition: yateclass.h:692
A regexp matching class.
Definition: yateclass.h:2902
NamedIterator(const NamedList &list)
Definition: yateclass.h:4865
static void setObjCounting(bool enable)
Definition: yateclass.h:892
void Debug(int level, const char *format,...)
static const char * lookupFamily(int family)
Definition: yateclass.h:6217
SOCKET handle() const
Definition: yateclass.h:6911
static unsigned int scopeId(struct sockaddr *addr)
Definition: yateclass.h:6121
A captured event string with a debug level.
Definition: yateclass.h:3034
const char * safe(const char *defStr) const
Definition: yateclass.h:1953
Regexp & operator=(const char *value)
Definition: yateclass.h:2933
String matchString(int index=0) const
Definition: yateclass.h:2660
Mutex * mutex(void *ptr) const
Definition: yateclass.h:5258
GenPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1202
RefPointer()
Definition: yateclass.h:1102
String & operator<<(int64_t value)
Definition: yateclass.h:2396
SocketAddr & operator=(const SocketAddr &value)
Definition: yateclass.h:5911
~Lock2()
Definition: yateclass.h:5458
GenObject * operator[](unsigned int index) const
Definition: yateclass.h:1329
GenPointer< Obj > & operator=(const GenPointer< Obj > &value)
Definition: yateclass.h:1196
ObjList * skipNull() const
A NAPTR record.
Definition: yateclass.h:7652
void toTimeval(struct timeval *tv) const
Definition: yateclass.h:3626
bool eof() const
Definition: yateclass.h:3514
static bool capturing()
Definition: yateclass.h:3068
MemoryStream()
Definition: yateclass.h:6494
bool decrypt(DataBlock &data)
Definition: yateclass.h:7971
uint32_t code() const
Definition: yateclass.h:1793
virtual bool init(bool comp=true, bool decomp=true, const NamedList ¶ms=NamedList::empty())
Definition: yateclass.h:8017
bool connectAsync(const SocketAddr &addr, unsigned int toutUs, bool *timeout=0)
Definition: yateclass.h:7159
A filter for received socket data.
Definition: yateclass.h:6262
const String & hexDigest()
Definition: yateclass.h:4067
const char * strcat(String &dest, const char *src)
Definition: yateclass.h:2866
const String & format() const
Definition: yateclass.h:8007
NamedIterator & operator=(const NamedList &list)
Definition: yateclass.h:4881
const String & address() const
Definition: yateclass.h:7616
bool autoDelete()
Definition: yateclass.h:1428
UChar(int32_t code)
Definition: yateclass.h:1753
Formatting
Definition: yateclass.h:576
virtual ~GenObject()
Definition: yateclass.h:842
static void append(int level, const char *text)
Definition: yateclass.h:3083
Thread support class.
Definition: yateclass.h:5529
bool update(const String &str)
Definition: yateclass.h:4092
bool locked() const
Definition: yateclass.h:5581
const String & getExtra() const
Definition: yateclass.h:5021
~Lock()
Definition: yateclass.h:5380
int writeDecomp(const String &data, bool flush)
Definition: yateclass.h:8117
SeekPos
Definition: yateclass.h:6328
constant YSTRING(const char *string)
A stream file class.
Definition: yateclass.h:6573
bool hmac(const String &key, const String &msg)
Definition: yateclass.h:4174
static int unStringify(uint8_t *buf, const String &host, int family=Unknown)
Definition: yateclass.h:6101
const Regexp & regexp() const
Definition: yateclass.h:7703
RefPointer< Obj > & operator=(const RefPointer< Obj > &value)
Definition: yateclass.h:1129
static const char * boolText(bool value)
Definition: yateclass.h:1931
bool lock(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5484
Stream()
Definition: yateclass.h:6470
unsigned int length() const
Definition: yateclass.h:4595
static bool getObjCounting()
Definition: yateclass.h:885
bool null() const
Definition: yateclass.h:5973
void enable(bool val)
Definition: yateclass.h:3253
String uriEscape(char extraEsc=0, const char *noEsc=0) const
Definition: yateclass.h:2758
bool compile() const
Definition: yateclass.h:2940
bool checkBOM() const
Definition: yateclass.h:2010
bool hmac(const DataBlock &key, const DataBlock &msg)
Definition: yateclass.h:4165
const String & flags() const
Definition: yateclass.h:7689
Socket * socket() const
Definition: yateclass.h:6305
virtual unsigned int hashLength() const
Definition: yateclass.h:4469
Lock(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5366
An abstract cipher.
Definition: yateclass.h:7831
virtual unsigned int hashLength() const
Definition: yateclass.h:4372
~RefPointer()
Definition: yateclass.h:1123
unsigned int length() const
Definition: yateclass.h:3314
u_int64_t msec() const
Definition: yateclass.h:3588
ObjList * getColumn(int column) const
Definition: yateclass.h:1719
Time()
Definition: yateclass.h:3542
unsigned char * data(unsigned int offs, unsigned int len=1) const
Definition: yateclass.h:3836
void XDebug(int level, const char *format,...)
static unsigned int rawLength()
Definition: yateclass.h:4365
Base64(void *src, unsigned int len, bool copyData=true)
Definition: yateclass.h:4500
String & operator<<(const char *value)
Definition: yateclass.h:2372
bool connect(const SocketAddr &addr)
Definition: yateclass.h:7136
int port() const
Definition: yateclass.h:7623
Obj * pointer() const
Definition: yateclass.h:1088
String uriUnescape(int *errptr=0) const
Definition: yateclass.h:2774
~Time()
Definition: yateclass.h:3574
A socket address holder.
Definition: yateclass.h:5848
ObjVector(bool autodelete=true)
Definition: yateclass.h:1475
static u_int64_t fromTimeval(const struct timeval &tv)
Definition: yateclass.h:3648
bool debugChained() const
Definition: yateclass.h:370
void resize(unsigned int len)
Definition: yateclass.h:3924
int order() const
Definition: yateclass.h:7513
URI & operator=(const char *value)
Definition: yateclass.h:4979
const String & name() const
Definition: yateclass.h:3126
static const String * atom(const String *&str, const char *val)
String & operator<<(uint64_t value)
Definition: yateclass.h:2402
const char * debugName() const
Definition: yateclass.h:356
virtual int64_t length()
Definition: yateclass.h:6546
virtual ~Compressor()
Definition: yateclass.h:8000
String & operator<<(double value)
Definition: yateclass.h:2414
A list based Array.
Definition: yateclass.h:1621
MemoryStream(const DataBlock &data)
Definition: yateclass.h:6502
bool bind(const SocketAddr &addr)
Definition: yateclass.h:7062
unsigned int length() const
Definition: yateclass.h:3466
SrvRecord(int ttl, int prio, int weight, const char *addr, int port)
Definition: yateclass.h:7608
NamedIterator & operator=(const NamedIterator &original)
Definition: yateclass.h:4888
void set(u_int32_t seed)
Definition: yateclass.h:3745
GenObject * remove(bool delobj=true)
void * userObject(const String &name) const
Definition: yateclass.h:3201
const char * familyName()
Definition: yateclass.h:5987
const String & nextName() const
Definition: yateclass.h:7717
void debugName(const char *name)
Definition: yateclass.h:391
Hasher()
Definition: yateclass.h:4193
RefPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1135
GenObject * at(int index) const
Definition: yateclass.h:1531
NamedList & setParam(NamedString *param)
Definition: yateclass.h:4632
Ephemeral object counter changer.
Definition: yateclass.h:5800
static bool stripBOM(const char *&str)
Definition: yateclass.h:2018
bool acquire(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5412
virtual bool getParams(const String ¶ms, NamedList &result)
Definition: yateclass.h:7000
static ObjList & eventsRw()
Definition: yateclass.h:3091
Type
Definition: yateclass.h:7741
Encapsulates a runnable task.
Definition: yateclass.h:5508
virtual bool valid() const
Definition: yateclass.h:6523
CapturedEvent(int level, const char *text)
Definition: yateclass.h:3044
int writeComp(const String &data, bool flush)
Definition: yateclass.h:8079
Base64 & operator<<(const DataBlock &data)
Definition: yateclass.h:4537
Abstract SCTP Socket.
Definition: yateclass.h:7368
struct sockaddr * address() const
Definition: yateclass.h:6047
A standard SHA1 digest calculator.
Definition: yateclass.h:4300
GenPointer(Obj *object)
Definition: yateclass.h:1189
Time(const struct timeval *tv)
Definition: yateclass.h:3558
Encapsulation for an URI.
Definition: yateclass.h:4920
int family() const
Definition: yateclass.h:5980
unsigned int count() const
Definition: yateclass.h:4602
void overAlloc(unsigned int bytes)
Definition: yateclass.h:3873
Time & operator-=(int64_t delta)
Definition: yateclass.h:3619
Hasher & operator<<(const String &value)
Definition: yateclass.h:4099
String & operator=(const String &value)
Definition: yateclass.h:2225
String & operator=(bool value)
Definition: yateclass.h:2277
static bool checkBOM(const char *str)
Definition: yateclass.h:2003
URI & operator=(const URI &value)
Definition: yateclass.h:4965
int operator[](signed int index) const
Definition: yateclass.h:3946
A class exposing system resources usage.
Definition: yateclass.h:8137
static void capturing(bool capture)
Definition: yateclass.h:3098
const char * token
Definition: yateclass.h:687
int lookup(const char *str, const TokenDict *tokens, int defvalue=0, int base=0)
int operator[](unsigned int index) const
Definition: yateclass.h:3954
CapturedEvent(const CapturedEvent &original)
Definition: yateclass.h:3052
bool eof() const
Definition: yateclass.h:4900
GenObject * operator[](signed int index) const
Definition: yateclass.h:1321
Base64 & operator<<(const String &value)
Definition: yateclass.h:4531
void destruct(GenObject *obj)
Definition: yateclass.h:933
bool initVector(const DataBlock &vect, Direction dir=Bidir)
Definition: yateclass.h:7937
static unsigned int rawLength()
Definition: yateclass.h:4278
const String & host() const
Definition: yateclass.h:6009
bool scopeId(unsigned int val)
Definition: yateclass.h:6002
URI & operator=(const String &value)
Definition: yateclass.h:4972
char operator[](signed int index) const
Definition: yateclass.h:2177
void assign(RefObject *oldptr, RefObject *newptr, void *pointer)
int64_t seek(int64_t offset)
Definition: yateclass.h:6435
ObjList * paramList()
Definition: yateclass.h:4838
UChar(unsigned char code)
Definition: yateclass.h:1769
UChar & operator=(uint32_t code)
Definition: yateclass.h:1778
static String & appendTo(String &buf, const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6162
Obj & operator*() const
Definition: yateclass.h:1154
TxtRecord(int ttl, const char *text)
Definition: yateclass.h:7559
RefPointer(Obj *object)
Definition: yateclass.h:1117
DSCP
Definition: yateclass.h:6827
GenObject * userData() const
Definition: yateclass.h:3179
A single Unicode character.
Definition: yateclass.h:1738
void append(void *value, unsigned int len)
Definition: yateclass.h:3896
bool unHexify(const String &data)
Definition: yateclass.h:4014
static String appendTo(const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6175
A time holding class.
Definition: yateclass.h:3536
Time & operator+=(int64_t delta)
Definition: yateclass.h:3613
static bool isLeap(unsigned int year)
Definition: yateclass.h:3706
SocketAddr(const SocketAddr &value)
Definition: yateclass.h:5883
const String & text() const
Definition: yateclass.h:7567
const String * operator->() const
Definition: yateclass.h:3023
virtual bool lock(long maxwait=-1)=0
Obj & operator*() const
Definition: yateclass.h:1221
Direction
Definition: yateclass.h:7837
A holder for a debug level.
Definition: yateclass.h:309
Lock2(Mutex *mx1, Mutex *mx2, long maxwait=-1)
Definition: yateclass.h:5441
A generic socket class.
Definition: yateclass.h:6809
DataBlock m_data
Definition: yateclass.h:6561
virtual unsigned int hashLength() const
Definition: yateclass.h:4285
int error() const
Definition: yateclass.h:6343
void * data() const
Definition: yateclass.h:3827
bool acquire(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5402
An abstract hashing class.
Definition: yateclass.h:4036
DebugLevel
Definition: yateclass.h:254
TempObjectCounter(NamedCounter *counter, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5809
static const NamedList & empty()
void reset()
Definition: yateclass.h:3520
String msgUnescape(int *errptr=0, char extraEsc=0) const
Definition: yateclass.h:2715
int lenUtf8(uint32_t maxChar=0x10ffff, bool overlong=false) const
Definition: yateclass.h:1985
String & operator<<(char value)
Definition: yateclass.h:2378
An object that logs messages on creation and destruction.
Definition: yateclass.h:570
int getPort() const
Definition: yateclass.h:5014
void reset()
Definition: yateclass.h:4906
Atom string holder.
Definition: yateclass.h:3001
String & operator<<(int32_t value)
Definition: yateclass.h:2384
void debugChain(const DebugEnabler *chain=0)
Definition: yateclass.h:377
A named pointer class.
Definition: yateclass.h:3159
bool enabled() const
Definition: yateclass.h:3246
class * YOBJECT(class type, GenObject *pntr)
socklen_t length() const
Definition: yateclass.h:6054
constant YATOM(const char *string)
String & operator<<(bool value)
Definition: yateclass.h:2408
bool setKey(const DataBlock &key, Direction dir=Bidir)
Definition: yateclass.h:7919
void DDebug(int level, const char *format,...)
const String & getDescription() const
Definition: yateclass.h:4986
Obj * operator->() const
Definition: yateclass.h:1215
int64_t m_offset
Definition: yateclass.h:6566
A named string class.
Definition: yateclass.h:3111
virtual void finalize(bool comp)
Definition: yateclass.h:8025
A standard SHA256 digest calculator.
Definition: yateclass.h:4397
bool setTOS(const char *tos, int defTos=Normal)
Definition: yateclass.h:7016
String msgEscape(char extraEsc=0) const
Definition: yateclass.h:2697
bool operator!=(const String &value) const
Definition: yateclass.h:2356
static unsigned int rawLength()
Definition: yateclass.h:4462
void drop()
Definition: yateclass.h:5393
bool operator==(const String &value) const
Definition: yateclass.h:2350
DNS services.
Definition: yateclass.h:7735
int getColumns() const
Definition: yateclass.h:1709
const char * c_str(const String *str)
Definition: yateclass.h:2805
DebugEnabler(int level=TelEngine::debugLevel(), bool enabled=true)
Definition: yateclass.h:317
bool null(const char *str)
Definition: yateclass.h:2829
void NDebug(int level, const char *format,...)
int pref() const
Definition: yateclass.h:7520
static void * getObject(const String &name, const GenObject *obj)
Definition: yateclass.h:878
const String & getHost() const
Definition: yateclass.h:5007
NamedCounter * getObjCounter() const
Definition: yateclass.h:899
Base64 encoder/decoder class.
Definition: yateclass.h:4484
void YCLASSIMP3(class type, class base1, class base2, class base3)
A hashed object list class.
Definition: yateclass.h:3288
SctpSocket()
Definition: yateclass.h:7375
void clear(bool deleteData=true)
bool stripBOM()
Definition: yateclass.h:2033
const String & addr() const
Definition: yateclass.h:6016
int refcount() const
Definition: yateclass.h:999
void YCLASSIMP(class type, class base)
Base64 & operator<<(const char *value)
Definition: yateclass.h:4543
A named string container class.
Definition: yateclass.h:4553
String operator+(const String &s1, const String &s2)
void * m_pointer
Definition: yateclass.h:1075
DataBlock & operator+=(const String &value)
Definition: yateclass.h:3971
const String & getProtocol() const
Definition: yateclass.h:4993
char operator[](unsigned int index) const
Definition: yateclass.h:2185
virtual bool matches(const String &value) const
Definition: yateclass.h:2955
Templated smart pointer class.
Definition: yateclass.h:1081
Ephemeral mutex or semaphore locking object.
Definition: yateclass.h:5357
Lock2(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5451
virtual Socket * accept(SocketAddr &addr)
Definition: yateclass.h:7421
bool hmacStart(DataBlock &opad, const String &key)
Definition: yateclass.h:4139
void YCLASS3(class type, class base1, class base2, class base3)
Pseudo random number generator.
Definition: yateclass.h:3723
String & operator<<(String &str, const Complex &c)
Definition: yatemath.h:1685
GenPointer(const GenPointer< Obj > &value)
Definition: yateclass.h:1181
bool update(const void *buf, unsigned int len)
Definition: yateclass.h:4076
Hasher & operator<<(const DataBlock &data)
Definition: yateclass.h:4106
Semaphore implementation.
Definition: yateclass.h:5279
An abstract stream class capable of reading and writing.
Definition: yateclass.h:6322
void YCLASSIMP2(class type, class base1, class base2)
void clearError()
Definition: yateclass.h:6477
Base64()
Definition: yateclass.h:4491
String & append(const ObjList &list, const char *separator=0, bool force=false)
Definition: yateclass.h:2478
TempObjectCounter(const GenObject *obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5818
A Stream that operates on DataBlocks in memory.
Definition: yateclass.h:6487
Templated pointer that can be inserted in a list.
Definition: yateclass.h:1161
bool encrypt(DataBlock &data)
Definition: yateclass.h:7954
virtual bool matches(const String &value) const
Definition: yateclass.h:2631
static bool errorString(String &buffer)
Definition: yateclass.h:5755
virtual void * getObject(const String &name) const
Time(const struct timeval &tv)
Definition: yateclass.h:3566
Ephemeral double mutex locking object.
Definition: yateclass.h:5431
bool valid() const
Definition: yateclass.h:5966
unsigned int length() const
Definition: yateclass.h:1511
int writeDecomp(const DataBlock &data, bool flush)
Definition: yateclass.h:8107
int level() const
Definition: yateclass.h:3060
SctpSocket(SOCKET fd)
Definition: yateclass.h:7382
ObjList * getHashList(const String &str) const
Definition: yateclass.h:3345
bool isCurrent() const
Definition: yateclass.h:5685
static NamedCounter * setCurrentObjCounter(NamedCounter *counter)
HANDLE handle() const
Definition: yateclass.h:6631
static const ObjList & events()
Definition: yateclass.h:3075
A text based DNS record.
Definition: yateclass.h:7549
Definition: yateclass.h:217
int writeData(const String &str)
Definition: yateclass.h:6397
int ttl() const
Definition: yateclass.h:7506
const DataBlock & data() const
Definition: yateclass.h:6510
TOS
Definition: yateclass.h:6816
NamedPointer & operator=(const char *value)
Definition: yateclass.h:3207
NamedString & operator=(const char *value)
Definition: yateclass.h:3145
const ObjList * paramList() const
Definition: yateclass.h:4845
bool operator!=(const SocketAddr &other) const
Definition: yateclass.h:5926
A C-style string handling class.
Definition: yateclass.h:1832
Atom(const char *value)
Definition: yateclass.h:3008
void assign(Obj *object=0)
Definition: yateclass.h:1095
bool locked() const
Definition: yateclass.h:5465
const char * strcpy(String &dest, const char *src)
Definition: yateclass.h:2859
Class used to iterate the items of a list.
Definition: yateclass.h:3437
Definition: yateclass.h:683
static const TokenDict * directions()
Definition: yateclass.h:7847
Priority
Definition: yateclass.h:5539
const char * c_str() const
Definition: yateclass.h:1800
bool setIpv6OnlyOption(bool on)
Definition: yateclass.h:6968
Time(u_int64_t usec)
Definition: yateclass.h:3550
bool autoDelete()
Definition: yateclass.h:1597
TempObjectCounter(const GenObject &obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5827
const char * debugLevelName(int level)
DnsRecord(int ttl, int order, int pref)
Definition: yateclass.h:7491
virtual bool setParams(const NamedList ¶ms)
Definition: yateclass.h:6991
u_int64_t usec() const
Definition: yateclass.h:3595
const char * safe() const
Definition: yateclass.h:1945
int writeComp(const DataBlock &data, bool flush)
Definition: yateclass.h:8068
static bool scopeId(struct sockaddr *addr, unsigned int val)
Definition: yateclass.h:6135
void Output(const char *format,...)
const String & serv() const
Definition: yateclass.h:7696
An object list class.
Definition: yateclass.h:1229
unsigned int length() const
Definition: yateclass.h:3859
unsigned int length() const
Definition: yateclass.h:1960
void Alarm(const char *component, int level, const char *format,...)
Lock(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5374
bool null() const
Definition: yateclass.h:3852
void clearParams()
Definition: yateclass.h:4608
const String & repTemplate() const
Definition: yateclass.h:7710
void YCLASS(class type, class base)
NamedIterator(const NamedIterator &original)
Definition: yateclass.h:4873
unsigned int scopeId() const
Definition: yateclass.h:5994
void setDelete(bool autodelete)
Definition: yateclass.h:1435
~TempObjectCounter()
Definition: yateclass.h:5834
static bool stripBOM(char *&str)
Definition: yateclass.h:2026
bool debugEnabled() const
Definition: yateclass.h:342
int at(unsigned int offs, int defvalue=-1) const
Definition: yateclass.h:3845
bool update(const DataBlock &data)
Definition: yateclass.h:4084
Type
Definition: yateclass.h:8143
ObjList * getHashList(unsigned int hash) const
Definition: yateclass.h:3337
DnsRecord()
Definition: yateclass.h:7498
NamedList parameters iterator.
Definition: yateclass.h:4858
A vector holding GenObjects.
Definition: yateclass.h:1467
virtual bool terminate()
Definition: yateclass.h:6517
A SRV record.
Definition: yateclass.h:7595
Random(u_int32_t seed=Time::now()&0xffffffff)
Definition: yateclass.h:3730
Obj * operator->() const
Definition: yateclass.h:1148
Lockable * locked() const
Definition: yateclass.h:5387
Mutex * mutex(unsigned int idx) const
Definition: yateclass.h:5266
void YIGNORE(primitive value)
bool matches(const char *value) const
UChar(signed char code)
Definition: yateclass.h:1761
Family
Definition: yateclass.h:5855
Mutex support.
Definition: yateclass.h:5131
unsigned int hash() const
Definition: yateclass.h:2040
A standard MD5 digest calculator.
Definition: yateclass.h:4213
RefPointerBase()
Definition: yateclass.h:1061
An abstract data (de)compressor.
Definition: yateclass.h:7983
String & operator=(const String *value)
Definition: yateclass.h:2233
Engine globals.
Definition: yatengine.h:1161
Definition: yateclass.h:830
SocketAddr()
Definition: yateclass.h:5875
void debugEnabled(bool enable)
Definition: yateclass.h:349
unsigned int overAlloc() const
Definition: yateclass.h:3866
String & operator<<(uint32_t value)
Definition: yateclass.h:2390
int getRows() const
Definition: yateclass.h:1702
bool controlReturn(NamedList *params, bool ret, const char *retVal=0)
static Direction direction(const char *name, Direction defdir=Bidir)
Definition: yateclass.h:7856
String & operator+=(const char *value)
Definition: yateclass.h:2291
Atomic counter with name.
Definition: yateclass.h:3232
void YCLASS2(class type, class base1, class base2)