|
||||
File indexing completed on 2025-01-18 10:05:06
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_FileRecognizer_HeaderFile 0018 #define _StepData_FileRecognizer_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <Standard_Transient.hxx> 0024 class Standard_Transient; 0025 class Standard_NoSuchObject; 0026 class TCollection_AsciiString; 0027 0028 0029 class StepData_FileRecognizer; 0030 DEFINE_STANDARD_HANDLE(StepData_FileRecognizer, Standard_Transient) 0031 0032 0033 class StepData_FileRecognizer : public Standard_Transient 0034 { 0035 0036 public: 0037 0038 0039 //! Evaluates if recognition has a result, returns it if yes 0040 //! In case of success, Returns True and puts result in "res" 0041 //! In case of Failure, simply Returns False 0042 //! Works by calling deferred method Eval, and in case of failure, 0043 //! looks for Added Recognizers to work 0044 Standard_EXPORT Standard_Boolean Evaluate (const TCollection_AsciiString& akey, Handle(Standard_Transient)& res); 0045 0046 //! Returns result of last recognition (call of Evaluate) 0047 Standard_EXPORT Handle(Standard_Transient) Result() const; 0048 0049 //! Adds a new Recognizer to the Compound, at the end 0050 //! Several calls to Add work by adding in the order of calls : 0051 //! Hence, when Eval has failed to recognize, Evaluate will call 0052 //! Evaluate from the first added Recognizer if there is one, 0053 //! and to the second if there is still no result, and so on 0054 Standard_EXPORT void Add (const Handle(StepData_FileRecognizer)& reco); 0055 0056 0057 0058 0059 DEFINE_STANDARD_RTTI_INLINE(StepData_FileRecognizer,Standard_Transient) 0060 0061 protected: 0062 0063 0064 //! Assumes that no result has yet been recognized 0065 Standard_EXPORT StepData_FileRecognizer(); 0066 0067 //! Records the result of the recognition. Called by specific 0068 //! method Eval to record a result : after calling it, Eval has 0069 //! finished and can return 0070 Standard_EXPORT void SetOK (const Handle(Standard_Transient)& aresult); 0071 0072 //! Records that recognition gives no result 0073 Standard_EXPORT void SetKO(); 0074 0075 //! THIS METHOD DEFINES THE RECOGNITION PROTOCOL, it is proper to 0076 //! each precise type of Recognizer 0077 //! For a suitable type of akey, it calls SetOK(result) where 0078 //! result is an empty result of appropriate type, then returns 0079 Standard_EXPORT virtual void Eval (const TCollection_AsciiString& akey) = 0; 0080 0081 0082 0083 private: 0084 0085 0086 Handle(Standard_Transient) theres; 0087 Standard_Boolean hasnext; 0088 Handle(StepData_FileRecognizer) thenext; 0089 0090 0091 }; 0092 0093 0094 0095 0096 0097 0098 0099 #endif // _StepData_FileRecognizer_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |