Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-31 09:38:04

0001 // Created on: 1992-06-22
0002 // Created by: Gilles DEBARBOUILLE
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 _Units_Lexicon_HeaderFile
0018 #define _Units_Lexicon_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Time.hxx>
0024 #include <Units_Token.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <NCollection_HSequence.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <Standard_CString.hxx>
0029 #include <Standard_Boolean.hxx>
0030 #include <Standard_Real.hxx>
0031 
0032 //! This class defines a lexicon useful to analyse and
0033 //! recognize the different key words included in a
0034 //! sentence. The lexicon is stored in a sequence of
0035 //! tokens.
0036 class Units_Lexicon : public Standard_Transient
0037 {
0038 
0039 public:
0040   //! Creates an empty instance of Lexicon.
0041   Standard_EXPORT Units_Lexicon();
0042 
0043   //! Reads the file <afilename> to create a sequence of tokens
0044   //! stored in <thesequenceoftokens>.
0045   Standard_EXPORT void Creates();
0046 
0047   //! Returns the first item of the sequence of tokens.
0048   occ::handle<NCollection_HSequence<occ::handle<Units_Token>>> Sequence() const;
0049 
0050   //! Adds to the lexicon a new token with <aword>, <amean>,
0051   //! <avalue> as arguments. If there is already a token
0052   //! with the field <theword> equal to <aword>, the
0053   //! existing token is updated.
0054   Standard_EXPORT void AddToken(const char* const aword,
0055                                 const char* const amean,
0056                                 const double      avalue);
0057 
0058   //! Useful for debugging.
0059   virtual void Dump() const;
0060 
0061   DEFINE_STANDARD_RTTIEXT(Units_Lexicon, Standard_Transient)
0062 
0063 private:
0064   occ::handle<NCollection_HSequence<occ::handle<Units_Token>>> thesequenceoftokens;
0065 };
0066 
0067 #include <Units_Lexicon.lxx>
0068 
0069 #endif // _Units_Lexicon_HeaderFile