[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

registry.h

00001 /*
00002  *  AE Engine
00003  *
00004  *  Copyright (C) 2003 Riku "Rakkis" Nurminen
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __AELIB_AEREG_REGISTRY_H__
00023 #define __AELIB_AEREG_REGISTRY_H__
00024 
00025 #define ONLY_INCLUDE_STD
00026 #include <aedefs.h>
00027 #undef ONLY_INCLUDE_STD
00028 #include <aeengine/engine.h>
00029 #include <aegeom/object.h>
00030 #include <aegfx/material.h>
00031 #include <aegfx/texture.h>
00032 #include <aeplugin/plugin.h>
00033 #include <aereg/base.h>
00034 #include <aesys/system.h>
00035 #include <aesys/timer.h>
00036 
00042 
00043 
00048 enum aeInterface {
00049         AE_INTERFACE_aeEngine,
00050         AE_INTERFACE_aeModelLoader,
00051         AE_INTERFACE_aeRegistry,
00052         AE_INTERFACE_aeRenderer,
00053         AE_INTERFACE_aeSystem,
00054         AE_INTERFACE_aeTerrman,
00055         AE_INTERFACE_aeTextureLoader,
00056         AE_INTERFACE_aeTimer
00057 };
00058 
00066 
00067 #define QUERYINTERFACE(Registry, Interface) (Interface *)Registry->queryInterface(AE_INTERFACE_##Interface)
00068 
00076 
00077 typedef aePlugin *(*PLG_ENTRY)(aeRegistry *aeReg);
00078 
00081 class aeSystem;
00082 
00086 class aeRegistry: public aeBase {
00087         AECF_CNDEF
00088 
00089  private:
00090         aeBaseptr_map interfacePool;
00091         aeObjectptr_map objectPool;
00092         aeMaterialptr_map materialPool;
00093         aeTextureptr_map texturePool;
00094         bool cmdLineHelpRequested;
00095 
00096  public:
00103         aeRegistry(int argc, char *argv[]);
00104         ~aeRegistry();
00105 
00107         static aeRegistry *self_ptr;
00108 
00114         bool checkCmdLineHelp() const { return cmdlinehelp; }
00115 
00119         void printHelp();
00120 
00129         aeBase *queryInterface(aeInterface interface);
00130 
00136         unsigned int getInterfaceCount() const { return interfacePools.size(); }
00137 
00145         aeObject *findObjectByName(const char *);
00146 
00152         unsigned int getObjectCount() const { return objectpool.size(); }
00153 
00161         aeTexture *findTextureByName(const char *);
00162 
00168         unsigned int getTextureCount() const { return texturepool.size(); }
00169 
00177         aeMaterial *findMaterialByName(const char *);
00178 
00184         unsigned int getMaterialCount() const { return materialpool.size(); }
00185 
00192         void pushObjectToPool(aeObject *);
00193 
00200         void pushTextureToPool(aeTexture *);
00201 
00208         void pushMaterialToPool(aeMaterial *);
00209 
00218         aePlugin *loadPlugin(aeInterface);
00219 };
00220 
00221 #endif // __AELIB_AEREG_REGISTRY_H__

AE Engine Public API Reference
Generated on Wed Apr 9 09:43:40 2003 by Doxygen.