|
Readline-- Documentation
2.0.8This package implements a full GNU Readline interface in C++. The API is quite simple and makes heavy use of templated container, standard classes and so on. The idea is that a C++ developer should fell resonabily comfortable with the library API. OverviewThe C library API function have been split into various class templates that deal with one specific topic. Each template takes on parameter, the thread locking type.
In addition, there's a number of utility classes and class templates
Stream interface.Use the library as a regularstd::istream . This makes the code very transparent, and easy to plug into other kinds of applications that accepts an std::istream as the input method. See also the streamer example Thread safetyThread safety is implemented in the class templates via a template parameter. This parameter should be a class that defines the member functionslock() and unlock() . The semantics of these member functions, is that the lock() member function should lock a specific syncronisation objet, like a mutex or CriticalSection . Similarly the unlock() member function should release the lock of the underlying sycronisation oject.An example for POSIX threads could be #include <pthread.h> class posix_lock { private: pthread_mutex_t _mutex; public: posix_lock() { pthread_mutex_init(&_mutex, NULL); } ~posix_lock() { pthread_mutex_destroy(&_mutex); } void lock() { pthread_mutex_lock(&_mutex); } void unlock() { pthread_mutex_unlock(&_mutex); } }; Note, that the class lilbrary provides the class rlmm::single_thread that does no locking what so ever. Singletons and `One at a time' classesA number of class templates in the library are singletons. That is, only one such object can exists at a given time. The object is accessed via <class>instance() , which returns a reference to the object. Singletons in the library is implemented via the utility class rlmm::singleton.Singletons in the library are
For a number of the class templates in the library, only one object can be active at given time. These are termed `one at a time' classes in the library. A given object is made active by the member function `One at a time' class templates in the library are: Top of pageLast update Fri Aug 26 15:19:46 2005 Christian Holm Created by DoxyGen 1.4.4 |