SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MockPorts.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2012 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9  License for the specific language governing rights and limitations under
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 #ifndef MOCK_PORTS_H
30 #define MOCK_PORTS_H
31 
34 #include <gmock/gmock.h>
35 
36 namespace SCIRun {
37  namespace Dataflow {
38  namespace Networks {
39  namespace Mocks {
40 
42  {
43  public:
45  MOCK_CONST_METHOD0(get_typename, std::string());
46  MOCK_CONST_METHOD0(get_portname, std::string());
47  MOCK_CONST_METHOD0(isInput, bool());
50  MOCK_CONST_METHOD0(getIndex, size_t());
52  };
53 
54  typedef boost::shared_ptr<MockPortDescription> MockPortDescriptionPtr;
55 
57  {
58  public:
62  MOCK_CONST_METHOD1(connection, const Connection*(size_t));
63  MOCK_CONST_METHOD0(get_typename, std::string());
64  MOCK_CONST_METHOD0(get_portname, std::string());
67  MOCK_CONST_METHOD0(isInput, bool());
70  MOCK_CONST_METHOD0(getIndex, size_t());
74  MOCK_METHOD1(setIndex, void(size_t));
75  MOCK_METHOD1(connectDataOnPortHasChanged, boost::signals2::connection(const DataOnPortHasChangedSignalType::slot_type&));
76  };
77 
78  typedef boost::shared_ptr<MockInputPort> MockInputPortPtr;
79 
81  {
82  public:
86  MOCK_CONST_METHOD1(connection, const Connection*(size_t));
87  MOCK_CONST_METHOD0(get_typename, std::string());
88  MOCK_CONST_METHOD0(get_portname, std::string());
90  MOCK_CONST_METHOD0(isInput, bool());
93  MOCK_CONST_METHOD0(getIndex, size_t());
95  MOCK_METHOD1(setIndex, void(size_t));
96  };
97 
98  typedef boost::shared_ptr<MockOutputPort> MockOutputPortPtr;
99 
101  {
102  public:
103  MOCK_CONST_METHOD0(hasData, bool());
105  MOCK_METHOD1(setHasData, void(bool));
106  MOCK_METHOD0(waitForData, void());
109  MOCK_METHOD1(connectDataHasChanged, boost::signals2::connection(const DataHasChangedSignalType::slot_type&));
110  };
111 
112  typedef boost::shared_ptr<MockDatatypeSink> MockDatatypeSinkPtr;
113 
115  {
116  public:
118  };
119 
120  typedef boost::shared_ptr<MockDatatypeSource> MockDatatypeSourcePtr;
121  }
122  }
123  }
124 }
125 
126 #endif
virtual void attach(Connection *conn)=0
boost::shared_ptr< MockInputPort > MockInputPortPtr
Definition: MockPorts.h:78
virtual Core::Datatypes::DatatypeHandleOption receive()=0
boost::optional< DatatypeHandle > DatatypeHandleOption
Definition: DatatypeFwd.h:47
boost::shared_ptr< MockDatatypeSource > MockDatatypeSourcePtr
Definition: MockPorts.h:120
Definition: DataflowInterfaces.h:52
virtual void detach(Connection *conn)=0
virtual boost::signals2::connection connectDataOnPortHasChanged(const DataOnPortHasChangedSignalType::slot_type &subscriber)=0
virtual void setIndex(size_t index)=0
virtual void send(DatatypeSinkInterfaceHandle receiver, Core::Datatypes::DatatypeHandle data)=0
virtual boost::signals2::connection connectDataHasChanged(const DataHasChangedSignalType::slot_type &subscriber)=0
virtual DatatypeSinkInterfaceHandle sink() const =0
MOCK_CONST_METHOD1(connection, const Connection *(size_t))
MOCK_METHOD2(send, void(DatatypeSinkInterfaceHandle, Core::Datatypes::DatatypeHandle))
MOCK_CONST_METHOD1(connection, const Connection *(size_t))
virtual DatatypeSinkInterface * clone() const =0
virtual InputPortInterface * clone() const =0
virtual const Connection * connection(size_t) const =0
Definition: ModuleDescription.h:77
Definition: DataflowInterfaces.h:43
virtual void sendData(Core::Datatypes::DatatypeHandle data)=0
boost::shared_ptr< DatatypeSinkInterface > DatatypeSinkInterfaceHandle
Definition: NetworkFwd.h:82
boost::shared_ptr< MockDatatypeSink > MockDatatypeSinkPtr
Definition: MockPorts.h:112
boost::shared_ptr< MockPortDescription > MockPortDescriptionPtr
Definition: MockPorts.h:54
virtual void setHasData(bool dataPresent)=0
Definition: ModuleDescription.h:45
boost::shared_ptr< Datatype > DatatypeHandle
Definition: DatatypeFwd.h:44
boost::shared_ptr< MockOutputPort > MockOutputPortPtr
Definition: MockPorts.h:98
virtual Core::Datatypes::DatatypeHandleOption getData() const =0
Definition: Connection.h:42