00001 /******************************************************************************* 00002 00003 Copyright (C) 2007 by Brendon Costa 00004 00005 This library is free software; you can redistribute it and/or modify 00006 it under the terms of the "LGPL Like" License defined in the file COPYING 00007 that should have been distributed along with this source. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 You should have received a copy of the "LGPL Like" License 00014 along with this library; see the file COPYING. if not, it can be 00015 obtained from the EDoc++ website: 00016 http://edoc.sourceforge.net/license.html 00017 00018 *******************************************************************************/ 00019 #ifndef EDOC_TYPELOC_H 00020 #define EDOC_TYPELOC_H 00021 00022 #include "EDoc/DictionarySpecific.h" 00023 #include "EDoc/Location.h" 00024 00025 namespace EDoc 00026 { 00027 class Type; 00028 class PersistenceIFace; 00029 class IndexedDictionary; 00030 class PStack; 00031 00032 //=========================================================================== 00033 /** \brief Is a conglomerate of a reference to a Type object and a 00034 * Location in a source file. 00035 * 00036 * This can be used for a few purposes one of which is to information about 00037 * the type of an exception and where it was thrown. See Exception class for 00038 * more info. 00039 */ 00040 class TypeLoc : public DictionarySpecific 00041 { 00042 public: 00043 00044 //------------------------------------------------------------------------ 00045 /** \brief See CodeBlock::CodeBlock(Dictionary* dict_in=NULL) 00046 */ 00047 TypeLoc(Dictionary* dict_in=NULL); 00048 00049 //------------------------------------------------------------------------ 00050 /** \brief See CodeBlock::CodeBlock(const CodeBlock& right) 00051 */ 00052 TypeLoc(const TypeLoc& right); 00053 00054 //------------------------------------------------------------------------ 00055 /** \brief See CodeBlock::CodeBlock(const CodeBlock& right, 00056 * Dictionary& dict_in) 00057 */ 00058 TypeLoc(const TypeLoc& right, Dictionary& dict_in); 00059 00060 //------------------------------------------------------------------------ 00061 /** \brief See CodeBlock::operator=() 00062 */ 00063 TypeLoc& operator=(const TypeLoc& right); 00064 00065 //------------------------------------------------------------------------ 00066 /** \brief See CodeBlock::Read() 00067 */ 00068 void Read(PersistenceIFace& file, IndexedDictionary& idict); 00069 00070 //------------------------------------------------------------------------ 00071 /** \brief See CodeBlock::Write() 00072 */ 00073 void Write(PersistenceIFace& file) const; 00074 00075 //------------------------------------------------------------------------ 00076 /** \brief See DictionarySpecific::ReplaceReferences() 00077 */ 00078 virtual size_t ReplaceReferences(PStack& stack, 00079 void* remove, void* replace); 00080 00081 //------------------------------------------------------------------------ 00082 /** \brief See DictionarySpecific::Print() 00083 */ 00084 virtual std::ostream& Print(std::ostream& out, 00085 std::string prefix="") const; 00086 00087 //------------------------------------------------------------------------ 00088 /** \brief See DictionarySpecific::Validate() 00089 */ 00090 virtual void Validate(PStack& stack, const Dictionary& dict_in) const; 00091 00092 //------------------------------------------------------------------------ 00093 /** \brief Equivilance operator (Works across dictionaries). 00094 */ 00095 bool operator==(const TypeLoc& right) const; 00096 00097 00098 00099 00100 //------------------------------------------------------------------------ 00101 /** \brief A location in a source file. 00102 */ 00103 Location loc; 00104 00105 //------------------------------------------------------------------------ 00106 /** \brief A reference to a Type. 00107 */ 00108 Type* value; 00109 00110 //------------------------------------------------------------------------ 00111 00112 }; 00113 //=========================================================================== 00114 00115 } 00116 00117 #endif // EDOC_TYPELOC_H