Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_Object.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 // Kris
11 // 07.08.03 -- Move into Teuchos package/namespace
12 
13 #ifndef _TEUCHOS_OBJECT_HPP_
14 #define _TEUCHOS_OBJECT_HPP_
15 
20 #include "Teuchos_ConfigDefs.hpp"
21 #include "Teuchos_DataAccess.hpp"
22 
23 // 2007/11/26: rabartl: This class has to change from using 'char*' to
24 // std::string!
25 
34 namespace Teuchos {
35 
36 class TEUCHOSNUMERICS_LIB_DLL_EXPORT Object {
37 public:
39 
40 
51  Object (int tracebackModeIn = -1);
52 
54 
58  Object (const char* label, int tracebackModeIn = -1);
59 
62  Object (const std::string& label, int tracebackModeIn = -1);
63 
65  virtual ~Object () {}
66 
68 
70 
71  // LEGACY; REPLACE "const char*" with std::string.
72  virtual void setLabel (const char* theLabel);
73 
86  static void setTracebackMode (int tracebackModeValue);
87 
89 
91 
93  virtual const char* label () const;
94 
96  static int getTracebackMode();
97 
99 
101 
103  virtual void print (std::ostream& os) const;
104 
106 
108 
110  virtual int reportError (const std::string message, int errorCode) const;
111 
113 
114  static int tracebackMode;
115 
116 private:
118  std::string label_;
119 };
120 
123 std::ostream& operator<< (std::ostream& os, const Teuchos::Object& obj);
124 
125 } // namespace Teuchos
126 
127 #endif /* _TEUCHOS_OBJECT_HPP_ */
virtual ~Object()
Destructor (virtual, for safety of derived classes).
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
The base Teuchos class.
Teuchos::DataAccess Mode enumerable type.