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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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 
43 class COIN_DLL_API SoAuditorList : private SbPList {
44  typedef SbPList inherited;
45 
46 public:
47  SoAuditorList(void);
48  ~SoAuditorList();
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 
64 private:
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 (void **) NULL; }
81  operator const void ** (void) const { return (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
int find(void *item) const
Definition: SbPList.cpp:212
void removeFast(const int index)
Definition: SbPList.h:85
The SbPList class is a container class for void pointers.
Definition: SbPList.h:31
void append(void *item)
Definition: SbPList.h:78
void copy(const SbPList &l)
Definition: SbPList.cpp:161
SbPList & operator=(const SbPList &l)
Definition: SbPList.cpp:173
The SoAuditorList class is used to keep track of auditors for certain object classes.This class is mainly for internal use (from SoBase) and it should not be necessary to be familiar with it for "ordinary" Coin use.
Definition: SoAuditorList.h:43
int operator!=(const SbPList &l) const
Definition: SbPList.h:129
int operator==(const SbPList &l) const
Definition: SbPList.cpp:274
void *& operator[](const int index) const
Definition: SbPList.h:119
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:34
SbPList(const int sizehint=DEFAULTSIZE)
Definition: SbPList.cpp:134
void truncate(const int length, const int fit=0)
Definition: SbPList.h:100
int getLength(void) const
Definition: SbPList.h:94
void insert(void *item, const int insertbefore)
Definition: SbPList.cpp:226
Type
Definition: SoNotRec.h:35

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13