UCommon
Data Structures | Typedefs | Functions | Variables
ucommon Namespace Reference

Common namespace for all ucommon objects. More...

Data Structures

class  array_pointer
 Generic smart array class. More...
 
class  array_reuse
 An array of reusable objects. More...
 
class  charbuf
 A copy-on-write string class that operates by reference count. More...
 
class  linked_pointer
 A smart pointer template for iterating linked lists. More...
 
class  linked_pointer< sockaddr_struct >
 Linked pointer for address lists. More...
 
class  linked_value
 A linked object base class for ordered objects. More...
 
class  mapped_array
 Map a reusable allocator over a named shared memory segment. More...
 
class  mapped_reuse
 Template class to map typed reusable objects into shared memory heap. More...
 
class  mapped_view
 Class to access a named mapped segment published from another process. More...
 
class  object_pointer
 Typed smart pointer class. More...
 
class  paged_reuse
 A reusable private pool of reusable types. More...
 
class  pager
 This is a base class for objects that may be created in pager pools. More...
 
class  pointer
 Generic smart pointer class. More...
 
class  sarray
 Generate a typed sparse managed object array. More...
 
class  save_restore
 Save and restore global objects in function call stack frames. More...
 
class  sequence
 A template to return a sequence of objects of a specified type. More...
 
class  stringbuf
 A string class that has a predefined string buffer. More...
 
class  temporary
 Manage temporary object stored on the heap. More...
 
class  treemap
 Embed data objects into a tree structured memory database. More...
 

Typedefs

typedef ConditionalAccess accesslock_t
 Convenience type for scheduling access.
 
typedef Barrier barrier_t
 Convenience type for using thread barriers.
 
typedef typeref< Type::Bools > boolref_t
 
typedef arrayref< Type::Bytes > bytearray_t
 
typedef typeref< Type::Bytes > byteref_t
 
typedef typeref< Type::Bytes >::value * bytevalues_t
 
typedef typeref< Type::Chars >::value * charvalues_t
 
typedef Cipher cipher_t
 Convenience type for generic ciphers.
 
typedef counter counter_t
 A convenience typecast for integer counters.
 
typedef Date date_t
 Convenience type for using Date object.
 
typedef DateTimeString datetimestring_t
 Convenience type for using DateTimeString object.
 
typedef Digest digest_t
 Convenience type for generic digests.
 
typedef dir dir_t
 
typedef DirPager dirlist_t
 A convenience type for using DirPager directly.
 
typedef dso dso_t
 
typedef HMAC hmac_t
 Convenience type for generic digests.
 
typedef secure::string keystring_t
 
typedef LinkedObject * LinkedIndex
 Convenience typedef for root pointers of single linked lists.
 
typedef DLinkedObject LinkedList
 
typedef void * mem_t
 Convenience type for loader operations.
 
typedef Mutex mutex_t
 Convenience type for using exclusive mutex locks.
 
typedef RecursiveMutex rexlock_t
 Convenience type for using recursive exclusive locks.
 
typedef RWLock rwlock_t
 Convenience type for using read/write locks.
 
typedef Semaphore semaphore_t
 Convenience type for using counting semaphores.
 
typedef Cipher::Key skey_t
 Convenience type for generic cipher key.
 
typedef String string_t
 A convenience type for string.
 
typedef arrayref< Type::Chars > stringarray_t
 
typedef String::regex stringex_t
 
typedef StringPager stringlist_t
 A convenience type for paged string lists.
 
typedef StringPager::member stringlistitem_t
 A convenience type for paged string list items.
 
typedef typeref< Type::Chars > stringref_t
 
typedef TCPServer tcpserv_t
 
typedef Timer timer_t
 A convenience type for timers.
 
typedef Time tod_t
 Convenience type for using Time object.
 
typedef toggle toggle_t
 A convenience typecast for auto-toggled bools.
 
typedef int16_t ucs2_t
 16 bit unicode character code. More...
 
