retdec
floating_point_type.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_CTYPES_FLOATING_POINT_TYPE_H
8 #define RETDEC_CTYPES_FLOATING_POINT_TYPE_H
9 
10 #include <memory>
11 #include <string>
12 
13 #include "retdec/ctypes/type.h"
14 
15 namespace retdec {
16 namespace ctypes {
17 
18 class Context;
19 
23 class FloatingPointType: public Type
24 {
25  public:
26  static std::shared_ptr<FloatingPointType> create(
27  const std::shared_ptr<Context> &context, const std::string &name, unsigned bitWidth);
28 
29  virtual bool isFloatingPoint() const override;
30 
33  virtual void accept(Visitor *v) override;
35 
36  private:
37  // Instances are created by static method create().
38  FloatingPointType(const std::string &name, unsigned bitWidth);
39 };
40 
41 } // namespace ctypes
42 } // namespace retdec
43 
44 #endif
A representation of floating point types.
Definition: floating_point_type.h:24
virtual bool isFloatingPoint() const override
Definition: floating_point_type.cpp:56
FloatingPointType(const std::string &name, unsigned bitWidth)
Constructs a new floating point type.
Definition: floating_point_type.cpp:21
static std::shared_ptr< FloatingPointType > create(const std::shared_ptr< Context > &context, const std::string &name, unsigned bitWidth)
Creates floating point type.
Definition: floating_point_type.cpp:37
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: floating_point_type.cpp:61
A base class of all C types.
Definition: type.h:22
unsigned bitWidth
Definition: type.h:49
std::string name
Definition: type.h:48
A base class of all C-types' visitors.
Definition: visitor.h:33
A base class of all C types.
Definition: archive_wrapper.h:19