NamedLoc.hpp

Go to the documentation of this file.
00001 
00014 #ifndef NamedLoc_H
00015 #define NamedLoc_H
00016 
00017 #include "Location.hpp"
00018 
00019 namespace OA {
00020 
00025 class NamedLoc: public Location {
00026   public:
00027     NamedLoc(SymHandle sh, bool isLocal) :
00028         mSymHandle(sh), mLocal(isLocal) { }
00029 
00031     NamedLoc(NamedLoc &other); 
00032 
00033     ~NamedLoc() { }
00034 
00035     void addFullOverlap(SymHandle s) { mFullOverlap.insert(s); }
00036     void addPartOverlap(SymHandle s) { mPartOverlap.insert(s); }
00037 
00038     void acceptVisitor(LocationVisitor& pVisitor);
00039 
00040     //*****************************************************************
00041     // Subclass type methods 
00042     //*****************************************************************
00043     bool isaNamed() { return true; }
00044 
00045     //*****************************************************************
00046     // Info methods 
00047     //*****************************************************************
00049     OA_ptr<Location> getBaseLoc(); 
00050 
00051     bool isLocal() { return mLocal; }
00052     bool isUnique() { return true; }
00053     SymHandle getSymHandle() { return mSymHandle; }
00054     bool staticFullOverlap(SymHandle);
00055     bool staticPartOverlap(SymHandle);
00056     OA_ptr<SymHandleIterator> getPartOverlapIter();
00057     OA_ptr<SymHandleIterator> getFullOverlapIter();
00058 
00059     //*****************************************************************
00060     // Relationship methods 
00061     //*****************************************************************
00062     bool operator<(Location & other);
00063     bool operator==(Location& other);
00064 
00065     bool mayOverlap(Location& other);
00066 
00067     bool mustOverlap(Location& other);
00068 
00069     bool subSetOf(Location& other);
00070 
00071     //*****************************************************************
00072     // Annotation Interface
00073     //*****************************************************************
00074     void output(IRHandlesIRInterface& ir); 
00075 
00076     //*****************************************************************
00077     // Debugging
00078     //*****************************************************************
00079     void dump(std::ostream& os);
00080     void dump(std::ostream& os, OA_ptr<IRHandlesIRInterface> pIR);
00081 
00082     std::string toString(OA_ptr<IRHandlesIRInterface> pIR);
00083 
00084     virtual int getOrder() { return sOrder; }
00085 
00086   private:
00087     SymHandle mSymHandle;
00088 
00089     bool mLocal;
00090     
00091     // need sets for these so can use comparison of sets
00092     std::set<SymHandle>  mFullOverlap;
00093     std::set<SymHandle>  mPartOverlap;
00094 
00095     static const int sOrder = 100;
00096 };
00097 
00098 }
00099 
00100 #endif

Generated on Sat Oct 31 05:21:24 2009 for OpenAnalysis by  doxygen 1.6.1