Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/TDF_Attribute.lxx is written in an unsupported language. File is not indexed.

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-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 //              -----------------
0017 
0018 // Version:     0.0
0019 //Version       Date            Purpose
0020 //              0.0     Feb 14 1997     Creation
0021 
0022 enum {
0023   TDF_AttributeValidMsk     = 1,
0024   TDF_AttributeBackupMsk    = 2,
0025   TDF_AttributeForgottenMsk = 4
0026 };
0027 
0028 inline Standard_Integer TDF_Attribute::Transaction() const
0029 { return myTransaction; }
0030 
0031 // Validation
0032 inline void TDF_Attribute::Validate(const Standard_Boolean aStatus)
0033 { myFlags = (aStatus) ?
0034     (myFlags | TDF_AttributeValidMsk) : (myFlags & ~TDF_AttributeValidMsk); }
0035 
0036 inline Standard_Boolean TDF_Attribute::IsValid() const
0037 { return (myFlags & TDF_AttributeValidMsk) != 0 ; }
0038 
0039 // Backup
0040 inline void TDF_Attribute::Backup(const Standard_Boolean aStatus)
0041 {
0042   myFlags = (aStatus) ?
0043     (myFlags | TDF_AttributeBackupMsk) : (myFlags & ~ TDF_AttributeBackupMsk);
0044   Validate(!aStatus);
0045 }
0046 
0047 inline Standard_Boolean TDF_Attribute::IsBackuped() const
0048 { return (myFlags & TDF_AttributeBackupMsk) != 0; }
0049 
0050 // IsNew
0051 inline Standard_Boolean TDF_Attribute::IsNew() const
0052 { return IsValid () && myBackup.IsNull(); }
0053 
0054 // IsForgotten
0055 inline Standard_Boolean TDF_Attribute::IsForgotten() const
0056 { return (myFlags & TDF_AttributeForgottenMsk) != 0; }
0057 
0058 // operator <<
0059 inline Standard_OStream& operator << (Standard_OStream& anOS,
0060                                       const Handle(TDF_Attribute)& anAtt)
0061 { return anAtt->Dump(anOS); }