ROSE  0.11.145.0
Tag.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_Tag_H
2 #define ROSE_BinaryAnalysis_ModelChecker_Tag_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_MODEL_CHECKER
5 
6 #include <Rose/BinaryAnalysis/ModelChecker/Types.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace ModelChecker {
11 
13 // Base class
15 
22 class Tag: public std::enable_shared_from_this<Tag> {
23 public:
25  using Ptr = TagPtr;
26 
27 private:
28  const size_t nodeStep_; // index of the step of the node to which this tag applies
29 
30 protected:
31  Tag(size_t nodeStep);
32 public:
33  virtual ~Tag();
34 
35 public:
42  size_t nodeStep() const;
43 
50  virtual std::string name() const = 0;
51 
58  virtual std::string printableName() const = 0;
59 
67  virtual void print(std::ostream&, const std::string &prefix) const = 0;
68 
75  virtual void toYaml(std::ostream&, const std::string &prefix) const = 0;
76 };
77 
79 // ThrowableTag
81 
83 struct ThrownTag {
84  Tag::Ptr tag;
85 };
86 
88 // NameTag
90 
94 class NameTag: public Tag {
95 public:
96  using Ptr = NameTagPtr;
97 
98 protected:
99  const std::string name_;
100 
101 protected:
102  explicit NameTag(size_t nodeStep, const std::string &name);
103 
104 public:
108  static Ptr instance(size_t nodeStep, const std::string &name);
109 
110 public:
111  virtual std::string name() const override;
112  virtual std::string printableName() const override;
113  virtual void print(std::ostream&, const std::string &prefix) const override;
114  virtual void toYaml(std::ostream&, const std::string &prefix) const override;
115 };
116 
117 } // namespace
118 } // namespace
119 } // namespace
120 
121 #endif
122 #endif
Main namespace for the ROSE library.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.