Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/StepData_Protocol.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1993-02-03
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_Protocol_HeaderFile
0018 #define _StepData_Protocol_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Interface_DataMapOfTransientInteger.hxx>
0024 #include <Interface_Protocol.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TColStd_SequenceOfAsciiString.hxx>
0027 class Interface_InterfaceModel;
0028 class StepData_EDescr;
0029 class StepData_ESDescr;
0030 class StepData_ECDescr;
0031 class StepData_PDescr;
0032 
0033 class StepData_Protocol;
0034 DEFINE_STANDARD_HANDLE(StepData_Protocol, Interface_Protocol)
0035 
0036 //! Description of Basic Protocol for Step
0037 //! The class Protocol from StepData itself describes a default
0038 //! Protocol, which recognizes only UnknownEntities.
0039 //! Sub-classes will redefine CaseNumber and, if necessary,
0040 //! NbResources and Resources.
0041 class StepData_Protocol : public Interface_Protocol
0042 {
0043 
0044 public:
0045   Standard_EXPORT StepData_Protocol();
0046 
0047   //! Gives the count of Protocols used as Resource (can be zero)
0048   //! Here, No resource
0049   Standard_EXPORT Standard_Integer NbResources() const Standard_OVERRIDE;
0050 
0051   //! Returns a Resource, given a rank. Here, none
0052   Standard_EXPORT Handle(Interface_Protocol) Resource(const Standard_Integer num) const
0053     Standard_OVERRIDE;
0054 
0055   //! Returns a unique positive number for any recognized entity
0056   //! Redefined to work by calling both TypeNumber and, for a
0057   //! Described Entity (late binding) DescrNumber
0058   Standard_EXPORT virtual Standard_Integer CaseNumber(const Handle(Standard_Transient)& obj) const
0059     Standard_OVERRIDE;
0060 
0061   //! Returns a Case Number, specific of each recognized Type
0062   //! Here, only Unknown Entity is recognized
0063   Standard_EXPORT Standard_Integer
0064     TypeNumber(const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
0065 
0066   //! Returns the Schema Name attached to each class of Protocol
0067   //! To be redefined by each sub-class
0068   //! Here, SchemaName returns "(DEFAULT)"
0069   //! was C++ : return const
0070   Standard_EXPORT virtual Standard_CString SchemaName(
0071     const Handle(Interface_InterfaceModel)& theModel) const;
0072 
0073   //! Creates an empty Model for Step Norm
0074   Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const Standard_OVERRIDE;
0075 
0076   //! Returns True if <model> is a Model of Step Norm
0077   Standard_EXPORT Standard_Boolean
0078     IsSuitableModel(const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
0079 
0080   //! Creates a new Unknown Entity for Step (UndefinedEntity)
0081   Standard_EXPORT Handle(Standard_Transient) UnknownEntity() const Standard_OVERRIDE;
0082 
0083   //! Returns True if <ent> is an Unknown Entity for the Norm, i.e.
0084   //! Type UndefinedEntity, status Unknown
0085   Standard_EXPORT Standard_Boolean
0086     IsUnknownEntity(const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
0087 
0088   //! Returns a unique positive CaseNumber for types described by
0089   //! an EDescr (late binding)
0090   //! Warning : TypeNumber and DescrNumber must give together a unique
0091   //! positive case number for each distinct case, type or descr
0092   Standard_EXPORT virtual Standard_Integer DescrNumber(const Handle(StepData_EDescr)& adescr) const;
0093 
0094   //! Records an EDescr with its case number
0095   //! Also records its name for an ESDescr (simple type): an ESDescr
0096   //! is then used, for case number, or for type name
0097   Standard_EXPORT void AddDescr(const Handle(StepData_EDescr)& adescr, const Standard_Integer CN);
0098 
0099   //! Tells if a Protocol brings at least one ESDescr, i.e. if it
0100   //! defines at least one entity description by ESDescr mechanism
0101   Standard_EXPORT Standard_Boolean HasDescr() const;
0102 
0103   //! Returns the description attached to a case number, or null
0104   Standard_EXPORT Handle(StepData_EDescr) Descr(const Standard_Integer num) const;
0105 
0106   //! Returns a description according to its name
0107   //! <anylevel> True (D) : for <me> and its resources
0108   //! <anylevel> False : for <me> only
0109   Standard_EXPORT Handle(StepData_EDescr) Descr(
0110     const Standard_CString name,
0111     const Standard_Boolean anylevel = Standard_True) const;
0112 
0113   //! Idem as Descr but cast to simple description
0114   Standard_EXPORT Handle(StepData_ESDescr) ESDescr(
0115     const Standard_CString name,
0116     const Standard_Boolean anylevel = Standard_True) const;
0117 
0118   //! Returns a complex description according to list of names
0119   //! <anylevel> True (D) : for <me> and its resources
0120   //! <anylevel> False : for <me> only
0121   Standard_EXPORT Handle(StepData_ECDescr) ECDescr(
0122     const TColStd_SequenceOfAsciiString& names,
0123     const Standard_Boolean               anylevel = Standard_True) const;
0124 
0125   //! Records an PDescr
0126   Standard_EXPORT void AddPDescr(const Handle(StepData_PDescr)& pdescr);
0127 
0128   //! Returns a parameter description according to its name
0129   //! <anylevel> True (D) : for <me> and its resources
0130   //! <anylevel> False : for <me> only
0131   Standard_EXPORT Handle(StepData_PDescr) PDescr(
0132     const Standard_CString name,
0133     const Standard_Boolean anylevel = Standard_True) const;
0134 
0135   //! Records an ESDescr, intended to build complex descriptions
0136   Standard_EXPORT void AddBasicDescr(const Handle(StepData_ESDescr)& esdescr);
0137 
0138   //! Returns a basic description according to its name
0139   //! <anylevel> True (D) : for <me> and its resources
0140   //! <anylevel> False : for <me> only
0141   Standard_EXPORT Handle(StepData_EDescr) BasicDescr(
0142     const Standard_CString name,
0143     const Standard_Boolean anylevel = Standard_True) const;
0144 
0145   DEFINE_STANDARD_RTTIEXT(StepData_Protocol, Interface_Protocol)
0146 
0147 protected:
0148 private:
0149   Interface_DataMapOfTransientInteger                                      thedscnum;
0150   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thedscnam;
0151   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thepdescr;
0152   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thedscbas;
0153 };
0154 
0155 #endif // _StepData_Protocol_HeaderFile