Adapted to recent changes of %build_linklib.
[AROS-Contrib.git] / FryingPan / framework / Generic / LibrarySpool.h
blob768aebb2f25e47ed43fd297d3ab610d4588dae72
1 /*
2 * Amiga Generic Set - set of libraries and includes to ease sw development for all Amiga platforms
3 * Copyright (C) 2001-2011 Tomasz Wiszkowski Tomasz.Wiszkowski at gmail.com.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _LIBRARYSPOOL_H_
21 #define _LIBRARYSPOOL_H_
22 #include "Generic.h"
24 /**
25 * \file LibrarySpool.h
26 * \brief This class handles the library manipulation - actually very much reduced due to recent implementations. \b Deprecated.
27 * \details This file defines a very very basic singleton object that frees you from opening the four libraries:
28 * - Exec
29 * - DOS
30 * - Intuition
31 * - Utility
33 * on your own. Since it is a singleton, you will want to call it as:
34 * \code LibrarySpool::Init(); \endcode
35 * at the beginning of your code and then - when you're done - just call
36 * \code LibrarySpool::Exit(); \endcode
37 * \n
38 * As this class is deprecated, you should access the libraries you need yourself by using:
39 * \code
40 * // declare the bases:
41 * class ExecIFace *Exec;
42 * class DOSIFace *DOS;
43 * class IntuitionIFace *Intuition;
44 * class UtilityIFace *Utility;
46 * ...
48 * // open the libraries at the beginning of your code
49 * Exec = ExecIFace::GetInstance();
50 * DOS = DOSIFace::GetInstance(37);
51 * Intuition = IntuitionIFace::GetInstance(37);
52 * Utility = UtilityIFace::GetInstance(37);
54 * // do your stuff here..
56 * // close the libraries at the end
57 * Utility->FreeInstance();
58 * Intuition->FreeInstance();
59 * DOS->FreeInstance();
60 * Exec->FreeInstance();
61 * \endcode
64 //! Utility library access interface
65 extern class UtilityIFace *Utility;
66 //! DOS library access interface
67 extern class DOSIFace *DOS;
68 //! Exec library access interface
69 extern class ExecIFace *Exec;
70 //! Intuition library access interface
71 extern class IntuitionIFace *Intuition;
73 namespace GenNS
75 /**
76 * \class LibrarySpool
77 * \brief Singleton object - Use method ::Init() to initialize library bases and obtain the pointer to the object.
78 * Use method ::Exit() to clean up libraries and free the object.
79 * Class is \b deprecated.
81 class LibrarySpool
83 static LibrarySpool *LibSpool;
85 protected:
86 LibrarySpool();
87 virtual ~LibrarySpool();
89 public:
90 /**
91 * \fn static LibrarySpool *Init();
92 * Use this method at the beginning of your code to initialize library access interfaces and obtain the pointer to the singleton object.
93 * Do \b NOT call more than once.
95 static LibrarySpool *Init();
97 /**
98 * \fn static void Exit();
99 * Use this method at the end of your code to dispose library access interfaces and the class itself.
100 * Do \b NOT call more than once.
102 static void Exit();
105 #endif //_LIBRARYSPOOL_H_