GweSimpleController.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 - 2006 by Raphael Langerhorst                      *
00003  *   raphael-langerhorst@gmx.at                                            *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00023  ***************************************************************************/
00024 
00025 
00026 #ifndef GWEINTERFACESIMPLEH
00027 #define GWEINTERFACESIMPLEH
00028 
00029 
00030 #include <GweController.h>
00031 #include <GDataController.h>
00032 
00033 #include <GMatrix44.h>
00034 
00035 #include <QMutex>
00036 
00037 #include <QList>
00038 
00039 
00040 namespace GWE
00041 {
00042 
00043 class GweSimpleDataController : public GDataController
00044 {
00045   Q_OBJECT
00046   private:
00047   
00053     QList<GCS::GElement*> Elements;
00054     
00059     QMutex* ElementListMutex;
00060     
00061   protected:
00062     
00067     GCS::GElement* getElement(const GCS::GElementID& id) const;
00068   
00069   public:
00070   
00074     GweSimpleDataController();
00075   
00079     virtual ~GweSimpleDataController();
00080     
00081     // GDataController implementation //
00082     
00083     virtual const GCS::GElement* read(const GCS::GElementID&) const;
00084     
00085     virtual QList<GCS::GElementID> getChildren(const GCS::GElementID& parent) const;
00086     
00087     virtual GCS::GElement* open(const GCS::GElementID&);
00088     
00089     virtual GCS::GElement* getOpenElement(const GCS::GElementID& );
00090 
00091     virtual QList<GCS::GElementID> getListOfOpenElements();
00092 
00093     virtual QList<GCS::GElementID> getListOfAllElements();
00094     
00095   public slots:
00096     
00097     virtual bool add(GCS::GElement* );
00098     
00099     virtual bool writeOpenElementToStorage(const GCS::GElementID& );
00100     
00101     virtual bool close(const GCS::GElementID& );
00102     
00103     virtual bool postDelete(const GCS::GElementID& );
00104 
00105     virtual void shutdown();
00106 
00107 };
00108 
00109 
00125 class GweSimpleController : public GweController
00126 {
00127   Q_OBJECT
00128   
00129   public:
00130   
00134     GweSimpleController();
00135   
00139     virtual ~GweSimpleController();
00140     
00141   protected slots:
00142   
00143   // new element registration and element removal //
00144   
00148     void connectElement(const GCS::GElementID& );
00149   
00150   // note that the source of these signals are active agents;
00151   
00156     virtual void newElementCreated(GCS::GElement* element);
00157     
00162     virtual void elementRemoved(const GCS::GElementID& ID);
00163     
00172     virtual void elementReparented(GCS::GElement* element, const GCS::GElementID& oldParent, const GCS::GElementID& newParent);
00173     
00174         
00175   public slots:
00176         
00177     // INFLUENCE MANAGEMENT //
00178   
00184 //     virtual void radiateInfluence(GCS::GElementInfluence& influence);
00185     
00189 //     virtual void routeInfluence(const GCS::GElementID& destination, GCS::GElementInfluence& influence);
00190 };
00191 
00192 }
00193 
00194 #endif

Generated on Thu Nov 16 07:49:12 2006 for G System by  doxygen 1.4.7