2 #ifndef ROSE_AST_NodeId_H
3 #define ROSE_AST_NodeId_H
8 #define NODEID_INCLUDE_ROSE_VERSION 1
13 namespace Rose {
namespace AST {
66 NodeId(
size_t poolId,
size_t nodeId,
SgNode* inNode) : poolIndex(poolId), nodeIndex(nodeId), node(inNode) {}
70 static void initRunHash();
99 static std::string run_hash;
103 NodeId() : poolIndex(
std::numeric_limits<size_t>::max()), nodeIndex(
std::numeric_limits<size_t>::max()), node(nullptr) {}
108 NodeId(
const NodeId &rhs) : poolIndex(rhs.poolIndex), nodeIndex(rhs.nodeIndex), node(rhs.node) {}
112 poolIndex = rhs.poolIndex;
113 nodeIndex = rhs.nodeIndex;
122 static NodeId getId(
const std::string& nodeIdString);
126 return getId(nodeIdString).getNode();
133 std::string toString()
const;
135 bool operator==(
const NodeId& rhs)
const {
136 if(poolIndex == rhs.poolIndex &&
137 nodeIndex == rhs.nodeIndex &&
144 bool operator!=(
const NodeId& rhs)
const {
return !(this->operator==(rhs)); }
145 bool operator< (
const NodeId& rhs)
const {
146 if(poolIndex < rhs.poolIndex ||
147 nodeIndex < rhs.nodeIndex ||
153 bool operator<= (
const NodeId& rhs)
const {
154 if(poolIndex <= rhs.poolIndex ||
155 nodeIndex <= rhs.nodeIndex ||
162 bool operator> (
const NodeId& rhs)
const {
return !(this->operator<=(rhs));}
163 bool operator>=(
const NodeId& rhs)
const {
return !(this->operator< (rhs));}
NodeId & operator=(const NodeId &rhs)
assignment operator
SgNode * getNode() const
Get the SgNode* contained in this NodeId.
Main namespace for the ROSE library.
This class represents the base class for all IR nodes within Sage III.
static SgNode * getNode(const std::string &nodeIdString)
Get the SgNode from a string (convinience function)
A mostly static class for creating and storing Unique Node Identifiers.
NodeId()
default constructor required for containers, but only makes invalid NodeIds
NodeId(const NodeId &rhs)
copy constructor