src/DDS/DDS_Dictionary.h

Go to the documentation of this file.
00001 // Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 #ifndef DDS_DICTIONARY_H
00020 #define DDS_DICTIONARY_H
00021 
00022 #include "DDS_DicGroup.h"
00023 
00024 #include <LDOMString.hxx>
00025 
00026 #include <MMgt_TShared.hxx>
00027 
00028 class LDOM_Element;
00029 class TCollection_AsciiString;
00030 
00031 DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared)
00032 
00033 //  Class to provide information about used parameters,
00034 //  reading them from 'xml' file
00035 class DDS_Dictionary : public MMgt_TShared
00036 {
00037 public:
00038   Standard_EXPORT static Handle(DDS_Dictionary)  Get();
00039 
00040   // Return instance of data dictionary. Create instance if it is NULL.
00041 
00042   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString& ) const;
00043   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString&,
00044                                                              const TCollection_AsciiString& ) const;
00045 
00046   Standard_EXPORT void                           GetUnitSystems( TColStd_SequenceOfAsciiString& ) const;
00047   Standard_EXPORT void                           GetUnitSystems( TColStd_SequenceOfAsciiString&,
00048                                                                  const TCollection_AsciiString& ) const;
00049   Standard_EXPORT TCollection_ExtendedString     GetUnitSystemLabel( const TCollection_AsciiString& ) const;
00050   Standard_EXPORT TCollection_ExtendedString     GetUnitSystemLabel( const TCollection_AsciiString&,
00051                                                                      const TCollection_AsciiString& ) const;
00052   Standard_EXPORT TCollection_AsciiString        GetActiveUnitSystem() const;
00053   Standard_EXPORT TCollection_AsciiString        GetActiveUnitSystem( const TCollection_AsciiString& ) const;
00054   Standard_EXPORT void                           SetActiveUnitSystem( const TCollection_AsciiString& );
00055   Standard_EXPORT void                           SetActiveUnitSystem( const TCollection_AsciiString&,
00056                                                                       const TCollection_AsciiString& );
00057 
00058 
00059   static Standard_EXPORT Standard_Boolean        Load( const TCollection_AsciiString );
00060 
00061   static Standard_EXPORT Standard_Real           ToSI( const Standard_Real, const Standard_CString );
00062   static Standard_EXPORT Standard_Real           FromSI( const Standard_Real, const Standard_CString );
00063 
00064   static Standard_EXPORT LDOMString              KeyWord( const TCollection_AsciiString& );
00065 
00066 private:
00067   DDS_Dictionary();
00068   DDS_Dictionary( const DDS_Dictionary& );
00069 
00070   void                                           operator=( const DDS_Dictionary& );
00071 
00072   // prepares formants for each unit systems
00073   void                                           FillDataMap( const LDOM_Element&, const LDOM_Element& );
00074 
00075 private:
00076   DDS_IndexedDataMapOfDicGroups                  myGroupMap;
00077 
00078 public:
00079   DEFINE_STANDARD_RTTI(DDS_Dictionary)
00080 };
00081 
00082 #endif