Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 1 | // Copyright (C) 2006-2010 David Sugar, Tycho Softworks. |
| 2 | // |
| 3 | // This file is part of GNU uCommon C++. |
| 4 | // |
| 5 | // GNU uCommon C++ is free software: you can redistribute it and/or modify |
| 6 | // it under the terms of the GNU Lesser General Public License as published |
| 7 | // by the Free Software Foundation, either version 3 of the License, or |
| 8 | // (at your option) any later version. |
| 9 | // |
| 10 | // GNU uCommon C++ is distributed in the hope that it will be useful, |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | // GNU Lesser General Public License for more details. |
| 14 | // |
| 15 | // You should have received a copy of the GNU Lesser General Public License |
| 16 | // along with GNU uCommon C++. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | /** |
| 19 | * Top level include file for the GNU uCommon C++ core library. |
| 20 | * This is the only include file you need to have in your sources; it |
| 21 | * includes the remaining header files. |
| 22 | * @file ucommon/ucommon.h |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * @short A portable C++ threading library for embedded applications. |
| 27 | * GNU uCommon C++ is meant as a very light-weight library to facilitate using |
| 28 | * C++ design patterns even for very deeply embedded applications, such as for |
| 29 | * systems using uclibc along with posix threading support. For this reason, |
| 30 | * uCommon disables language features that consume memory or introduce runtime |
| 31 | * overhead, such as rtti and exception handling, and assumes one will mostly |
| 32 | * be linking applications with other pure C based libraries rather than using |
| 33 | * the overhead of the standard C++ library and other class frameworks. |
| 34 | * |
| 35 | * uCommon by default does build with support for the bloated ansi standard c++ |
| 36 | * library unless this is changed at configure time with the --disable-stdcpp |
| 37 | * option. This is to assure maximum portability and will be used to merge |
| 38 | * uCommon with GNU Common C++ to form GNU Common C++ 2.0. Some specific |
| 39 | * features are tested for when stdc++ is enabled, and these will be used |
| 40 | * to add back in GNU Common C++ classes such as TCP Stream and serialization. |
| 41 | * |
| 42 | * uCommon introduces some Objective-C based design patterns, such as reference |
| 43 | * counted objects, memory pools, smart pointers, and offers dynamic typing |
| 44 | * through very light use of inline templates for pure type translation that are |
| 45 | * then tied to concrete base classes to avoid template instantiation issues. C++ |
| 46 | * auto-variable automation is also used to enable referenced objects to be |
| 47 | * deleted and threading locks to be released that are acquired automatically when |
| 48 | * methods return rather than requiring one to explicitly code for these things. |
| 49 | * |
| 50 | * uCommon depends on and when necessary will introduce some portable C |
| 51 | * replacement functions, especially for sockets, such as adding getaddrinfo for |
| 52 | * platforms which do not have it, or when threadsafe versions of existing C |
| 53 | * library functions are needed. Basic socket support for connecting to named |
| 54 | * destinations and multicast addresses, and binding to interfaces with IPV4 and |
| 55 | * IPV6 addresses is directly supported. Support for high resolution timing and |
| 56 | * Posix realtime clocks are also used when available. |
| 57 | * |
| 58 | * uCommon builds all higher level thread synchronization objects directly from |
| 59 | * conditionals. Hence, on platforms which for example do not have rwlocks, |
| 60 | * barriers, or semaphores, these are still found in uCommon. A common and |
| 61 | * consistent call methodology is used for all locks, whether mutex, rw, or |
| 62 | * semaphore, based on whether used for exclusive or "shared" locking. |
| 63 | * |
| 64 | * uCommon requires some knowledge of compiler switches and options to disable |
| 65 | * language features, the C++ runtime and stdlibs, and associated C++ headers. The |
| 66 | * current version supports compiling with GCC, which is commonly found on |
| 67 | * GNU/Linux, OS/X, BSD based systems, and many other platforms; and the Sun |
| 68 | * Workshop compiler, which is offered as an example how to adapt uCommon for |
| 69 | * additional compilers. uCommon may also be built with GCC cross compiling for |
| 70 | * mingw32 to build threaded applications for Microsoft Windows targets nativiely. |
| 71 | * |
| 72 | * The minimum platform support for uCommon is a modern and working posix |
| 73 | * pthread threading library. I further use a subset of posix threads to assure |
| 74 | * wider portability by avoiding more specialized features like process shared |
| 75 | * synchronization objects, pthread rwlocks and pthread semaphores, as these are |
| 76 | * not implemented on all platforms that I have found. Finally, I have |
| 77 | * eliminated the use of posix thread cancellation. |
| 78 | * @author David Sugar <dyfet@gnutelephony.org> |
| 79 | * @license GNU Lesser General Public License Version 3 or later |
| 80 | * @mainpage GNU uCommon C++ |
| 81 | */ |
| 82 | |
| 83 | #ifndef _UCOMMON_UCOMMON_H_ |
| 84 | #define _UCOMMON_UCOMMON_H_ |
| 85 | #include <ucommon/platform.h> |
| 86 | #include <ucommon/cpr.h> |
| 87 | #include <ucommon/atomic.h> |
| 88 | #include <ucommon/generics.h> |
| 89 | #include <ucommon/protocols.h> |
| 90 | #include <ucommon/object.h> |
| 91 | #include <ucommon/string.h> |
| 92 | #include <ucommon/counter.h> |
| 93 | #include <ucommon/numbers.h> |
| 94 | #include <ucommon/vector.h> |
| 95 | #include <ucommon/linked.h> |
| 96 | #include <ucommon/timers.h> |
| 97 | #include <ucommon/access.h> |
| 98 | #include <ucommon/memory.h> |
| 99 | #include <ucommon/mapped.h> |
| 100 | #include <ucommon/unicode.h> |
| 101 | #include <ucommon/datetime.h> |
| 102 | #include <ucommon/keydata.h> |
| 103 | #include <ucommon/bitmap.h> |
| 104 | #include <ucommon/socket.h> |
| 105 | #include <ucommon/thread.h> |
| 106 | #include <ucommon/containers.h> |
| 107 | #include <ucommon/fsys.h> |
| 108 | #include <ucommon/file.h> |
| 109 | #include <ucommon/buffer.h> |
| 110 | #include <ucommon/shell.h> |
| 111 | #include <ucommon/xml.h> |
| 112 | |
| 113 | #ifdef _UCOMMON_EXTENDED_ |
| 114 | #include <ucommon/stream.h> |
| 115 | #include <ucommon/persist.h> |
| 116 | #include <ucommon/stl.h> |
| 117 | #endif |
| 118 | |
| 119 | #endif |