FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
Object.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #define NOMINMAX // Removes windows min and max macros
4 #define _USE_MATH_DEFINES
5 #include "FAST/Exception.hpp"
6 #include "FAST/Reporter.hpp"
7 #include <memory>
8 
9 #define FAST_OBJECT(className) \
10  public: \
11  typedef std::shared_ptr<className> pointer; \
12  static std::shared_ptr<className> New() { \
13  std::shared_ptr<className> smartPtr(new className()); \
14  smartPtr->setPtr(smartPtr); \
15  \
16  return smartPtr; \
17  } \
18  virtual std::string getNameOfClass() const { \
19  return std::string(#className); \
20  }; \
21  static std::string getStaticNameOfClass() { \
22  return std::string(#className); \
23  }; \
24  private: \
25  void setPtr(className::pointer ptr) { \
26  mPtr = ptr; \
27  } \
28 
29 
30 namespace fast {
31 
33 
34 class FAST_EXPORT Object {
35  public:
36  typedef std::shared_ptr<Object> pointer;
37  Object();
38  virtual ~Object() {};
39  static std::string getStaticNameOfClass() {
40  return "Object";
41  }
42  Reporter& getReporter();
43  protected:
44  Reporter& reportError();
45  Reporter& reportWarning();
46  Reporter& reportInfo();
47  ReporterEnd reportEnd() const;
48  std::weak_ptr<Object> mPtr;
49  private:
50  Reporter mReporter;
51 
52 };
53 
54 }
fast::Object::~Object
virtual ~Object()
Definition: Object.hpp:38
fast
Definition: AffineTransformation.hpp:7
fast::StreamingMode
StreamingMode
Definition: Object.hpp:32
fast::Object
Definition: Object.hpp:34
fast::Object::mPtr
std::weak_ptr< Object > mPtr
Definition: Object.hpp:48
fast::Reporter
Definition: Reporter.hpp:20
fast::STREAMING_MODE_PROCESS_ALL_FRAMES
@ STREAMING_MODE_PROCESS_ALL_FRAMES
Definition: Object.hpp:32
fast::Object::getStaticNameOfClass
static std::string getStaticNameOfClass()
Definition: Object.hpp:39
fast::ReporterEnd
Definition: Reporter.hpp:16
fast::Object::pointer
std::shared_ptr< Object > pointer
Definition: Object.hpp:36
Reporter.hpp
Exception.hpp
fast::STREAMING_MODE_STORE_ALL_FRAMES
@ STREAMING_MODE_STORE_ALL_FRAMES
Definition: Object.hpp:32
fast::STREAMING_MODE_NEWEST_FRAME_ONLY
@ STREAMING_MODE_NEWEST_FRAME_ONLY
Definition: Object.hpp:32