2 #ifndef ROSE_AST_NodeId_H
3 #define ROSE_AST_NodeId_H
8 #define NODEID_INCLUDE_ROSE_VERSION 1
13 namespace Rose {
namespace AST {
56 NodeId(
size_t poolId,
size_t nodeId,
SgNode* inNode) : poolIndex(poolId), nodeIndex(nodeId), node(inNode) {}
73 NodeId() : poolIndex(
std::numeric_limits<size_t>::max()), nodeIndex(
std::numeric_limits<size_t>::max()), node(nullptr) {}
78 NodeId(
const NodeId &rhs) : poolIndex(rhs.poolIndex), nodeIndex(rhs.nodeIndex), node(rhs.node) {}
82 poolIndex = rhs.poolIndex;
83 nodeIndex = rhs.nodeIndex;
92 static NodeId getId(
const std::string& nodeIdString);
96 return getId(nodeIdString).getNode();
103 std::string toString()
const;
105 bool operator==(
const NodeId& rhs)
const {
106 if(poolIndex == rhs.poolIndex &&
107 nodeIndex == rhs.nodeIndex &&
114 bool operator!=(
const NodeId& rhs)
const {
return !(this->operator==(rhs)); }
115 bool operator< (
const NodeId& rhs)
const {
116 if(poolIndex < rhs.poolIndex ||
117 nodeIndex < rhs.nodeIndex ||
123 bool operator<= (
const NodeId& rhs)
const {
124 if(poolIndex <= rhs.poolIndex ||
125 nodeIndex <= rhs.nodeIndex ||
132 bool operator> (
const NodeId& rhs)
const {
return !(this->operator<=(rhs));}
133 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