torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortElement.cpp
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 #include <vector>
17 
19 #include "torc/generic/Port.hpp"
21 
22 namespace torc {
23 namespace generic {
24 
25 /**
26  * Set the port element type
27  *
28  * @param[in] Pointer to port element type
29  */
30 void PortElement::setType(const ElementType& inSource) {
31  mType = inSource;
32 }
33 
34 PortElement::PortElement() : mType(eElementTypePort), mPort(), mPortReference() {}
35 
37  mType(eElementTypePort), mPort(inPort), mPortReference() {}
38 
40  mType(eElementTypePortReference), mPort(), mPortReference(inPortRef) {}
41 
43  mType(inRhs.mType), mPort(inRhs.mPort), mPortReference(inRhs.mPortReference) {}
44 
46  if(this == &inRhs) {
47  mType = inRhs.mType;
48  mPort = inRhs.mPort;
50  }
51  return *this;
52 }
53 
55 
56 } // namespace generic
57 } // namespace torc
PortReferenceSharedPtr mPortReference
Definition: PortElement.hpp:83
Represents port element like port or port reference.
Definition: PortElement.hpp:32
PortElement & operator=(const PortElement &inRhs)
Definition: PortElement.cpp:45
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void setType(const ElementType &inSource)
Definition: PortElement.cpp:30
boost::shared_ptr< Port > PortSharedPtr