changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Connector / OSGConnectorAttachment.h
blobe2e350553f9df331df1fcc17f43ed7a74d217eee
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCONNECTORATTACHMENT_H_
40 #define _OSGCONNECTORATTACHMENT_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConnectorAttachmentBase.h"
47 OSG_BEGIN_NAMESPACE
49 class BasicFieldConnector;
51 /*! \ingroup GrpBaseFieldContainerConnector
52 \ingroup GrpLibOSGBase
53 \includebasedoc
56 class OSG_BASE_DLLMAPPING ConnectorAttachment :
57 public ConnectorAttachmentBase
59 protected:
61 /*========================== PUBLIC =================================*/
63 public:
65 typedef ConnectorAttachmentBase Inherited;
66 typedef ConnectorAttachment Self;
68 /*---------------------------------------------------------------------*/
69 /*! \name Sync */
70 /*! \{ */
72 virtual void changed(ConstFieldMaskArg whichField,
73 UInt32 origin,
74 BitVector details );
76 /*! \} */
77 /*---------------------------------------------------------------------*/
78 /*! \name Output */
79 /*! \{ */
81 void addConnection (BasicFieldConnector *pConnector);
83 void processChanged (FieldContainer *pObj,
84 BitVector whichField,
85 UInt32 origin );
87 void targetDestroyed(FieldContainer *pObj,
88 BitVector whichField,
89 UInt32 origin );
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name Output */
94 /*! \{ */
96 bool hasConnectionTo (const FieldContainer *pDst) const;
97 void removeConnectionTo(const FieldContainer *pDst);
99 /*! \} */
100 /*---------------------------------------------------------------------*/
101 /*! \name Output */
102 /*! \{ */
104 void removeConnections( BitVector bSrcMask,
105 const FieldContainer *pDst,
106 BitVector bDstMask);
108 /*! \} */
109 /*---------------------------------------------------------------------*/
110 /*! \name Output */
111 /*! \{ */
113 virtual void dump( UInt32 uiIndent = 0,
114 const BitVector bvFlags = 0) const;
116 /*! \} */
117 /*========================= PROTECTED ===============================*/
119 protected:
121 typedef std::vector<BasicFieldConnector *> ConnectionStore;
122 typedef std::map <FieldContainer *,
123 UInt32 > ConnectionCount;
125 // Variables should all be in ConnectorAttachmentBase.
127 ConnectionStore _vConnections;
129 /*---------------------------------------------------------------------*/
130 /*! \name Constructors */
131 /*! \{ */
133 ConnectorAttachment(void);
134 ConnectorAttachment(const ConnectorAttachment &source);
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name Destructors */
139 /*! \{ */
141 virtual ~ConnectorAttachment(void);
143 /*! \} */
144 /*---------------------------------------------------------------------*/
145 /*! \name Init */
146 /*! \{ */
148 virtual bool unlinkParent(FieldContainer * const pParent,
149 UInt16 const parentFieldId);
151 virtual void resolveLinks(void );
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name Init */
156 /*! \{ */
158 static void initMethod(InitPhase ePhase);
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Init */
163 /*! \{ */
165 void countConnections(ConnectionCount &mCount);
167 /*! \} */
168 /*========================== PRIVATE ================================*/
170 private:
172 friend class FieldContainer;
173 friend class ConnectorAttachmentBase;
175 // prohibit default functions (move to 'public' if you need one)
176 void operator =(const ConnectorAttachment &source);
179 typedef ConnectorAttachment *ConnectorAttachmentP;
181 OSG_BASE_DLLMAPPING
182 void addConnector(OSG::AttachmentContainer *pContainer,
183 OSG::BasicFieldConnector *pConn );
185 OSG_BASE_DLLMAPPING
186 void subConnector(OSG::AttachmentContainer *pSrcContainer,
187 OSG::BitVector bSrcMask,
188 OSG::FieldContainer *pDstContainer,
189 OSG::BitVector bDstMask );
191 OSG_END_NAMESPACE
193 #include "OSGConnectorAttachmentBase.inl"
194 #include "OSGConnectorAttachment.inl"
196 #endif /* _OSGCONNECTORATTACHMENT_H_ */