Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Elm Documentation

ELM is a multi-purpose library used by the OTAWA project (http://www.otawa.fr). It provides :

  • generic data structures,
  • generic interface with te operating system (files, command line, etc),
  • a checked plugin system,
  • efficient string class,
  • other utility classes.

Please take a look at the module part for detailed description.

Type Facilities

ELM provides a lot of OS-independent simple and reliable types in Integer Operations together with efficient complex integer functions.

The Character String module provides several class to manage strings: C-string wrapper (elm::CString), mostly 0 cost substring extraction, fast and light string class (elm::String), string buffer (elm::StringBuffer) to build strings and automatic string building class (elm::AutoString) with very handy syntax (_ << a1 << a2 << ...).

Facilities to handle efficiently are also provided in Array.

The Type Support module provides RTTI support to handle types easily. Used with the <elm/meta.h> primitives, it allows to build powerful template classes and functions.

Data Structures

One goal of ELM is to provide very powerful and efficient data structures. They includes:

All these classes share the same syntax for iterators:

DataStructure<MyType> data_structure;
...
for(DayaStructure<MyType>::Iterator iter; iter; iter++)
process(*iter);

A whole bunch of ordered sets comparators (elm::Comparator) or hashing algorithms (elm::HashKey) are proposed by ELM but they can also be specialized for your own types.

To make easier the use of data structure and allows inter-operations, each one implements a set of interfaces known in C++ as concepts (module Concepts).

Finally, ELM provides convenient classes for data handling: elm::Pair, elm::Option.

Input-Output System

The Input / Output System module is split in two layers. The higher layer (classes elm::io::Output and elm::io::Input) are responsible for format-aware input / output (mostly equivalent to STL istream / ostream). They provide formatter class (elm::io::IntFormat and elm::io::FloatFormat) to fine-tune their work. The IO errors are processed by rising exceptions.

The lower layer handles input-output as a stream of bytes but the provided classes allows to pipe efficiently these classes together, offering a significant potential of control on the streams. All stream classes implement either the elm::io::InStream or elm::io::OutStream and supports error handling through synchronized error return. Both allows to get the OS-error message from getLastError() method.

Basically, input stream and output stream gives access to the OS streams but other classes allows to buffer IO (elm::io::BufferedInStream or elm::io::BufferedOutStream), to use block of data as streams (elm::io::BlockInStream, elm::io::BlockOutStream), to compute checksums (elm::checksum::Fletcher; elm::checksum::MD5). In addition, input and output stream can piped with the elm::io::StreamPipe or diverted with elm::io::TeeOutStream.

Portability Features

ELM implements also several classes to abstract the host OS. The following features have been tested on Linux, Windows and MacOSX:

In the future, classes to handle threads and sockets will be added.

Memory Management

ELM supplies several classes to handle allocation and de-allocation:

And some cleanup classes or pointer management classes (elm::AutoCleaner, elm::AutoDestructor, AutoPtr).

Other Facilities