In the “lout” directory, there are some common base functionality for C++. Most is described as doxygen comments, this text gives an overview.
Common Base Class
Many classes are derived from lout::object::Object, which defines some general methods. See there for more information.
For the case, that you need primitive C++ types, there are some wrappers:
C++ Type | Wrapper Class |
---|---|
void* | lout::object::Pointer |
specific pointer | lout::object::TypedPointer (template class) |
int | lout::object::Integer |
const char* | lout::object::ConstString |
char* | lout::object::String |
Containers
In the namespace lout::container, several container classes are defined, which all deal with instances of lout::object::Object.
Untyped Containers
In lout::container::untyped, there are the following containers:
- lout::container::untyped::Vector, a dynamically increases array,
- lout::container::untyped::List, a linked list,
- lout::container::untyped::HashTable, a hash table, and
- lout::container::untyped::Stack, a stack.
All provide specific methods, but since they have a common base class, lout::container::untyped::Collection, they all provide iterators, by the method lout::container::untyped::Collection::iterator.
Typed Containers
lout::container::typed provides wrappers for the container classes defined in lout::container::untyped, which are more type safe, by using C++ templates.
Signals
For how to connect objects at run-time (to reduce dependencies), take a look at the lout::signal namespace.
There is also a base class lout::signal::ObservedObject, which implements signals for deletion.
Debugging
In debug.hh, there are some some useful macros for debugging messages, see the file for mor informations.
Identifying Classes at Runtime
If the class of an object must be identified at runtime, lout::identity::IdentifiableObject should be used as the base class, see there for more details.
Miscellaneous
The lout::misc namespace provides several miscellaneous stuff:
- In some contexts, it is necessary to compare objects (less/greater), for this, also lout::misc::Comparable must be implemented. For example., lout::container::untyped::Vector::sort and lout::container::typed::Vector::sort cast the elements to lout::misc::Comparable. This can be mixed with lout::object::Object.
- lout::misc::SimpleVector, a simple, template based vector class (not depending on lout::object::Object) (a variant for handling a special case in an efficient way is lout::misc::NotSoSimpleVector),
- lout::misc::StringBuffer, class for fast concatenation of a large number of strings,
- lout::misc::BitSet implements a bitset.
- useful (template) functions (lout::misc::min, lout::misc::max), and
- some functions useful for runtime checks (lout::misc::assert, lout::misc::assertNotReached).
Generated on Mon Apr 6 2015 02:15:15 for Dillo by
