1 /*---------------------------------------------------------------------------*\
5 * Copyright 2000-2002 by OpenSG Forum *
7 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
13 * This library is free software; you can redistribute it and/or modify it *
14 * under the terms of the GNU Library General Public License as published *
15 * by the Free Software Foundation, version 2. *
17 * This library is distributed in the hope that it will be useful, but *
18 * WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20 * Library General Public License for more details. *
22 * You should have received a copy of the GNU Library General Public *
23 * License along with this library; if not, write to the Free Software *
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
35 \*---------------------------------------------------------------------------*/
37 #ifndef _OSGOSGWRITER_H_
38 #define _OSGOSGWRITER_H_
43 #include "OSGConfig.h"
52 #include "OSGNodeCore.h"
53 #include "OSGFieldContainer.h"
54 #include "OSGSystemDef.h"
58 /*! \brief Brief OSGWriter
59 \ingroup GrpSystemFileIOOSG
60 \ingroup GrpLibOSGSystem
63 class OSG_SYSTEM_DLLMAPPING OSGWriter
65 /*========================== PUBLIC =================================*/
69 /*---------------------------------------------------------------------*/
70 /*! \name Constructors */
73 OSGWriter(OutStream
&stream
, UInt32 indentStep
= 4);
76 /*---------------------------------------------------------------------*/
77 /*! \name Destructor */
83 /*---------------------------------------------------------------------*/
87 void write( FieldContainer
* container
);
88 void write(std::vector
<FieldContainer
*> containers
);
91 /*========================= PROTECTED ===============================*/
95 static const UInt32 DefaultSFWidth
;
96 static const UInt32 DefaultMFWidth
;
105 std::string containerName
;
107 void setName (FieldContainer
* const pFC
);
112 typedef std::map
<FieldContainer
*, FCInfoHelper
> FCInfoHelperMap
;
114 /*---------------------------------------------------------------------*/
118 FCInfoHelperMap _visitedFCMap
;
119 OutStream
&_outStream
;
121 void visitContainer(FieldContainer
* const pFC
);
122 void visitField (GetFieldHandlePtr hF
);
124 void writeContainer(FieldContainer
* const pFC
,
126 void writeField (GetFieldHandlePtr hF
);
129 /*========================== PRIVATE ================================*/
133 /*!\brief prohibit default function (move to 'public' if needed) */
134 OSGWriter(const OSGWriter
&source
);
135 /*!\brief prohibit default function (move to 'public' if needed) */
136 void operator =(const OSGWriter
&source
);
141 #endif /* _OSGOSGWRITER_H_ */