1 // Copyright (c) 2020 OPEN CASCADE SAS 2 // 3 // This file is part of Open CASCADE Technology software library. 4 // 5 // This library is free software; you can redistribute it and/or modify it under 6 // the terms of the GNU Lesser General Public License version 2.1 as published 7 // by the Free Software Foundation, with special exception defined in the file 8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 9 // distribution for complete text of the license and disclaimer of any warranty. 10 // 11 // Alternatively, this file may be used under the terms of Open CASCADE 12 // commercial license or contractual agreement. 13 14 #ifndef _Message_AttributeObject_HeaderFile 15 #define _Message_AttributeObject_HeaderFile 16 17 #include <Message_Attribute.hxx> 18 19 class Standard_Transient; 20 21 //! Alert object storing a transient object 22 class Message_AttributeObject : public Message_Attribute 23 { 24 DEFINE_STANDARD_RTTIEXT(Message_AttributeObject, Message_Attribute) 25 public: 26 //! Constructor with string argument 27 Standard_EXPORT Message_AttributeObject (const Handle(Standard_Transient)& theObject, 28 const TCollection_AsciiString& theName = TCollection_AsciiString()); 29 30 //! Returns object 31 //! @return the object instance Handle(Standard_Transient)32 const Handle(Standard_Transient)& Object() const { return myObject; } 33 34 //! Sets the object 35 //! @param theObject an instance SetObject(const Handle (Standard_Transient)& theObject)36 void SetObject (const Handle(Standard_Transient)& theObject) { myObject = theObject; } 37 38 //! Dumps the content of me into the stream 39 virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream, 40 Standard_Integer theDepth = -1) const Standard_OVERRIDE; 41 42 private: 43 Handle(Standard_Transient) myObject; //!< alert object 44 }; 45 46 #endif // _Message_AttributeObject_HeaderFile 47