lists/SoAuditorList.h
#ifndef COIN_SOAUDITORLIST_H
#define COIN_SOAUDITORLIST_H
/**************************************************************************\
* Copyright (c) Kongsberg Oil & Gas Technologies AS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\**************************************************************************/
#include <Inventor/lists/SbPList.h>
#include <Inventor/misc/SoNotification.h>
// Important note: do not expand this class with any further data
// unless absolutely necessary, as every SoBase object contains (by
// value) an SoAuditorList.
//
// So if you increase the size of objects of this class by just a
// minor amount, it could have adverse effects on the total memory
// usage in a Coin application, as SoBase-derived objects are
// ubiquitous within the system.
//
// -mortene
class COIN_DLL_API SoAuditorList : private SbPList {
typedef SbPList inherited;
public:
SoAuditorList(void);
~SoAuditorList();
void append(void * const auditor, const SoNotRec::Type type);
void set(const int index, void * const auditor, const SoNotRec::Type type);
void * getObject(const int index) const;
SoNotRec::Type getType(const int index) const;
int getLength(void) const;
int find(void * const auditor, const SoNotRec::Type type) const;
void remove(const int index);
void remove(void * const auditor, const SoNotRec::Type type);
void notify(SoNotList * l);
private:
// Hide these, as they are "dangerous" for this class, in the sense
// that they need to be rewritten to behave correctly.
SoAuditorList(const int) { }
SoAuditorList(const SoAuditorList & l) : SbPList(l) { }
void * get(const int) const { return NULL; }
void set(const int, void * const) { }
void copy(const SbPList &) { }
void append(const void *) { }
int find(const void *) const { return -1; }
void insert(const void *, const int) { }
void removeFast(const int) { }
void truncate(const int, const int = 0) { }
void push(const void *) { }
void * pop(void) { return NULL; }
SbPList & operator=(const SbPList &) { return *this; }
operator void ** (void) { return static_cast<void **> (NULL); }
operator const void ** (void) const { return static_cast<const void **>(NULL); }
void * operator[](const int) const { return NULL; }
void * & operator[](const int) { return SbPList::operator[](0); }
int operator==(const SbPList &) const { return 0; }
int operator!=(const SbPList &) const { return 0; }
void doNotify(SoNotList * l, const void * auditor, const SoNotRec::Type type);
};
#endif // !COIN_SOAUDITORLIST_H
SbPList::set
void set(const int index, void *item)
Definition lists/SbPList.h:150
SbPList::get
void * get(const int index) const
Definition lists/SbPList.h:144
SbPList::operator!=
int operator!=(const SbPList &l) const
Definition lists/SbPList.h:138
SbPList::append
void append(void *item)
Definition lists/SbPList.h:87
SbPList::remove
void remove(const int index)
Definition SbPList.cpp:269
SbPList::getLength
int getLength(void) const
Definition lists/SbPList.h:103
SbPList::removeFast
void removeFast(const int index)
Definition lists/SbPList.h:94
SbPList::operator[]
void *& operator[](const int index) const
Definition lists/SbPList.h:128
SbPList::SbPList
SbPList(const int sizehint=DEFAULTSIZE)
Definition SbPList.cpp:144
SbPList::truncate
void truncate(const int length, const int fit=0)
Definition lists/SbPList.h:109
SbPList::operator==
int operator==(const SbPList &l) const
Definition SbPList.cpp:284
SbPList::operator=
SbPList & operator=(const SbPList &l)
Definition SbPList.cpp:183
SbPList::insert
void insert(void *item, const int insertbefore)
Definition SbPList.cpp:236
SbPList::find
int find(const void *item) const
Definition SbPList.cpp:222
SbPList::copy
void copy(const SbPList &l)
Definition SbPList.cpp:171
SoAuditorList::notify
void notify(SoNotList *l)
Definition SoAuditorList.cpp:177
SoAuditorList::getObject
void * getObject(const int index) const
Definition SoAuditorList.cpp:136
SoAuditorList::SoAuditorList
SoAuditorList(void)
Definition SoAuditorList.cpp:69
SoAuditorList::getType
SoNotRec::Type getType(const int index) const
Definition SoAuditorList.cpp:145
SoNotList
The SoNotList class is a list of SoNotRec notification records.
Definition SoNotification.h:43
SoNotRec::Type
Type
Definition SoNotRec.h:44