SheafSystem  0.0.0.0
report.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class report
19 
20 #ifndef REPORT_H
21 #define REPORT_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef BLOCK_H
28 #include "SheafSystem/block.h"
29 #endif
30 
31 #ifndef STOP_WATCH_H
32 #include "SheafSystem/stop_watch.h"
33 #endif
34 
35 #ifndef STD_STRING_H
36 #include "SheafSystem/std_string.h"
37 #endif
38 
39 namespace sheaf
40 {
41 
42 class namespace_poset;
43 
47 class SHEAF_DLL_SPEC report
48 {
49 
50 public:
51 
52  // ===========================================================
53  // ANY FACET
54  // ===========================================================
55 
59  virtual bool invariant() const;
60 
61  // ===========================================================
62  // REPORT FACET
63  // ===========================================================
64 
68  report();
69 
73  report(const namespace_poset* xname_space);
74 
78  virtual ~report();
79 
83  void start(const std::string& xname);
84 
88  void reset();
89 
93  void point(const std::string& xname);
94 
98  void write(const std::string& xfile_name) const;
99 
103  inline const namespace_poset* name_space() const
104  {
105  return _name_space;
106  };
107 
111  inline std::string title() const
112  {
113  return _title;
114  };
115 
119  inline stop_watch watch() const
120  {
121  return _watch;
122  };
123 
127  inline block<std::string> names() const
128  {
129  return _names;
130  };
131 
135  inline block<size_t> memory() const
136  {
137  return _memory;
138  }
139 
143  inline block<size_t> memory_part(int lpart) const
144  {
145  return _memory_parts[lpart];
146  }
147 
148 private:
149 
153  const namespace_poset* _name_space;
154 
158  std::string _title;
159 
163  stop_watch _watch;
164 
168  block<std::string> _names;
169 
173  block<size_t> _memory;
174 
178  block<size_t> _memory_parts[4];
179 
180 };
181 
182 // ===========================================================
183 // NON-MEMBER FUNCTIONS
184 // ===========================================================
185 
189 SHEAF_DLL_SPEC
190 std::ostream & operator << (std::ostream &os, report& xreport);
191 
192 } // namespace sheaf
193 
194 #endif // ifndef STOP_WATCH_H
std::string title() const
Title of the report.
Definition: report.h:111
block< size_t > memory() const
Deep size of the namespace poset for each point.
Definition: report.h:135
block< std::string > names() const
Names of the report points.
Definition: report.h:127
The default name space; a poset which contains other posets as members.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
block< size_t > memory_part(int lpart) const
Deep size of the namespace for each component for each point.
Definition: report.h:143
A report generating class.
Definition: report.h:47
A clock for timing intervals.
Definition: stop_watch.h:45
stop_watch watch() const
Stop watch used to time the report points.
Definition: report.h:119
const namespace_poset * name_space() const
Namespace for the report.
Definition: report.h:103