torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VectorNetBit.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_VECTORNETBIT_HPP
17 #define TORC_GENERIC_VECTORNETBIT_HPP
18 
20 
21 //BOOST
22 #ifdef GENOM_SERIALIZATION
23 #include <boost/serialization/access.hpp>
24 #endif //GENOM_SERIALIZATION
26 #include "torc/generic/Net.hpp"
29 #include "torc/generic/Error.hpp"
30 
31 namespace torc { namespace generic { class BaseVisitor; } }
32 
33 namespace torc {
34 namespace generic {
35 
36 /**
37  * @brief Represents a bit of a net array.
38  *
39  * The VectorNetBit class represents a bit of an array net. Such objects cannot be created in EDIF.
40  * They are automatically created when a particular member of an array is accessed using the
41  * (member ...) syntax.
42  */
43 class VectorNetBit : public Net, public VectorBit<Net> {
44 #ifdef GENOM_SERIALIZATION
45  friend class boost::serialization::access;
46 #endif //GENOM_SERIALIZATION
47 public:
49 
51 
52  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
53 
54  /**
55  * @exception Error Pointer to the Net object does not exists
56  * <ul>
57  * <li>
58  * Id : eMessageIdErrorPointerToItemDoesNotExist
59  * </li>
60  * <li> Context Data
61  * <ul>
62  * <li>Pointe to Net object - <i>Net</i></li>
63  * </ul>
64  * </li>
65  * </ul>
66  *
67  * @exception Error Net size does not match with vector net bit size
68  * <ul>
69  * <li>
70  * Id : eMessageIdErrorItemSizeMismatch
71  * </li>
72  * <li> Context Data
73  * <ul>
74  * <li>Net Size - <i>SizeType</i></li>
75  * <li>VectorNetBit Size - <i>SizeType</i></li>
76  * </ul>
77  * </li>
78  * </ul>
79  *
80  */
81 
82  virtual Connection connect(const NetSharedPtr& inNet) throw (Error);
83 
85 
86  virtual void disconnect(const Connection& inConnection) throw (Error);
87 
88  virtual void getConnectedNets(std::vector<NetSharedPtr>& outNets,
89  bool inSkipChildConnections = false) const throw (Error);
90 
91  virtual void getConnectedPorts(std::vector<PortSharedPtr>& outPorts,
92  bool inSkipChildConnections = false) const;
93 
94  virtual void getConnectedPortRefs(std::vector<PortReferenceSharedPtr>& outPortRefs,
95  bool inSkipChildConnections = false) const;
96 
97  VectorNetBit();
98 
99  virtual ~VectorNetBit() throw ();
100 
101 private:
102 #ifdef GENOM_SERIALIZATION
103  template <class Archive> void serialize(Archive& ar, unsigned int);
104 #endif //GENOM_SERIALIZATION
105 };
106 
107 } // namespace generic
108 } // namespace torc
109 
110 #endif // TORC_GENERIC_VECTORNETBIT_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
Represents a bit of a net array.
virtual void getConnectedPortRefs(std::vector< PortReferenceSharedPtr > &outPortRefs, bool inSkipChildConnections=false) const
VisitorType< VectorNetBit > Visitor
Represents an EDIF Net.
Definition: generic/Net.hpp:58
std::list< NetSharedPtr >::iterator Connection
Definition: Connectable.hpp:52
virtual void getConnectedPorts(std::vector< PortSharedPtr > &outPorts, bool inSkipChildConnections=false) const
FactoryType< VectorNetBit > Factory
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Net > NetSharedPtr
A base class for Visitor.
Definition: VisitorType.hpp:31
boost::shared_ptr< PortReference > PortReferenceSharedPtr
virtual void disconnect()
virtual void getConnectedNets(std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const
boost::shared_ptr< Port > PortSharedPtr
virtual void accept(BaseVisitor &inoutVisitor)
A placeholder for a factory method.
Definition: FactoryType.hpp:35
virtual Connection connect(const NetSharedPtr &inNet)
Represents a single element of a vector composition.
Definition: VectorBit.hpp:41