Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:07

0001 // Created on: 1992-02-11
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _StepData_WriterLib_HeaderFile
0018 #define _StepData_WriterLib_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 class StepData_NodeOfWriterLib;
0026 class Standard_NoSuchObject;
0027 class Standard_Transient;
0028 class StepData_ReadWriteModule;
0029 class StepData_Protocol;
0030 class StepData_GlobalNodeOfWriterLib;
0031 
0032 
0033 
0034 class StepData_WriterLib 
0035 {
0036 public:
0037 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   
0041   //! Adds a couple (Module-Protocol) into the global definition set
0042   //! for this class of Library.
0043   Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol);
0044   
0045   //! Creates a Library which complies with a Protocol, that is :
0046   //! Same class (criterium IsInstance)
0047   //! This creation gets the Modules from the global set, those
0048   //! which are bound to the given Protocol and its Resources
0049   Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& aprotocol);
0050   
0051   //! Creates an empty Library : it will later by filled by method
0052   //! AddProtocol
0053   Standard_EXPORT StepData_WriterLib();
0054   
0055   //! Adds a couple (Module-Protocol) to the Library, given the
0056   //! class of a Protocol. Takes Resources into account.
0057   //! (if <aprotocol> is not of type TheProtocol, it is not added)
0058   Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
0059   
0060   //! Clears the list of Modules of a library (can be used to
0061   //! redefine the order of Modules before action : Clear then
0062   //! refill the Library by calls to AddProtocol)
0063   Standard_EXPORT void Clear();
0064   
0065   //! Sets a library to be defined with the complete Global list
0066   //! (all the couples Protocol/Modules recorded in it)
0067   Standard_EXPORT void SetComplete();
0068   
0069   //! Selects a Module from the Library, given an Object.
0070   //! Returns True if Select has succeeded, False else.
0071   //! Also Returns (as arguments) the selected Module and the Case
0072   //! Number determined by the associated Protocol.
0073   //! If Select has failed, <module> is Null Handle and CN is zero.
0074   //! (Select can work on any criterium, such as Object DynamicType)
0075   Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(StepData_ReadWriteModule)& module, Standard_Integer& CN) const;
0076   
0077   //! Starts Iteration on the Modules (sets it on the first one)
0078   Standard_EXPORT void Start();
0079   
0080   //! Returns True if there are more Modules to iterate on
0081   Standard_EXPORT Standard_Boolean More() const;
0082   
0083   //! Iterates by getting the next Module in the list
0084   //! If there is none, the exception will be raised by Value
0085   Standard_EXPORT void Next();
0086   
0087   //! Returns the current Module in the Iteration
0088   Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const;
0089   
0090   //! Returns the current Protocol in the Iteration
0091   Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const;
0092 
0093 
0094 
0095 
0096 protected:
0097 
0098 
0099 
0100 
0101 
0102 private:
0103 
0104 
0105 
0106   Handle(StepData_NodeOfWriterLib) thelist;
0107   Handle(StepData_NodeOfWriterLib) thecurr;
0108 
0109 
0110 };
0111 
0112 
0113 
0114 
0115 
0116 
0117 
0118 #endif // _StepData_WriterLib_HeaderFile