UCommon
|
Common namespace for all ucommon objects. More...
Data Structures | |
class | _stream_operators |
At least with gcc, linking of stream operators was broken. More... | |
class | array_pointer |
Generic smart array class. More... | |
class | array_reuse |
An array of reusable types. More... | |
class | ArrayReuse |
An array of reusable objects. More... | |
class | Atomic |
Generic atomic class for referencing atomic objects and static functions. More... | |
class | AutoObject |
A general purpose smart pointer helper class. More... | |
class | AutoProtect |
Guard class to apply scope based mutex locking to objects. More... | |
class | autorelease |
Create a linked list of auto-releasable objects. More... | |
class | Barrier |
A portable implementation of "barrier" thread sychronization. More... | |
class | charbuf |
A template to create a character array that can be manipulated as a string. More... | |
class | cidr |
A class to hold internet segment routing rules. More... | |
class | Cipher |
A generic data ciphering class. More... | |
class | Conditional |
The conditional is a common base for other thread synchronizing classes. More... | |
class | ConditionalAccess |
The conditional rw seperates scheduling for optizming behavior or rw locks. More... | |
class | ConditionalLock |
An optimized and convertable shared lock. More... | |
class | ConditionMutex |
Condition Mutex to pair with conditionals. More... | |
class | ConditionVar |
The condition Var allows multiple conditions to share a mutex. More... | |
class | CountedObject |
A base class for reference counted objects. More... | |
class | counter |
Automatic integer counting class. More... | |
class | Date |
The Date class uses a julian date representation of the current year, month, and day. More... | |
class | DateNumber |
A number class that manipulates a string buffer that is also a date. More... | |
class | DateTime |
The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. More... | |
class | DateTimeString |
A DateTime string class. More... | |
class | DetachedThread |
A detached thread object that is stand-alone. More... | |
class | Digest |
A cryptographic digest class. More... | |
class | dir |
Convenience class for directories. More... | |
class | DirPager |
Directory pager is a paged string list for directory file names. More... | |
class | DLinkedObject |
A double linked list object. More... | |
class | dso |
Convenience class for library plugins. More... | |
class | ExclusiveProtocol |
An exclusive locking protocol interface base. More... | |
class | filestream |
Streamable file class based on low level fsys io. More... | |
class | fsys |
A container for generic and o/s portable threadsafe file system functions. More... | |
class | HMAC |
A cryptographic message authentication code class. More... | |
class | imemstream |
Stream class to read from a memory buffer. More... | |
class | InputProtocol |
Used for processing input. More... | |
class | JoinableThread |
A child thread object that may be joined by parent. More... | |
class | keydata |
Data keys parsed from a keyfile. More... | |
class | keyfile |
Traditional keypair config file parsing class. More... | |
class | KeyProtocol |
Key data protocol used for things like maps and ordered lists. 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_sockaddr_operations |
Helper class for linked_pointer template. More... | |
class | linked_value |
Template value class to embed data structure into a linked list. More... | |
class | LinkedObject |
Common base class for all objects that can be formed into a linked list. More... | |
class | ListenSocket |
A bound socket used to listen for inbound socket connections. More... | |
class | LockingProtocol |
Common locking protocol. More... | |
class | mapped_array |
Template class to map typed vector into shared memory. 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 | MappedMemory |
Construct or access a named section of memory. More... | |
class | MappedReuse |
Map a reusable allocator over a named shared memory segment. More... | |
class | memalloc |
A memory protocol pager for private heap manager. More... | |
class | MemoryRedirect |
A redirection base class for the memory protocol. More... | |
class | mempager |
A managed private heap for small allocations. More... | |
class | memstring |
A string class that uses a cstring buffer that is fixed in memory. More... | |
class | Mutex |
Generic non-recursive exclusive lock class. More... | |
class | NamedObject |
A linked object base class with members found by name. More... | |
class | NamedTree |
The named tree class is used to form a tree oriented list of associated objects. More... | |
class | Number |
A number manipulation class. More... | |
class | object_pointer |
Typed smart pointer class. More... | |
class | ObjectProtocol |
A common base class for all managed objects. More... | |
class | omemstream |
Stream class to write to memory buffer. More... | |
class | OrderedIndex |
An index container for maintaining an ordered list of objects. More... | |
class | OrderedObject |
A linked object base class for ordered objects. More... | |
class | paged_reuse |
A reusable private pool of reusable types. More... | |
class | pager |
Mempager managed type factory for pager pool objects. More... | |
class | PagerObject |
This is a base class for objects that may be created in pager pools. More... | |
class | PagerPool |
Pager pool base class for managed memory pools. More... | |
class | PagerReuse |
A mempager source of reusable objects. More... | |
class | pipestream |
Streamable pipe socket connection. More... | |
class | pointer |
Generic smart pointer class. More... | |
class | PrintProtocol |
Used for forming stream output. More... | |
class | Random |
Cryptographically relevant random numbers. More... | |
class | RecursiveMutex |
Portable recursive exclusive lock. More... | |
class | ReusableAllocator |
Class for resource bound memory pools between threads. More... | |
class | ReusableObject |
Reusable objects for forming private heaps. More... | |
class | RWLock |
A generic and portable implementation of Read/Write locking. 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 | secure |
Common secure socket support. More... | |
class | Semaphore |
A portable counting semaphore class. More... | |
class | SeqCounter |
Automatically return a sequence of untyped objects. More... | |
class | sequence |
A template to return a sequence of objects of a specified type. More... | |
class | shared_access |
A kind of smart pointer object to support shared locking protocol. More... | |
class | SharedProtocol |
An exclusive locking access interface base. More... | |
class | shell |
A utility class for generic shell operations. More... | |
class | Socket |
A generic socket base class. More... | |
class | SparseObjects |
A sparse array of managed objects. More... | |
class | sstream |
Secure socket using std::iostream. More... | |
class | StreamBuffer |
Common stream buffer for std C++ i/o classes. More... | |
class | String |
A copy-on-write string class that operates by reference count. More... | |
class | stringbuf |
A string class that has a predefined string buffer. More... | |
class | StringPager |
String pager for storing lists of NULL terminated strings. More... | |
class | TCPServer |
A generic tcp server class. More... | |
class | tcpstream |
Streamable tcp connection between client and server. More... | |
class | temporary |
Manage temporary object stored on the heap. More... | |
class | Thread |
An abstract class for defining classes that operate as a thread. More... | |
class | Time |
The Time class uses a integer representation of the current time. More... | |
class | TimedEvent |
Event notification to manage scheduled realtime threads. More... | |
class | Timer |
Timer class to use when scheduling realtime events. More... | |
class | TimerQueue |
A timer queue for timer events. More... | |
class | toggle |
Automatically toggle a bool on each reference. More... | |
class | treemap |
Embed data objects into a tree structured memory database. More... | |
class | TypeRef |
Smart pointer base class for auto-retained objects. More... | |
class | UString |
A copy-on-write utf8 string class that operates by reference count. More... | |
class | utf8 |
A core class of ut8 encoded string functions. More... | |
class | utf8_pointer |
Pointer to utf8 encoded character data. More... | |
class | ZNumber |
A number manipulation class that maintains a zero lead filled string. 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 ConditionalLock | condlock_t |
Convenience type for using conditional locks. | |
typedef counter | counter_t |
A convenience typecast for integer counters. | |
typedef Date | date_t |
Convenience type for using Date object. | |
typedef DateTime | datetime_t |
Convenience type for using DateTime 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 fsys | fsys_t |
Convience type for fsys. | |
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 Number | number_t |
A convenience type for number. | |
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 shell | shell_t |
Convenience type to manage and pass shell objects. | |
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 TimedEvent | timedevent_t |
Convenience type for using timed events. | |
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 TimerQueue::event | TQEvent |
A convenience type for timer queue timer events. | |
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 | |
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 > | |
void | clearmem (T &var) |
template<typename T > | |
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 | getline (std::istream &in, char *buffer, size_t size) |
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 > | |
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) |
bool | putline (std::ostream &out, const char *buffer) |
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_t * | strudup (const char *string) |
ucs2_t * | strwdup (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) |
unicode_t | unidup (const char *string) |
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 | |
TypeRelease | auto_release |
TypeRelease | release_later |
TypeRelease | secure_release |
Common namespace for all ucommon objects.
We are using a common namespace to easily separate ucommon from other libraries. This namespace usage is set to the package name and controlled by macros so future changes will be hidden from user applications so long as the namespace macros (UCOMMON_NAMESPACE, NAMESPACE_UCOMMON, END_NAMESPACE) are used in place of direct namespace declarations.
typedef int16_t ucommon::ucs2_t |
typedef int32_t ucommon::ucs4_t |
|
inline |
Invoke translation lookup if available.
This can also be used to mark text constants that need to be translated. It should not be used with pointer variables, which should instead call shell::text directly. The primary purpose is to allow extraction of text to be internationalized with xgettext "--keyword=_TEXT:1".
Definition at line 908 of file shell.h.
|
inline |
|
inline |
|
inline |
|
inline |
Convenience function to check memory arrays.
pointer | to validate. |
base | address of array. |
count | of objects. |
Definition at line 430 of file generics.h.
|
inline |
Convenience function to copy class.
target | to copy into. |
source | to copy from. |
Definition at line 367 of file generics.h.
|
inline |
Convert a pointer to a reference with type checking.
This is mostly convenience for documenting behavior.
pointer | to convert. |
Definition at line 479 of file generics.h.
|
inline |
Convenience function to duplicate object pointer to heap.
object | we are duping. |
Definition at line 324 of file generics.h.
|
inline |
|
inline |
|
inline |
Compare two string objects if equal.
The left string is an object, the right may be an object or converted to a const string. The compare virtual method of the left object is used, so we can do things like collation order or derived class specific sorting.
s1 | string to compare. |
s2 | string to compare. |
Definition at line 1668 of file string.h.
|
inline |
Compare two socket addresses to see if equal.
If the port is zero then this is the same as comparing host address alone.
s1 | socket address to compare. |
s2 | socket address to compare. |
Definition at line 2100 of file socket.h.
|
inline |
Compare two stored socket addresses to see if equal.
If the port is zero then this is the same as comparing host address alone.
s1 | stored socket address to compare. |
s2 | stored socket address to compare. |
Definition at line 2111 of file socket.h.
|
inline |
Compare two null terminated strings if equal ignoring case.
This is related to stricmp or gcc strcasecmp.
s1 | string to compare. |
s2 | string to compare. |
Definition at line 1699 of file string.h.
|
inline |
Compare two null terminated strings if equal for a specified size ignoring case.
This is related to stricmp or gcc strcasecmp.
s1 | string to compare. |
s2 | string to compare. |
size | of string to compare. |
Definition at line 1713 of file string.h.
|
inline |
|
inline |
Convenience function to validate object assuming it is castable to bool.
object | we are testing. |
Definition at line 292 of file generics.h.
|
inline |
Convenience function to test pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
object | we are testing. |
Definition at line 303 of file generics.h.
|
inline |
Convenience function to test pointer-pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
object | we are testing. |
Definition at line 314 of file generics.h.
|
inline |
Convenience macro to range restrict values.
value | to check. |
low | value. |
high | value. |
Definition at line 468 of file generics.h.
|
inline |
|
inline |
Convenience function to return max of two objects.
o1 | to check. |
o2 | to check. |
Definition at line 445 of file generics.h.
|
inline |
|
inline |
Convenience function to return min of two objects.
o1 | to check. |
o2 | to check. |
Definition at line 456 of file generics.h.
|
inline |
Convenience function to reset an existing object.
object | type to reset. |
Definition at line 348 of file generics.h.
|
inline |
Convenience function to store object pointer into object.
target | to copy into. |
source | to copy from. |
Definition at line 377 of file generics.h.
|
inline |
Convenience function to swap objects.
Can be specialized.
o1 | to swap. |
o2 | to swap. |
Definition at line 387 of file generics.h.
|
inline |
Convenience function to zero an object and restore type info.
object | to zero in memory. |
Definition at line 357 of file generics.h.