LLVM API Documentation

ilist_node.h

Go to the documentation of this file.
00001 //==-- llvm/ADT/ilist_node.h - Intrusive Linked List Helper ------*- C++ -*-==//
00002 // 
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 // 
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the ilist_node class template, which is a convenient
00011 // base class for creating classes that can be used with ilists.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_ADT_ILIST_NODE_H
00016 #define LLVM_ADT_ILIST_NODE_H
00017 
00018 namespace llvm {
00019 
00020 template<typename NodeTy>
00021 struct ilist_nextprev_traits;
00022 
00023 /// ilist_node - Base class that provides next/prev services for nodes
00024 /// that use ilist_nextprev_traits or ilist_default_traits.
00025 ///
00026 template<typename NodeTy>
00027 class ilist_node {
00028 private:
00029   friend struct ilist_nextprev_traits<NodeTy>;
00030   NodeTy *Prev, *Next;
00031   NodeTy *getPrev() { return Prev; }
00032   NodeTy *getNext() { return Next; }
00033   const NodeTy *getPrev() const { return Prev; }
00034   const NodeTy *getNext() const { return Next; }
00035   void setPrev(NodeTy *N) { Prev = N; }
00036   void setNext(NodeTy *N) { Next = N; }
00037 protected:
00038   ilist_node() : Prev(0), Next(0) {}
00039 };
00040 
00041 } // End llvm namespace
00042 
00043 #endif



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.