Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoSharedGroupReferenceList.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Apr 2013)
22**=======================================================================*/
23
24#if !defined SO_SHARED_GROUP_REFERENCE_LIST_H
25#define SO_SHARED_GROUP_REFERENCE_LIST_H
26
27#include <Inventor/SbBase.h>
28
29class SoBaseContextCache;
31
32#ifdef _MSC_VER
33#pragma warning( push )
34#pragma warning(disable:4251)
35#endif
36
37
38{
39public:
40 // Constructor
41 SoSharedGroupReferenceList();
42
43 // Destructor
44 ~SoSharedGroupReferenceList();
45
46 // Adds an element for the list
47 // @param sharedGroup shared group to add element in
48 // @param element element to add to the list
49 // @return true if element has been inserted in the sharedgroup dependency list
50 // false otherwise (element was already in another list).
51 bool insert(SoDeviceContextSharedGroup* sharedGroup, SoBaseContextCache* element);
52
53 // Removes an element for the list
54 // @param sharedGroup shared group to remove element from
55 // @param element element to remove from the list
56 // @return true if element has been removed from the sharedgroup dependency list
57 // false otherwise (element was not in this sharedgroup list).
58 bool remove(SoDeviceContextSharedGroup* sharedGroup, SoBaseContextCache* element);
59
60 // Returns true if the element is in the list
61 bool contains(const SoDeviceContextSharedGroup* sharedGroup, const SoBaseContextCache* element) const;
62
63 // Return true if the list is empty
64 bool isEmpty() const
65 { return (m_headList==NULL); }
66
67 // Returns the head list element
68 // usefull when iterating through the list to get a stop condition
69 SoBaseContextCache* getHead() const
70 { return m_headList; }
71
72 // Returns the number of element currently in the list
73 // Nb: should be call for debugging only
74 size_t getSize() const;
75
76private:
77 SoBaseContextCache* m_headList;
78};
79
80
81{
82public:
83 // Constructor
84 SoSharedGroupReference();
85 // Destructor.
86 ~SoSharedGroupReference();
87
88 // Returns true if this object is already linked to the given sharedGroup dependency list
89 inline bool isLinkedTo(const SoDeviceContextSharedGroup* sharedGroup) const
90 { return (m_sharedGroup==sharedGroup); }
91
92private:
93 SoDeviceContextSharedGroup* m_sharedGroup;
94 SoBaseContextCache* m_next;
95 SoBaseContextCache* m_previous;
96
98 friend class SoSharedGroupReferenceList;
100};
101
102
103#ifdef _MSC_VER
104#pragma warning( pop )
105#endif
106
107#endif // SO_SHARED_GROUP_REFERENCE_LIST_H
108
109
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Shared context m...
bool contains(const SoDeviceContext *ctx) const
Returns TRUE if the passed context is part of the shared group.
void remove(SoDeviceContext *ctx)
Removes a device context from the group.