|
OpenADFortTk (basic)
|
00001 // ########################################################## 00002 // # This file is part of OpenADFortTk. # 00003 // # The full COPYRIGHT notice can be found in the top # 00004 // # level directory of the OpenADFortTk source tree. # 00005 // # For more information visit # 00006 // # http://www.mcs.anl.gov/openad # 00007 // ########################################################## 00008 #ifndef XlationCtxt_INCLUDED 00009 #define XlationCtxt_INCLUDED 00010 00011 00012 #include <iostream> 00013 00014 #include <inttypes.h> 00015 00016 // CtxtFlags: represents the current context 00017 class CtxtFlags { 00018 public: 00019 CtxtFlags(); 00020 virtual ~CtxtFlags(); 00021 00022 // ------------------------------------------------------- 00023 // Flags for context 00024 // ------------------------------------------------------- 00025 00026 // Tests to see if *all* of the specified flags are set 00027 bool AreFlags(uint32_t f) const { return ((flags & f) == f); } 00028 00029 // Tests to see if *any* of the specified flags are set 00030 bool IsAnyFlag(uint32_t f) const { return (flags & f); } 00031 00032 void SetFlags(uint32_t f) { flags = flags | f; } 00033 void ResetFlags(uint32_t f) { flags = flags & ~f; } 00034 00035 virtual void Dump(std::ostream& o = std::cerr) const; 00036 virtual void DDump() const; 00037 00038 private: 00039 uint32_t flags; 00040 00041 }; 00042 00043 #endif /* XlationCtxt_INCLUDED */