typedef int32_t ucs4_t
 32 bit unicode character code. More...
 
typedef void * unicode_t
 Resolves issues where wchar_t is not defined.
 
typedef UString ustring_t
 Convenience type for utf8 encoded strings.
 
typedef utf8_pointer utf8_t
 Convenience type for utf8_pointer strings.
 
typedef unsigned short vectorsize_t
 
typedef ZNumber znumber_t
 A convenience type for znumber.
 

Functions

class __attribute__ ((visibility("default"))) ExclusiveProtocol
 An exclusive locking protocol interface base. More...
 
const char * __TEXT (const char *s)
 Invoke translation lookup if available. More...
 
const char * _TEXT (const char *s)
 
template<typename T >
const T abs (const T &value)
 Template for absolute value of a type. More...
 
const struct sockaddr * addr (Socket::address &address)
 A convenience function to convert a socket address list into a socket address. More...
 
struct addrinfo * addrinfo (Socket::address &address)
 A convenience function to convert a socket address list into an addrinfo. More...
 
template<typename T >
bool bound (const T *pointer, const T *base, size_t count)
 Convenience function to check memory arrays. More...
 
template<typename T >
T & clear (T &o)
 
template<typename T >
class __attribute__((visibility("default"))) sstream void clearmem (T &var)
 Secure socket using std::iostream. More...
 
template<typename T >
copy (const T &src)
 Convenience function to copy objects.
 
template<typename T >
T & copy (const T &src, T &to)
 
template<typename T >
void copy_unsafe (T *target, const T *source)
 Convenience function to copy class. More...
 
template<typename T >
T & deref_pointer (T *pointer)
 Convert a pointer to a reference with type checking. More...
 
template<typename T >
T * dup (const T &object)
 Convenience function to duplicate object pointer to heap. More...
 
template<>
char * dup< char > (const char &object)
 
template<typename T >
void dupfree (T object)
 
template<>
void dupfree< char * > (char *object)
 
template<>
void dupfree< ucs2_t * > (ucs2_t *string)
 
template<>
void dupfree< ucs4_t * > (ucs4_t *string)
 
template<>
void dupfree< unicode_t > (unicode_t string)
 
bool eq (char const *s1, char const *s2)
 Compare two null terminated strings if equal. More...
 
bool eq (char const *s1, char const *s2, size_t size)
 Compare two null terminated strings if equal up to specified size. More...
 
bool eq (String &s1, const char *s2)
 Compare two string objects if equal. More...
 
bool eq (const struct sockaddr *s1, const struct sockaddr *s2)
 Compare two socket addresses to see if equal. More...
 
bool eq (const struct sockaddr_storage *s1, const struct sockaddr_storage *s2)
 Compare two stored socket addresses to see if equal. More...
 
bool eq_case (char const *s1, char const *s2)
 Compare two null terminated strings if equal ignoring case. More...
 
bool eq_case (char const *s1, char const *s2, size_t size)
 Compare two null terminated strings if equal for a specified size ignoring case. More...
 
bool eq_host (const struct sockaddr *s1, const struct sockaddr *s2)
 Compare two host addresses to see if equal. More...
 
bool eq_subnet (const struct sockaddr *s1, const struct sockaddr *s2)
 
bool ge (String &s1, const char *s2)
 
bool gt (String &s1, const char *s2)
 
template<typename T >
bool is (T &object)
 Convenience function to validate object assuming it is castable to bool. More...
 
bool is_device (const char *path)
 
bool is_dir (const char *path)
 
bool is_executable (const char *path)
 
bool is_exists (const char *path)
 
bool is_file (const char *path)
 
bool is_link (const char *path)
 
bool is_readable (const char *path)
 
bool is_writable (const char *path)
 
template<typename T >
bool isnull (T &object)
 Convenience function to test pointer object. More...
 
template<typename T >
bool isnullp (T *object)
 Convenience function to test pointer-pointer object. More...
 
bool le (String &s1, const char *s2)
 
