Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoAuditorList.h
1#ifndef COIN_SOAUDITORLIST_H
2#define COIN_SOAUDITORLIST_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/lists/SbPList.h>
28#include <Inventor/misc/SoNotification.h>
29
30
31// Important note: do not expand this class with any further data
32// unless absolutely necessary, as every SoBase object contains (by
33// value) an SoAuditorList.
34//
35// So if you increase the size of objects of this class by just a
36// minor amount, it could have adverse effects on the total memory
37// usage in a Coin application, as SoBase-derived objects are
38// ubiquitous within the system.
39//
40// -mortene
41
42
43class COIN_DLL_API SoAuditorList : private SbPList {
44 typedef SbPList inherited;
45
46public:
47 SoAuditorList(void);
49
50 void append(void * const auditor, const SoNotRec::Type type);
51
52 void set(const int index, void * const auditor, const SoNotRec::Type type);
53 void * getObject(const int index) const;
54 SoNotRec::Type getType(const int index) const;
55
56 int getLength(void) const;
57 int find(void * const auditor, const SoNotRec::Type type) const;
58
59 void remove(const int index);
60 void remove(void * const auditor, const SoNotRec::Type type);
61
62 void notify(SoNotList * l);
63
64private:
65 // Hide these, as they are "dangerous" for this class, in the sense
66 // that they need to be rewritten to behave correctly.
67 SoAuditorList(const int) { }
68 SoAuditorList(const SoAuditorList & l) : SbPList(l) { }
69 void * get(const int) const { return NULL; }
70 void set(const int, void * const) { }
71 void copy(const SbPList &) { }
72 void append(const void *) { }
73 int find(const void *) const { return -1; }
74 void insert(const void *, const int) { }
75 void removeFast(const int) { }
76 void truncate(const int, const int = 0) { }
77 void push(const void *) { }
78 void * pop(void) { return NULL; }
79 SbPList & operator=(const SbPList &) { return *this; }
80 operator void ** (void) { return static_cast<void **> (NULL); }
81 operator const void ** (void) const { return static_cast<const void **>(NULL); }
82 void * operator[](const int) const { return NULL; }
83 void * & operator[](const int) { return SbPList::operator[](0); }
84 int operator==(const SbPList &) const { return 0; }
85 int operator!=(const SbPList &) const { return 0; }
86
87 void doNotify(SoNotList * l, const void * auditor, const SoNotRec::Type type);
88
89};
90
91#endif // !COIN_SOAUDITORLIST_H
The SbPList class is a container class for void pointers.
Definition SbPList.h:31
void set(const int index, void *item)
Definition SbPList.h:141
void * get(const int index) const
Definition SbPList.h:135
int operator!=(const SbPList &l) const
Definition SbPList.h:129
void append(void *item)
Definition SbPList.h:78
void remove(const int index)
Definition SbPList.cpp:259
int getLength(void) const
Definition SbPList.h:94
int find(void *item) const
Definition SbPList.cpp:212
void removeFast(const int index)
Definition SbPList.h:85
void *& operator[](const int index) const
Definition SbPList.h:119
SbPList(const int sizehint=DEFAULTSIZE)
Definition SbPList.cpp:134
void truncate(const int length, const int fit=0)
Definition SbPList.h:100
int operator==(const SbPList &l) const
Definition SbPList.cpp:274
SbPList & operator=(const SbPList &l)
Definition SbPList.cpp:173
void insert(void *item, const int insertbefore)
Definition SbPList.cpp:226
void copy(const SbPList &l)
Definition SbPList.cpp:161
The SoAuditorList class is used to keep track of auditors for certain object classes.
Definition SoAuditorList.h:43
The SoNotList class is a list of SoNotRec notification records.
Definition SoNotification.h:34
Type
Definition SoNotRec.h:35

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.