source: nrEngine/include/Package.h @ 1

Revision 1, 2.9 KB checked in by art, 14 years ago (diff)
Line 
1/***************************************************************************
2 *                                                                         *
3 *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
4 *       mailto: <tevs@mpi-sb.mpg.de>                                      *
5 *                                                                         *
6 *   This program is free software; you can redistribute it and/or modify  *
7 *   it under the terms of the GNU General Public License as published by  *
8 *   the Free Software Foundation; either version 2 of the License, or     *
9 *   (at your option) any later version.                                   *
10 *                                                                         *
11 ***************************************************************************/
12
13#ifndef __PACKAGE_PLUGIN_H_
14#define __PACKAGE_PLUGIN_H_
15
16//----------------------------------------------------------------------------------
17// Includes
18//----------------------------------------------------------------------------------
19#include "Prerequisities.h"
20
21//----------------------------------------------------------------------------------
22// Redefine Export/Import Macros for win32 systems
23//----------------------------------------------------------------------------------
24#define _NRPackageExport
25
26#if NR_PLATFORM == NR_PLATFORM_WIN32
27
28        // first we define our own export/import macro
29        #if defined (BUILD_PLUGIN)
30        #   undef _NRPackageExport
31        #       define _NRPackageExport __declspec( dllexport )
32        #endif
33        #if defined (BUILD_PACKAGE)
34        #   undef _NRPackageExport
35        #       define _NRPackageExport
36        #endif
37       
38       
39        // if we built a binding, so we should import from engine's main dll
40        #if defined (BUILD_PACKAGE) || defined (BUILD_PLUGIN)
41        #   undef _NRExport
42        #       define _NRExport __declspec( dllimport )
43        #endif
44
45#endif
46
47
48//----------------------------------------------------------------------------------
49// Namespaces and classes
50//----------------------------------------------------------------------------------
51namespace nrEngine {
52
53        //! Package abstract classes for the engine
54        /**
55         * Packages are loadtime plugins provide to the engine
56         * new functionality. They do not linked within the engine library
57         * but with application written for the engine.
58         *
59         * This is an abstract class providing some default methods
60         * which has to be overwritten by the package. Later on we could
61         * create a package manager, so it could initialize the packages
62         * by user wish.
63         *
64         * \ingroup plugin
65         **/
66        class _NRPackageExport Package{
67                public:
68
69                        //! Initialize the binding and its subsystems
70                        Package() {}
71
72                        //! Release used memory and close binded subsystem
73                        virtual ~Package() {}
74
75                        //! Get the name of the binding
76                        virtual const std::string& getName() = 0;
77
78                        //! Get a full name including authors, version,... strings of the bindings
79                        virtual const std::string& getFullName() = 0;
80
81        };
82
83};
84
85#endif
86
Note: See TracBrowser for help on using the repository browser.