Chapter 7. Library architecture

Table of Contents

7.1. Source file organisation
7.2. Source code layers
7.3. Deployment file organisation
7.3.1. Mac OS X
7.3.2. Windows
7.3.3. POSIX

7.1. Source file organisation

The serialization library's files are organised as follows:

<distribution-root> - autoconf/automake/libtool scripts for building on POSIX systems
|
+---- ccs/          - header files of the library
|
+---- src/          - source files of the library
|
+---- test/         - test programs/data to ensure correctness
|
+---+ doc/          - source (in DocBook5) and rendered documentation (in HTML/PDF)
|   |
|   +---- pdf/      - final/rendered documentation in PDF format
|   |
|   +---- html/     - final/rendered documentation in HTML format
|   |
|   +---- src/      - source in DocBook5 format, scripts to build PDF/HTML
|
+---- proj_mac/     - project files for Mac OS X 10.4 / Xcode 2.4
|
+---- proj_win/     - project files for Windows XP / Visual C++ 2005/2008
|
+---- build/        - recommended directory for building the library on POSIX systems

Because the library requires other libraries such as SQLite3, the header and library files for those other libraries will need to be installed on the development machine, and the paths to those files may need to be set up so that the serialization library can be built. Details on this process are in the 'Building the library' section of the 'Using the library' chapter.

Here is a sample development machine for Mac OS X or Windows:

/path/to/user/home/directory/
|
+---+ dev/
    |
    +---- <distribution-root>           (as shown above)
    |
    +---+ sqlite-amalgamation-3_5_7/    (from the sqlite amalgamation distribution)
    |   |
    |   +---- sqlite3.h
    |   +---- sqlite3.c
    |   +---- sqlite3ext.h
    |
    +---+ loki-0.1.6/                   (from the loki distribution)
    |   |
    |   +---- include/
    |   +---- lib/
    |   +---- src/
    |   +---- test/
    |   +---- (etc.)
    |
    +---+ boost_1_33_1/                 (from the boost distribution)
    |   |
    |   +---- boost/
    |   +---- doc/
    |   +---- libs/
    |   +---- (etc.)
    |
    +---+ tbb20_20080408oss_src/        (from the Intel TBB distribution)
        |
        +---- build/
        +---- include/
        +---- src/
        +---- (etc.)

On POSIX systems, after building and installing the library (using a 'make install'), the /usr/local/include and /usr/local/lib directories will also include the headers and libraries for the serialization library; the headers will be in /usr/local/include/ccs/. Here is a sample development machine for a POSIX system:

/home/<user-home-directory>/
|
+---+ dev/
    |
    +---- <distribution-root>   (as shown above)

/usr/local/             (third party libraries are often placed in this directory)
|
+---+ include/
|   |
|   +---- sqlite3.h
|   |
|   +---+ loki/         (from loki-0.1.6/include/ in the loki distribution)
|   |   |
|   |   +---- TypeTraits.h
|   |   +---- (etc.)
|   |
|   +---+ boost/        (from boost_1_33_1/ in the boost distribution)
|   |   |
|   |   +---- type_traits.hpp
|   |   +---- (etc.)
|   |
|   +---+ tbb/          (from tbb20_20080408oss_src/include/ in the TBB distribution)
|       |
|       +---- concurrent_vector.h
|       +---- (etc.)
|
+---+ lib/
    |
    +---- libsqlite.so
    +---- libloki.so
    +---- libboost.so
    +---- libtbb.so