torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Routethrough.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for the Routethrough class.
18 
19 #ifndef TORC_PHYSICAL_ROUTETHROUGH_HPP
20 #define TORC_PHYSICAL_ROUTETHROUGH_HPP
21 
22 #include "torc/physical/Config.hpp"
24 #include <string>
25 
26 namespace torc {
27 namespace physical {
28 
29  /// \brief Pip routethrough.
30  /// \details A routethrough defines how a signal passes through logic resources on its way to
31  /// wiring resources.
32  class Routethrough : public Config {
33  protected:
34  // types
35  /// \brief Imported type name.
37  // members
38  /// \brief The _ROUTETHROUGH setting in the associated instance.
39  string mSetting;
40  /// \brief The instance in which the routethrough is implemented.
42  /// \brief The routethrough instance source wire.
44  /// \brief The routethrough instance sink wire.
46  public:
47  // constructors
48  /// \brief Public constructor.
49  /// \param inSetting The _ROUTETHROUGH setting in the associated instance.
50  /// \param inName The _ROUTETHROUGH name in the associated instance.
51  /// \param inValue The _ROUTETHROUGH value in the associated instance.
52  /// \param inInstancePtr The instance weak pointer.
53  /// \param inSourceWireName The instance source wire name.
54  /// \param inSinkWireName The instance sink wire name.
55  Routethrough(const string& inSetting, const string& inName, const string& inValue,
56  const InstanceWeakPtr& inInstancePtr, const string& inSourceWireName,
57  const string& inSinkWireName)
58  : Config(inName, inValue), mSetting(inSetting), mInstancePtr(inInstancePtr),
59  mSourceWireName(inSourceWireName), mSinkWireName(inSinkWireName) {}
60  // accessors
61  /// \brief Returns the _ROUTETHROUGH setting.
62  const string& getSetting(void) const { return mSetting; }
63  /// \brief Returns the instance weak pointer.
64  const InstanceWeakPtr& getInstancePtr(void) const { return mInstancePtr; }
65  /// \brief Returns the instance source wire name.
66  const WireName& getSourceWireName(void) const { return mSourceWireName; }
67  /// \brief Returns the instance sink wire name.
68  const WireName& getSinkWireName(void) const { return mSinkWireName; }
69  };
70 
71  /// \brief Shared pointer encapsulation of a Routethrough.
72  typedef boost::shared_ptr<Routethrough> RoutethroughSharedPtr;
73 
74  /// \brief Weak pointer encapsulation of a Routethrough.
75  typedef boost::weak_ptr<Routethrough> RoutethroughWeakPtr;
76 
77 } // namespace physical
78 } // namespace torc
79 
80 #endif // TORC_PHYSICAL_ROUTETHROUGH_HPP
boost::weak_ptr< Routethrough > RoutethroughWeakPtr
Weak pointer encapsulation of a Routethrough.
WireName mSourceWireName
The routethrough instance source wire.
const WireName & getSinkWireName(void) const
Returns the instance sink wire name.
Encapsulation of a wire name.
const string & getSetting(void) const
Returns the _ROUTETHROUGH setting.
Routethrough(const string &inSetting, const string &inName, const string &inValue, const InstanceWeakPtr &inInstancePtr, const string &inSourceWireName, const string &inSinkWireName)
Public constructor.
Header for the Config class.
Header for the Instance class.
std::string string
string mSetting
The _ROUTETHROUGH setting in the associated instance.
InstanceWeakPtr mInstancePtr
The instance in which the routethrough is implemented.
Configuration. A {name:value} pair.
Definition: Config.hpp:39
std::string string
Imported type name.
const WireName & getSourceWireName(void) const
Returns the instance source wire name.
WireName mSinkWireName
The routethrough instance sink wire.
boost::shared_ptr< Routethrough > RoutethroughSharedPtr
Shared pointer encapsulation of a Routethrough.
boost::weak_ptr< Instance > InstanceWeakPtr
Weak pointer encapsulation of an Instance.
const InstanceWeakPtr & getInstancePtr(void) const
Returns the instance weak pointer.