00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/generic/om/Extern.hpp $ 00003 // $Id: Extern.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 #ifndef TORC_GENERIC_OM_EXTERN_HPP 00017 #define TORC_GENERIC_OM_EXTERN_HPP 00018 00019 #include "torc/generic/om/DumpRestoreConfig.hpp" 00020 00021 //BOOST 00022 #ifdef GENOM_SERIALIZATION 00023 #include <boost/serialization/access.hpp> 00024 #endif //GENOM_SERIALIZATION 00025 00026 namespace torc { 00027 00028 namespace generic { 00029 00030 /** 00031 * @brief Used to imeplement extrenal object referencing. 00032 * 00033 * The Extern interface is used by objects to create placeholders for objects that could not be found by the Linker. In itself, the class is pretty simple and uses a single boolean inSource to indicate whether an object is a real object or a place holder. Simplistically, extern objects are used to represent libraries, cells, views and ports declared using the EDIF (extern ... ) syntax. However, in case of multifile parsing, the Linker will try to remove externs from the design hierarchy with newly discovered items. 00034 */ 00035 class Extern 00036 { 00037 #ifdef GENOM_SERIALIZATION 00038 friend class boost::serialization::access; 00039 #endif 00040 00041 public: 00042 /** 00043 * Get whether the item is an extern(placeholder) or an actual item. 00044 * 00045 * @return True if extern, false otherwise 00046 */ 00047 inline bool 00048 getIsExtern() const throw(); 00049 00050 /** 00051 * Get whether the item is an extern(placeholder) or an actual item. 00052 * 00053 * @return True if extern, false otherwise 00054 */ 00055 inline bool 00056 isExtern() const throw(); 00057 00058 /** 00059 * Set whether an item is extern or not. 00060 * 00061 * @param[in] isExtern True if extern, false otherwise 00062 */ 00063 void 00064 setIsExtern(bool inIsExtern) throw(); 00065 00066 00067 protected: 00068 Extern(); 00069 00070 00071 public: 00072 virtual ~Extern() throw(); 00073 00074 00075 private: 00076 Extern(const Extern & source) throw(); 00077 00078 Extern & 00079 operator=(const Extern & source) throw(); 00080 00081 private: 00082 #ifdef GENOM_SERIALIZATION 00083 template<class Archive> void 00084 serialize( Archive &ar, unsigned int ); 00085 #endif //GENOM_SERIALIZATION 00086 00087 bool mIsExtern; 00088 }; 00089 00090 /** 00091 * Get whether the item is an extern(placeholder) or an actual item. 00092 * 00093 * @return True if extern, false otherwise 00094 */ 00095 inline bool 00096 Extern::getIsExtern() const throw() { 00097 return mIsExtern; 00098 } 00099 00100 /** 00101 * Get whether the item is an extern(placeholder) or an actual item. 00102 * 00103 * @return True if extern, false otherwise 00104 */ 00105 inline bool 00106 Extern::isExtern() const throw() { 00107 return mIsExtern; 00108 } 00109 00110 } // namespace torc::generic 00111 00112 } // namespace torc 00113 #endif // TORC_GENERIC_OM_EXTERN_HPP