0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / StepData / StepData_WriterLib.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-02-11
2// Created by: Christian CAILLET
3// Copyright (c) 1992-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _StepData_WriterLib_HeaderFile
18#define _StepData_WriterLib_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26class StepData_NodeOfWriterLib;
27class Standard_NoSuchObject;
28class Standard_Transient;
29class StepData_ReadWriteModule;
30class StepData_Protocol;
31class StepData_GlobalNodeOfWriterLib;
32
33
34
35class StepData_WriterLib
36{
37public:
38
39 DEFINE_STANDARD_ALLOC
40
41
36b9ff75 42 //! Adds a couple (Module-Protocol) into the global definition set
43 //! for this class of Library.
42cf5bc1 44 Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol);
45
36b9ff75 46 //! Creates a Library which complies with a Protocol, that is :
47 //! Same class (criterium IsInstance)
48 //! This creation gets the Modules from the global set, those
49 //! which are bound to the given Protocol and its Resources
42cf5bc1 50 Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& aprotocol);
51
36b9ff75 52 //! Creates an empty Library : it will later by filled by method
53 //! AddProtocol
42cf5bc1 54 Standard_EXPORT StepData_WriterLib();
55
36b9ff75 56 //! Adds a couple (Module-Protocol) to the Library, given the
57 //! class of a Protocol. Takes Resources into account.
58 //! (if <aprotocol> is not of type TheProtocol, it is not added)
42cf5bc1 59 Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
60
36b9ff75 61 //! Clears the list of Modules of a library (can be used to
62 //! redefine the order of Modules before action : Clear then
63 //! refill the Library by calls to AddProtocol)
42cf5bc1 64 Standard_EXPORT void Clear();
65
36b9ff75 66 //! Sets a library to be defined with the complete Global list
67 //! (all the couples Protocol/Modules recorded in it)
42cf5bc1 68 Standard_EXPORT void SetComplete();
69
36b9ff75 70 //! Selects a Module from the Library, given an Object.
71 //! Returns True if Select has succeeded, False else.
72 //! Also Returns (as arguments) the selected Module and the Case
73 //! Number determined by the associated Protocol.
74 //! If Select has failed, <module> is Null Handle and CN is zero.
75 //! (Select can work on any criterium, such as Object DynamicType)
42cf5bc1 76 Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(StepData_ReadWriteModule)& module, Standard_Integer& CN) const;
77
36b9ff75 78 //! Starts Iteration on the Modules (sets it on the first one)
42cf5bc1 79 Standard_EXPORT void Start();
80
36b9ff75 81 //! Returns True if there are more Modules to iterate on
42cf5bc1 82 Standard_EXPORT Standard_Boolean More() const;
83
36b9ff75 84 //! Iterates by getting the next Module in the list
85 //! If there is none, the exception will be raised by Value
42cf5bc1 86 Standard_EXPORT void Next();
87
36b9ff75 88 //! Returns the current Module in the Iteration
42cf5bc1 89 Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const;
90
36b9ff75 91 //! Returns the current Protocol in the Iteration
42cf5bc1 92 Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const;
93
94
95
96
97protected:
98
99
100
101
102
103private:
104
105
106
107 Handle(StepData_NodeOfWriterLib) thelist;
108 Handle(StepData_NodeOfWriterLib) thecurr;
109
110
111};
112
113
114
115
116
117
118
119#endif // _StepData_WriterLib_HeaderFile