Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages

# FactoryC.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        FactoryC.h
    00004 // Desc:        Plugin Class Factory class.
    00005 // Author:      memon <memon@inside.org>
    00006 //
    00007 //-------------------------------------------------------------------------
    00008 //  Copyright (c) 2000-2002 Moppi Productions. All Rights Reserved.
    00009 //  This file is part of Moppi Demopaja SDK. For conditions of
    00010 //  distribution and use, see the accompanying license.txt file.
    00011 //  http://moppi.inside.org/demopaja/
    00012 //-------------------------------------------------------------------------
    00013
    00014 #ifndef __DEMOPAJA_FACTORY_H__
    00015 #define __DEMOPAJA_FACTORY_H__
    00016
    00017 #include "DllInterfaceC.h"
    00018 #include "ClassDescC.h"
    00019 #include <vector>
    00020 #include <string>
    00021
    00022
    00023 namespace PluginClass {
    00024
    00026
    00031     class FactoryC
    00032     {
    00033     public:
    00035         FactoryC();
    00036
    00038         virtual ~FactoryC();
    00039
    00041         virtual void                load_plugins( const char* szDir );
    00042
    00044         virtual void                register_class( ClassDescC* pClass );
    00045
    00047         virtual void*               create( const ClassIdC& rClassId );
    00048
    00050         virtual PajaTypes::uint32   get_classdesc_count();
    00051
    00053         virtual ClassDescC*         get_classdesc( PajaTypes::uint32 );
    00054
    00056         virtual ClassDescC*         get_classdesc( const ClassIdC& rClassId );
    00057
    00059         virtual const char*         get_classdesc_dll_name( PajaTypes::uint32 );
    00060
    00061     private:
    00062         struct DLLClassS {
    00063             ClassDescC* m_pClassDesc;
    00064             std::string m_sClassDescDllName;
    00065         };
    00066         std::vector<DllInterfaceC*> m_rDlls;
    00067         std::vector<DLLClassS>      m_rDLLClasses;
    00068     };
    00069
    00070 }; // namespace
    00071
    00072
    00073 #endif // __DEMOPAJA_FACTORY_H__