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/architecture/PrimitiveConn.hpp $ 00003 // $Id: PrimitiveConn.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 /// \file 00017 /// \brief Header for the PrimitiveConn class. 00018 00019 #ifndef TORC_ARCHITECTURE_PRIMITIVECONN_HPP 00020 #define TORC_ARCHITECTURE_PRIMITIVECONN_HPP 00021 00022 #include "torc/architecture/PrimitiveElementPin.hpp" 00023 00024 namespace torc { 00025 namespace architecture { 00026 00027 namespace architecture { class PrimitiveConnUnitTest; } 00028 00029 /// \brief Encapsulation of a PrimitiveDef internal connection. 00030 /// \detail This class is analogous to a permanent net with one and only source pin. All 00031 /// PrimitiveConn objects are initialized from a family database by the Sites class. 00032 class PrimitiveConn { 00033 protected: 00034 // friends 00035 /// \brief The Sites class has access to our internals. 00036 friend class Sites; 00037 /// \brief Our unit test class has access to our internals. 00038 friend class torc::architecture::architecture::PrimitiveConnUnitTest; 00039 // members 00040 /// \brief Pointer to the source primitive element pin. 00041 const PrimitiveElementPin* mSourcePtr; 00042 /// \brief Vector of pointers to the sink primitive element pins. 00043 PrimitiveElementPinPtrVector mSinks; 00044 public: 00045 // accessors 00046 /// \brief Returns a pointer to the source primitive element pin. 00047 const PrimitiveElementPin* getSourcePtr(void) const { return mSourcePtr; } 00048 /// \brief Returns a vector of pointers to the sink primitive element pins. 00049 const PrimitiveElementPinPtrVector& getSinks(void) const { return mSinks; } 00050 }; 00051 00052 /// \brief Array of shared pointers to PrimitiveConn objects. 00053 typedef Array<PrimitiveConnSharedPtr> PrimitiveConnSharedPtrArray; 00054 00055 } // namespace architecture 00056 } // namespace torc 00057 00058 #endif // TORC_ARCHITECTURE_PRIMITIVECONN_HPP