Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:17:33

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _StdLPersistent_Value_HeaderFile
0015 #define _StdLPersistent_Value_HeaderFile
0016 
0017 #include <StdObjMgt_Attribute.hxx>
0018 #include <StdLPersistent_HString.hxx>
0019 
0020 #include <TDataStd_Integer.hxx>
0021 #include <TDF_TagSource.hxx>
0022 #include <TDF_Reference.hxx>
0023 #include <TDataStd_UAttribute.hxx>
0024 #include <TDataStd_Name.hxx>
0025 #include <TDataStd_Comment.hxx>
0026 #include <TDataStd_AsciiString.hxx>
0027 
0028 class StdLPersistent_Value
0029 {
0030   template <class AttribClass>
0031   class integer : public StdObjMgt_Attribute<AttribClass>::SingleInt
0032   {
0033   public:
0034     //! Import transient attribute from the persistent data.
0035     Standard_EXPORT void ImportAttribute() override;
0036   };
0037 
0038   template <class AttribClass, class HStringClass = StdLPersistent_HString::Extended>
0039   class string : public StdObjMgt_Attribute<AttribClass>::SingleRef
0040   {
0041   public:
0042     //! Import transient attribute from the persistent data.
0043     Standard_EXPORT void ImportAttribute() override;
0044   };
0045 
0046 public:
0047   class TagSource : public integer<TDF_TagSource>
0048   {
0049   public:
0050     const char* PName() const override { return "PDF_TagSource"; }
0051   };
0052 
0053   class Reference : public string<TDF_Reference>
0054   {
0055   public:
0056     const char* PName() const override { return "PDF_Reference"; }
0057   };
0058 
0059   class Comment : public string<TDataStd_Comment>
0060   {
0061   public:
0062     const char* PName() const override { return "PDF_Comment"; }
0063   };
0064 
0065   class UAttribute : public string<TDataStd_UAttribute>
0066   {
0067   public:
0068     //! Create an empty transient attribute
0069     Standard_EXPORT occ::handle<TDF_Attribute> CreateAttribute() override;
0070 
0071     const char* PName() const override { return "PDataStd_UAttribute"; }
0072   };
0073 
0074   class Integer : public integer<TDataStd_Integer>
0075   {
0076   public:
0077     //! Create an empty transient attribute
0078     Standard_EXPORT occ::handle<TDF_Attribute> CreateAttribute() override;
0079 
0080     const char* PName() const override { return "PDataStd_Integer"; }
0081   };
0082 
0083   class Name : public string<TDataStd_Name>
0084   {
0085   public:
0086     //! Create an empty transient attribute
0087     Standard_EXPORT occ::handle<TDF_Attribute> CreateAttribute() override;
0088 
0089     const char* PName() const override { return "PDataStd_Name"; }
0090   };
0091 
0092   class AsciiString : public string<TDataStd_AsciiString, StdLPersistent_HString::Ascii>
0093   {
0094   public:
0095     //! Create an empty transient attribute
0096     Standard_EXPORT occ::handle<TDF_Attribute> CreateAttribute() override;
0097 
0098     const char* PName() const override { return "PDataStd_AsciiString"; }
0099   };
0100 };
0101 
0102 template <>
0103 template <>
0104 inline const char* StdObjMgt_Attribute<TDF_TagSource>::Simple<int>::PName() const
0105 {
0106   return "PDF_TagSource";
0107 }
0108 
0109 template <>
0110 template <>
0111 inline const char* StdObjMgt_Attribute<TDF_Reference>::Simple<
0112   occ::handle<StdObjMgt_Persistent>>::PName() const
0113 {
0114   return "PDF_Reference";
0115 }
0116 
0117 template <>
0118 template <>
0119 inline const char* StdObjMgt_Attribute<TDataStd_Comment>::Simple<
0120   occ::handle<StdObjMgt_Persistent>>::PName() const
0121 {
0122   return "PDataStd_Comment";
0123 }
0124 
0125 #endif