SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MockModuleState.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_MODULE_STATE_H
30 #define MOCK_MODULE_STATE_H
31 
33 #include <gmock/gmock.h>
34 
35 namespace SCIRun {
36  namespace Dataflow {
37  namespace Networks {
38  namespace Mocks
39  {
41  {
42  public:
44  MOCK_CONST_METHOD1(getValue, const Value(const Name&));
46  MOCK_CONST_METHOD1(containsKey, bool(const Name&));
49  MOCK_METHOD3(setTransientValue, void(const std::string&, const TransientValue&, bool));
50  MOCK_METHOD1(connect_state_changed, boost::signals2::connection(state_changed_sig_t::slot_function_type));
52  };
53 
54  typedef boost::shared_ptr<MockModuleState> MockModuleStatePtr;
55 
57  {
58  public:
59  virtual ModuleStateInterface* make_state(const std::string& name) const
60  {
61  return new ::testing::NiceMock<MockModuleState>;
62  }
63  };
64  }
65  }
66  }
67 }
68 
69 #endif
virtual ModuleStateInterface * make_state(const std::string &name) const
Definition: MockModuleState.h:59
Definition: AlgorithmBase.h:52
boost::shared_ptr< MockModuleState > MockModuleStatePtr
Definition: MockModuleState.h:54
virtual bool containsKey(const Name &name) const =0
MOCK_METHOD2(setValue, void(const Name &, const SCIRun::Core::Algorithms::AlgorithmParameter::Value &))
boost::variant< int, double, std::string, bool, AlgoOption, std::vector< Variable > > Value
Definition: AlgorithmBase.h:99
virtual void setTransientValue(const std::string &name, const TransientValue &value, bool fireSignal)=0
boost::shared_ptr< ModuleStateInterface > ModuleStateHandle
Definition: NetworkFwd.h:75
virtual const Value getValue(const Name &name) const =0
SCIRun::Core::Algorithms::AlgorithmParameter Value
Definition: ModuleStateInterface.h:55
virtual TransientValueOption getTransientValue(const std::string &name) const =0
virtual boost::signals2::connection connect_state_changed(state_changed_sig_t::slot_function_type subscriber)=0
virtual void setValue(const Name &name, const SCIRun::Core::Algorithms::AlgorithmParameter::Value &value)=0
const char * name[]
Definition: BoostGraphExampleTests.cc:87
boost::any TransientValue
Definition: ModuleStateInterface.h:65
std::vector< SCIRun::Core::Algorithms::AlgorithmParameterName > Keys
Definition: ModuleStateInterface.h:53
Definition: ModuleStateInterface.h:76
MOCK_METHOD0(fireTransientStateChangeSignal, void())
Definition: ModuleStateInterface.h:48
MOCK_METHOD1(connect_state_changed, boost::signals2::connection(state_changed_sig_t::slot_function_type))
MOCK_METHOD3(setTransientValue, void(const std::string &, const TransientValue &, bool))
virtual ModuleStateHandle clone() const =0
boost::optional< TransientValue > TransientValueOption
Definition: ModuleStateInterface.h:66
MOCK_CONST_METHOD1(getValue, const Value(const Name &))