Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/TObj_TNameContainer.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: 2004-11-23
0002 // Created by: Pavel DURANDIN
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 // The original implementation Copyright: (C) RINA S.p.A
0017 
0018 #ifndef TObj_TNameContainer_HeaderFile
0019 #define TObj_TNameContainer_HeaderFile
0020 
0021 #include <TObj_Container.hxx>
0022 #include <TDF_Attribute.hxx>
0023 
0024 /**
0025  * This class provides OCAF Attribute to storing the unique names of object in
0026  * model.
0027  */
0028 
0029 class TObj_TNameContainer : public TDF_Attribute
0030 {
0031 public:
0032   //! Standard methods of OCAF attribute
0033 
0034   //! Empty constructor
0035   Standard_EXPORT TObj_TNameContainer();
0036 
0037   //! This method is used in implementation of ID()
0038   static Standard_EXPORT const Standard_GUID& GetID();
0039 
0040   //! Returns the ID of TObj_TNameContainer attribute.
0041   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0042 
0043 public:
0044   //! Method for create TObj_TNameContainer object
0045 
0046   //! Creates TObj_DataMapOfNameLabel attribute on given label if not exist
0047   static Standard_EXPORT Handle(TObj_TNameContainer) Set(const TDF_Label& theLabel);
0048 
0049 public:
0050   //! Methods for adding and removing names
0051 
0052   //! Records name with label attached
0053   Standard_EXPORT void RecordName(const Handle(TCollection_HExtendedString)& theName,
0054                                   const TDF_Label&                           theLabel);
0055 
0056   //! Remove name from the map
0057   Standard_EXPORT void RemoveName(const Handle(TCollection_HExtendedString)& theName);
0058 
0059   //! Return True is theName is registered in the Map
0060   Standard_EXPORT Standard_Boolean
0061     IsRegistered(const Handle(TCollection_HExtendedString)& theName) const;
0062 
0063   //! Remove all names registered in container
0064   Standard_EXPORT void Clear();
0065 
0066 public:
0067   //! Methods for setting and obtaining TObj_TNameContainer
0068 
0069   //! Sets the TObj_DataMapOfNameLabel object
0070   Standard_EXPORT void Set(const TObj_DataMapOfNameLabel& theElem);
0071 
0072   //! Returns the TObj_DataMapOfNameLabel object
0073   Standard_EXPORT const TObj_DataMapOfNameLabel& Get() const;
0074 
0075 public:
0076   //! Redefined OCAF abstract methods
0077 
0078   //! Returns an new empty TObj_TNameContainer attribute. It is used by the
0079   //! copy algorithm.
0080   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0081 
0082   //! Restores the backuped contents from <theWith> into this one. It is used
0083   //! when aborting a transaction.
0084   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theWith) Standard_OVERRIDE;
0085 
0086   //! This method is used when copying an attribute from a source structure
0087   //! into a target structure.
0088   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       theInto,
0089                              const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE;
0090 
0091 private:
0092   //! Fields
0093   TObj_DataMapOfNameLabel myMap; //!< The map of the names
0094 
0095 public:
0096   //! CASCADE RTTI
0097   DEFINE_STANDARD_RTTIEXT(TObj_TNameContainer, TDF_Attribute)
0098 };
0099 
0100 //! Define handle class for TObj_TObject
0101 DEFINE_STANDARD_HANDLE(TObj_TNameContainer, TDF_Attribute)
0102 
0103 #endif
0104 
0105 #ifdef _MSC_VER
0106 #pragma once
0107 #endif