torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VectorPortBit.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 #ifndef TORC_GENERIC_VECTORPORTBIT_HPP
17 #define TORC_GENERIC_VECTORPORTBIT_HPP
18 
20 
21 #ifdef GENOM_SERIALIZATION
22 #include <boost/serialization/access.hpp>
23 #endif //GENOM_SERIALIZATION
24 #include "torc/generic/Port.hpp"
26 #include "torc/generic/Error.hpp"
29 
30 namespace torc { namespace generic { class BaseVisitor; } }
31 
32 
33 namespace torc {
34 namespace generic {
35 
36 /**
37  * @brief Represents a bit of a port.
38  *
39  * The VectorPortBit class represents a bit of an array port. Such objects cannot be created in
40  * EDIF. They are automatically created when a particular member of an array is accessed using the
41  * (member ...) syntax.
42  */
43 class VectorPortBit : public Port, public VectorBit<Port> {
44 
45 #ifdef GENOM_SERIALIZATION
46  friend class boost::serialization::access;
47 #endif //GENOM_SERIALIZATION
48 public:
51 
52  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
53 
54  virtual Connection connect(const NetSharedPtr& inNet) throw (Error);
55 
57 
58  virtual void disconnect(const Connection& inConnection) throw (Error);
59 
60  virtual void getConnectedNets(std::vector<NetSharedPtr>& outNets,
61  bool inSkipChildConnections = false) const throw (Error);
62 
63  VectorPortBit();
64 
65  ~VectorPortBit() throw ();
66 
67 private:
68 #ifdef GENOM_SERIALIZATION
69  template <class Archive> void
70  serialize(Archive& ar, unsigned int);
71 #endif //GENOM_SERIALIZATION
72 };
73 
74 } // namespace generic
75 } // namespace torc
76 
77 #endif // TORC_GENERIC_VECTORPORTBIT_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
virtual void getConnectedNets(std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const
Represents a bit of a port.
std::list< NetSharedPtr >::iterator Connection
Definition: Connectable.hpp:52
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
VisitorType< VectorPortBit > Visitor
boost::shared_ptr< Net > NetSharedPtr
FactoryType< VectorPortBit > Factory
A base class for Visitor.
Definition: VisitorType.hpp:31
virtual void accept(BaseVisitor &inoutVisitor)
Interface for an EDIF port object.
virtual Connection connect(const NetSharedPtr &inNet)
A placeholder for a factory method.
Definition: FactoryType.hpp:35
Represents a single element of a vector composition.
Definition: VectorBit.hpp:41