KVIrc 5.2.6
Developer APIs
KviKvsObjectController.h
Go to the documentation of this file.
1#ifndef _KVI_KVS_OBJECT_CONTROLLER_H_
2#define _KVI_KVS_OBJECT_CONTROLLER_H_
3//=============================================================================
4//
5// File : KviKvsObjectController.h
6// Creation date : Sun 24 Apr 2005 05:23:04 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2005-2010 Szymon Stefanek <pragma at kvirc dot net>
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, or (at your option) any later version.
15//
16// This program is distributed in the HOPE that it will be USEFUL,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
27#include "kvi_settings.h"
28
29#include "KviQString.h"
30#include "KviPointerList.h"
31
32#include "KviPointerHashTable.h"
33
34#include "KviKvsObject.h"
35#include "KviKvsObjectClass.h"
36
38{
39 friend class KviKvsObject;
40 friend class KviKvsObjectClass;
41
42public:
45
46protected:
50 KviKvsObjectClass * m_pObjectClass = nullptr; //base class
51protected:
52 // the classes and the objects register themselves with the controller
53 void registerObject(KviKvsObject * pObject);
54 void unregisterObject(KviKvsObject * pObject);
55 void registerClass(KviKvsObjectClass * pClass);
56 void unregisterClass(KviKvsObjectClass * pClass);
57
58public:
59 void init();
60 void deleteClass(KviKvsObjectClass * pClass);
61 void clearInstances();
62 void clearUserClasses();
63 void flushUserClasses();
64 void killAllObjectsWithClass(KviKvsObjectClass * pClass);
65 KviKvsObjectClass * lookupClass(const QString & szClass, bool bBuiltinOnly = false);
66 KviKvsObject * lookupObject(kvs_hobject_t hObject) { return m_pObjectDict->find(hObject); };
69};
70
71#endif
void * kvs_hobject_t
Definition KviKvsTypes.h:32
Pointer Hash Table.
C++ Template based double linked pointer list class.
Helper functions for the QString class.
Definition KviKvsObjectClass.h:50
Definition KviKvsObjectController.h:38
KviPointerHashTable< QString, KviKvsObjectClass > * classDict()
Definition KviKvsObjectController.h:68
KviPointerHashTable< QString, KviKvsObjectClass > * m_pClassDict
Definition KviKvsObjectController.h:49
KviPointerList< KviKvsObject > * m_pTopLevelObjectList
Definition KviKvsObjectController.h:47
KviPointerHashTable< void *, KviKvsObject > * objectDict()
Definition KviKvsObjectController.h:67
KviPointerHashTable< void *, KviKvsObject > * m_pObjectDict
Definition KviKvsObjectController.h:48
KviKvsObject * lookupObject(kvs_hobject_t hObject)
Definition KviKvsObjectController.h:66
Definition KviKvsObject.h:51
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
T * find(const Key &hKey)
Returns the item associated to the key.
Definition KviPointerHashTable.h:471
A template double linked list of pointers.
Definition KviPointerList.h:371
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
int init()
Definition winamp.cpp:118