SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleMapModuleState.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 /// @todo Documentation Dataflow/State/SimpleModuleState.h
29 #ifndef DATAFLOW_STATE_SIMPLEMAPMODULESTATE_H
30 #define DATAFLOW_STATE_SIMPLEMAPMODULESTATE_H
31 
32 #include <map>
34 #include <Dataflow/State/share.h>
35 
36 namespace SCIRun {
37 namespace Dataflow {
38 namespace State {
39 
41  {
42  public:
45  SimpleMapModuleState& operator=(const SimpleMapModuleState& rhs);
46  virtual const Value getValue(const Name& name) const;
47  virtual void setValue(const Name& name, const SCIRun::Core::Algorithms::AlgorithmParameter::Value& value);
48  virtual bool containsKey(const Name& name) const;
49  virtual Keys getKeys() const;
51  virtual boost::signals2::connection connect_state_changed(state_changed_sig_t::slot_function_type subscriber);
52 
53  virtual TransientValueOption getTransientValue(const std::string& name) const;
54  virtual void setTransientValue(const std::string& name, const TransientValue& value, bool fireSignal);
55  virtual void fireTransientStateChangeSignal();
56 
57  protected:
58  typedef std::map<Name, Value> StateMap;
60  typedef std::map<std::string, TransientValue> TransientStateMap;
63  };
64 
66  {
67  public:
68  virtual SCIRun::Dataflow::Networks::ModuleStateInterface* make_state(const std::string& name) const;
69  };
70 
71 }}}
72 
73 #endif
Definition: AlgorithmBase.h:52
StateMap stateMap_
Definition: SimpleMapModuleState.h:59
state_changed_sig_t stateChangedSignal_
Definition: SimpleMapModuleState.h:62
boost::variant< int, double, std::string, bool, AlgoOption, std::vector< Variable > > Value
Definition: AlgorithmBase.h:99
boost::shared_ptr< ModuleStateInterface > ModuleStateHandle
Definition: NetworkFwd.h:75
#define SCISHARE
Definition: share.h:39
Definition: SimpleMapModuleState.h:40
TransientStateMap transientStateMap_
Definition: SimpleMapModuleState.h:61
const char * name[]
Definition: BoostGraphExampleTests.cc:87
std::map< Name, Value > StateMap
Definition: SimpleMapModuleState.h:58
boost::any TransientValue
Definition: ModuleStateInterface.h:65
Definition: SimpleMapModuleState.h:65
boost::signals2::signal< void()> state_changed_sig_t
Definition: ModuleStateInterface.h:71
std::vector< SCIRun::Core::Algorithms::AlgorithmParameterName > Keys
Definition: ModuleStateInterface.h:53
Definition: ModuleStateInterface.h:76
Definition: ModuleStateInterface.h:48
Definition: AlgorithmBase.h:88
std::map< std::string, TransientValue > TransientStateMap
Definition: SimpleMapModuleState.h:60
boost::optional< TransientValue > TransientValueOption
Definition: ModuleStateInterface.h:66