torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConnectionHandler.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 #ifdef HAVE_CONFIG_H
17 #include "torc/generic/config.h"
18 #endif //HAVE_CONFIG_H
20 #include "torc/generic/Net.hpp"
21 
22 namespace torc {
23 namespace generic {
24 
26  try {
27  mNet->addConnectedPort(inPort);
28  } catch(Error& e) {
29  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
30  throw;
31  }
32 }
33 
35  try {
36  mNet->removeConnectedPort(inPort);
37  } catch(Error& e) {
38  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
39  throw;
40  }
41 }
42 
44  try {
45  mNet->addConnectedPortReference(inPortRef);
46  } catch(Error& e) {
47  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
48  throw;
49  }
50 }
51 
53  throw(Error) {
54  try {
55  mNet->removeConnectedPortReference(inPortRef);
56  } catch(Error& e) {
57  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
58  throw;
59  }
60 }
61 
63  try {
64  mNet->addConnectedPortList(inPortList);
65  } catch(Error& e) {
66  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
67  throw;
68  }
69 }
70 
72  throw (Error) {
73  try {
74  mNet->removeConnectedPortList(inPortList);
75  } catch(Error& e) {
76  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
77  throw;
78  }
79 }
80 
81 } //namespace generic
82 } //namespace torc
void connectPortListToNet(const PortListSharedPtr &inPortList)
void disconnectPortFromNet(const PortSharedPtr &inPort)
void connectPortRefToNet(const PortReferenceSharedPtr &inPort)
void connectPortToNet(const PortSharedPtr &inPort)
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< PortReference > PortReferenceSharedPtr
boost::shared_ptr< PortList > PortListSharedPtr
void disconnectPortRefFromNet(const PortReferenceSharedPtr &inPort)
boost::shared_ptr< Port > PortSharedPtr
void disconnectPortListFromNet(const PortListSharedPtr &inPortList)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73