Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:21:55

0001 // Created on: 1993-07-23
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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_FileProtocol_HeaderFile
0018 #define _StepData_FileProtocol_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <StepData_Protocol.hxx>
0026 #include <Standard_Integer.hxx>
0027 class Interface_Protocol;
0028 class Interface_Graph;
0029 class Interface_Check;
0030 
0031 //! A FileProtocol is defined as the addition of several already
0032 //! existing Protocols. It corresponds to the definition of a
0033 //! SchemaName with several Names, each one being attached to a
0034 //! specific Protocol. Thus, a File defined with a compound Schema
0035 //! is processed as any other one, once built the equivalent
0036 //! compound Protocol, a FileProtocol
0037 class StepData_FileProtocol : public StepData_Protocol
0038 {
0039 
0040 public:
0041   //! Creates an empty FileProtocol
0042   Standard_EXPORT StepData_FileProtocol();
0043 
0044   //! Adds a Protocol to the definition list of the FileProtocol
0045   //! But ensures that each class of Protocol is present only once
0046   //! in this list
0047   Standard_EXPORT void Add(const occ::handle<StepData_Protocol>& protocol);
0048 
0049   //! Gives the count of Protocols used as Resource (can be zero)
0050   //! i.e. the count of Protocol recorded by calling the method Add
0051   Standard_EXPORT int NbResources() const override;
0052 
0053   //! Returns a Resource, given a rank. Here, rank of calling Add
0054   Standard_EXPORT occ::handle<Interface_Protocol> Resource(const int num) const override;
0055 
0056   //! Returns a Case Number, specific of each recognized Type
0057   //! Here, NO Type at all is recognized properly : all Types are
0058   //! recognized by the resources
0059   Standard_EXPORT int TypeNumber(const occ::handle<Standard_Type>& atype) const override;
0060 
0061   //! Calls GlobalCheck for each of its recorded resources
0062   Standard_EXPORT bool GlobalCheck(const Interface_Graph&        G,
0063                                    occ::handle<Interface_Check>& ach) const override;
0064 
0065   //! Returns the Schema Name attached to each class of Protocol
0066   //! To be redefined by each sub-class
0067   //! Here, SchemaName returns "" (empty String)
0068   //! was C++ : return const
0069   Standard_EXPORT const char* SchemaName(
0070     const occ::handle<Interface_InterfaceModel>& theModel) const override;
0071 
0072   DEFINE_STANDARD_RTTIEXT(StepData_FileProtocol, StepData_Protocol)
0073 
0074 private:
0075   NCollection_Sequence<occ::handle<Standard_Transient>> thecomps;
0076 };
0077 
0078 #endif // _StepData_FileProtocol_HeaderFile