examples.cc

Go to the documentation of this file.
00001 //
00002 // $Id: examples.cc,v 1.7 2003/12/28 10:53:30 cholm Exp $
00003 //
00004 //      examples.cc 
00005 //      Copyright (C) 2003  Christian Holm <cholm@linux.HAL3000> 
00006 //   
00007 //      This library is free software; you can redistribute it and/or 
00008 //      modify it under the terms of the GNU Lesser General Public 
00009 //      License as published by the Free Software Foundation; either 
00010 //      version 2.1 of the License, or (at your option) any later version. 
00011 //   
00012 //      This library is distributed in the hope that it will be useful, 
00013 //      but WITHOUT ANY WARRANTY; without even the implied warranty of 
00014 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00015 //      Lesser General Public License for more details. 
00016 //   
00017 //      You should have received a copy of the GNU Lesser General Public 
00018 //      License along with this library; if not, write to the Free Software 
00019 //      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00020 //      02111-1307  USA  
00021 //
00022 /** @file   examples.cc
00023     @author Christian Holm
00024     @date   Thu Jan 30 10:56:10 2003
00025     @brief  Example documentation */
00026 
00027 /** @page examples Examples
00028  */
00029 /** @example tests/module1.cc 
00030     @par A simple module with a function. 
00031     This is used by the main.cc example. */
00032 
00033 /** @example tests/module2.cc 
00034     @par A simple module with a function. 
00035     This is used by the main.cc example. */
00036 
00037 /** @example tests/simple.cc 
00038     @par A very simple example of how to use the classes.
00039     This just opens @c libm.so, and finds the symbol @c cos, and
00040     executes it with an argument of 0, and prints the result.  Not
00041     very interesting, but it surfice to show the main functionality of
00042     the classes. */
00043 
00044 /** @example tests/super.cc 
00045     @par Test of all basic features. 
00046     This example is a test of all the basic features of @b Libtool--.
00047     It loads two modules module1.cc and module2.cc and calls a
00048     function (with C linkage) from module1.cc. It also uses
00049     ltmm::loader<Lock>::foreach and
00050     ltmm::loader<Lock>::iterator to list the loaded modules. */ 
00051 
00052 /** @example tests/object.hh 
00053     @par Abstract Base Classes for factory.cc example. 
00054     This header defines two ABCs for the factory.cc example: the class
00055     @c object that is the root of the hierarchy, and @c factory that
00056     is an abstract create of concrete sub-class of the @c object
00057     class. */
00058 
00059 /** @example tests/myobject.cc
00060     @par Concrete @c object and @c factory classes. 
00061     This defines two concrete classes used by the factory.cc example:
00062     The clas @c myobject which subclasses @c object, and @c myfactory
00063     which subclasses factory.  The latter creates objects of the
00064     former.  Also defined is the function @c myfactory_init (with C
00065     linkage) that the factory.cc example looks for in the loaded
00066     module.  It creates a (singleton) object of the @c myfactory
00067     class. */ 
00068 
00069 /** @example tests/factory.cc
00070     @par Example of using a factory to create objects. 
00071     This example uses the interface of @c object, and @c factory to
00072     dynamically create objects of usre defined subclasses of 
00073     @c object.  The example loads the module from myobject.cc, creates
00074     a @c myfactory object, and then use that object to create a
00075     concrete @c object (@c myobject), and calls the member functon 
00076     @c print on it.  It shows how to dynamically load classes from a
00077     dynamically loaded library.  Also shown, is how to call an
00078     arbitrary member function of the concrete classes via the factory
00079     interface.  Of course, the coolest thing would be if the factory
00080     could be generated automatically - however, for that to happen,
00081     one need a full C++ parser which is outside the scope of the
00082     package. */
00083 
00084 /** @example tests/arbitrary.hh
00085     @par Abstract Base Class Factory to interface an arbitrary class. 
00086     This class provides the interface for calling an arbitrary member
00087     function of an arbitriary class.  The concrete implementations
00088     must devise a way to call the actual member functions. 
00089     @see @link tests/fancy.cc fancy.cc @endlink 
00090 */
00091 
00092 /** @example tests/fancy.cc
00093     @par A class without hierarchy root, and it's factory interface. 
00094     This provides a concrete implementation of an 
00095     @c arbitrary_factory.  It uses template member functions to
00096     resolve the member function calls. 
00097 */
00098 
00099 /** @example tests/mybackend.cc 
00100     @par Example of custom backend module loader.  This shows how to
00101     use the custom backend layer for module loaders.  It tests all of
00102     the features of the backend part, including iteration, and getting
00103     a reference to ltmm::internal_backend<ThreadPolicy> object for the
00104     build in module loaders defined by libltdl. */
00105 #error This file is not for compilation
00106 //
00107 // EOF
00108 //
Top of page
Last update Mon Jun 27 13:24:49 2005
Christian Holm
Created by DoxyGen 1.4.3-20050530