template<typename T >
T &() limit (T &value, T &low, T &high)
 Convenience macro to range restrict values. More...
 
bool lt (String &s1, const char *s2)
 
template<typename T >
class __attribute__((visibility("default"))) MapRef size_t mapkeypath (typeref< T > &object)
 
template<>
size_t mapkeypath< const char * > (typeref< const char *> &object)
 
template<>
size_t mapkeypath< const uint8_t * > (typeref< const uint8_t *> &object)
 
template<typename T >
bool mapped_keyequal (const T *key1, const T *key2)
 
template<>
bool mapped_keyequal< char > (const char *k1, const char *k2)
 
template<>
bool mapped_keyequal< struct sockaddr > (const struct sockaddr *s1, const struct sockaddr *s2)
 
template<typename T >
size_t mapped_keypath (const T *addr)
 
template<>
size_t mapped_keypath< char > (const char *addr)
 
template<>
size_t mapped_keypath< struct sockaddr > (const struct sockaddr *addr)
 
template<typename T >
const T() max (const T &v1, const T &v2)
 Template for max value of a type. More...
 
template<typename T >
T &() max (T &o1, T &o2)
 Convenience function to return max of two objects. More...
 
template<typename T >
const T() min (const T &v1, const T &v2)
 Template for min value of a type. More...
 
template<typename T >
T &() min (T &o1, T &o2)
 Convenience function to return min of two objects. More...
 
template<typename T >
T & move (T &src, T &to)
 Convenience function to move objects.
 
bool ne (char const *s1, char const *s2)
 
bool ne (char const *s1, char const *s2, size_t size)
 
bool ne (String &s1, String &s2)
 
bool ne_case (char const *s1, char const *s2)
 
std::string & operator+ (std::string &target, String &source)
 
std::string & operator+= (std::string &target, String &source)
 
std::ostream & operator<< (std::ostream &out, const PrintProtocol &format)
 
std::ostream & operator<< (std::ostream &out, const string_t &str)
 
std::ostream & operator<< (std::ostream &out, const stringlist_t &list)
 
std::ostream & operator<< (std::ostream &os, Socket::address &addr)
 
std::istream & operator>> (std::istream &inp, InputProtocol &format)
 
std::istream & operator>> (std::istream &inp, string_t &str)
 
std::istream & operator>> (std::istream &in, stringlist_t &list)
 
template<typename T >
void reset_unsafe (T &object)
 Convenience function to reset an existing object. More...
 
template<typename T >
void store_unsafe (T &target, const T *source)
 Convenience function to store object pointer into object. More...
 
String str (StringPager &list, const char *prefix=NULL, const char *middle=NULL, const char *suffix=NULL)
 
String str (const char *string)
 
String str (String &string)
 
String str (short value)
 
String str (unsigned short value)
 
String str (long value)
 
String str (unsigned long value)
 
String str (double value)
 
String str (Socket &so, size_t size)
 
ucs4_tstrudup (const char *string)
 
ucs2_tstrwdup (const char *string)
 
template<typename T >
void swap (T &o1, T &o2)
 Convenience function to swap objects. More...
 
template<>
void swap< string_t > (string_t &s1, string_t &s2)
 
template<typename T >
typeref< T > typeref_cast (T x)
 
template<typename T >
void zero_unsafe (T &object)
 Convenience function to zero an object and restore type info. More...
 
void zerofill (void *addr, size_t size)
 

Variables

class __attribute__((visibility("default"))) Conditional class __attribute__((visibility("default"))) ConditionalAccess class __attribute__((visibility("default"))) ConditionalLock class __attribute__((visibility("default"))) Barrier class __attribute__((visibility("default"))) Semaphore typedef ConditionalLock condlock_t
 The conditional is a common base for other thread synchronizing classes. More...
 
class __attribute__((visibility("default"))) DateTime class __attribute__((visibility("default"))) DateTimeString class __attribute__((visibility("default"))) DateNumber class __attribute__((visibility("default"))) isotime typedef DateTime datetime_t