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/Flattening.hpp $ 00003 // $Id: Flattening.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_FLATTENING_HPP 00017 #define TORC_GENERIC_OM_FLATTENING_HPP 00018 00019 #include "torc/generic/util/Error.hpp" 00020 #include "torc/generic/om/PointerTypes.hpp" 00021 00022 namespace torc { 00023 namespace generic { 00024 00025 /** 00026 * Flatten a given instance. 00027 * Instance flattening is an operation where a given instance is replaced the internals of it's master in a given view. Instance flattening can be achieved on Single or Array Instances. However, it is not supported on the elements of an instance array. 00028 * 00029 * @param[in] inInstance The instance that need to be flattened. This will be removed aafter the operation. 00030 * @param[in] inFactory The object factory used for cloning components in the instance. 00031 * 00032 * @note When connections are made to individual elements of a vector net using for example, say, the portList construct, the bits of the vectors are appropriately broken up into individual scalar nets, and conections removed from the vector nets. 00033 */ 00034 void 00035 flatten( const InstanceSharedPtr &inInstance, 00036 const ObjectFactorySharedPtr &inFactory) throw(Error); 00037 00038 /** 00039 * Flatten a given instance hierarchy. 00040 * Instance flattening is an operation where a given instance is replaced the internals of it's master in a given view. Instance flattening can be achieved on Single or Array Instances. However, it is not supported on the elements of an instance array. Difference with the normal <i>flatten()</i> function is that this will keep flattening the given instance until a set of leaf instances is received. A <i>Leaf Instance</i> is an instance where the view has only interface delcarations and no instantiations of other cells within it. 00041 00042 * 00043 * @param[in] inInstance The instance that need to be flattened. This will be removed aafter the operation. 00044 * @param[in] inFactory The object factory used for cloning components in the instance. 00045 * 00046 * @note When connections are made to individual elements of a vector net using for example, say, the portList construct, the bits of the vectors are appropriately broken up into individual scalar nets, and conections removed from the vector nets. 00047 */ 00048 void 00049 flatten_hierarchy( const InstanceSharedPtr &inInstance, 00050 const ObjectFactorySharedPtr &inFactory) throw(Error); 00051 00052 } //namespace generic 00053 } //namespace torc 00054 00055 #endif // TORC_GENERIC_OM_FLATTENING_HPP