Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:18:53

0001 // Created on: 2007-05-29
0002 // Created by: Vlad Romashko
0003 // Copyright (c) 2007-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 #ifndef _TDataStd_IntegerList_HeaderFile
0017 #define _TDataStd_IntegerList_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <Standard_Integer.hxx>
0022 #include <NCollection_List.hxx>
0023 #include <TDF_Attribute.hxx>
0024 #include <Standard_OStream.hxx>
0025 #include <Standard_GUID.hxx>
0026 
0027 class TDF_Label;
0028 class TDF_RelocationTable;
0029 
0030 //! Contains a list of integers.
0031 class TDataStd_IntegerList : public TDF_Attribute
0032 {
0033 
0034 public:
0035   //! Static methods
0036   //! ==============
0037   //! Returns the ID of the list of integer attribute.
0038   Standard_EXPORT static const Standard_GUID& GetID();
0039 
0040   //! Finds or creates a list of integer values attribute.
0041   Standard_EXPORT static occ::handle<TDataStd_IntegerList> Set(const TDF_Label& label);
0042 
0043   //! Finds or creates a list of integer values attribute with explicit user defined <guid>.
0044   Standard_EXPORT static occ::handle<TDataStd_IntegerList> Set(const TDF_Label&     label,
0045                                                                const Standard_GUID& theGuid);
0046 
0047   Standard_EXPORT TDataStd_IntegerList();
0048 
0049   Standard_EXPORT bool IsEmpty() const;
0050 
0051   Standard_EXPORT int Extent() const;
0052 
0053   Standard_EXPORT void Prepend(const int value);
0054 
0055   Standard_EXPORT void Append(const int value);
0056 
0057   //! Sets the explicit GUID (user defined) for the attribute.
0058   Standard_EXPORT void SetID(const Standard_GUID& theGuid) override;
0059 
0060   //! Sets default GUID for the attribute.
0061   Standard_EXPORT void SetID() override;
0062 
0063   //! Inserts the <value> before the first meet of <before_value>.
0064   Standard_EXPORT bool InsertBefore(const int value, const int before_value);
0065 
0066   //! Inserts the <value> before the <index> position.
0067   //! The indices start with 1 .. Extent().
0068   Standard_EXPORT bool InsertBeforeByIndex(const int index, const int before_value);
0069 
0070   //! Inserts the <value> after the first meet of <after_value>.
0071   Standard_EXPORT bool InsertAfter(const int value, const int after_value);
0072 
0073   //! Inserts the <value> after the <index> position.
0074   //! The indices start with 1 .. Extent().
0075   Standard_EXPORT bool InsertAfterByIndex(const int index, const int after_value);
0076 
0077   //! Removes the first meet of the <value>.
0078   Standard_EXPORT bool Remove(const int value);
0079 
0080   //! Removes a value at <index> position.
0081   Standard_EXPORT bool RemoveByIndex(const int index);
0082 
0083   Standard_EXPORT void Clear();
0084 
0085   Standard_EXPORT int First() const;
0086 
0087   Standard_EXPORT int Last() const;
0088 
0089   Standard_EXPORT const NCollection_List<int>& List() const;
0090 
0091   Standard_EXPORT const Standard_GUID& ID() const override;
0092 
0093   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& With) override;
0094 
0095   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0096 
0097   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       Into,
0098                              const occ::handle<TDF_RelocationTable>& RT) const override;
0099 
0100   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0101 
0102   //! Dumps the content of me into the stream
0103   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0104 
0105   DEFINE_STANDARD_RTTIEXT(TDataStd_IntegerList, TDF_Attribute)
0106 
0107 private:
0108   NCollection_List<int> myList;
0109   Standard_GUID         myID;
0110 };
0111 
0112 #endif // _TDataStd_IntegerList_HeaderFile