SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Network.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 
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/Network/Network.h
29 
30 
31 #ifndef DATAFLOW_NETWORK_NETWORK_H
32 #define DATAFLOW_NETWORK_NETWORK_H
33 
34 #include <boost/noncopyable.hpp>
39 #include <Dataflow/Network/share.h>
40 
41 namespace SCIRun {
42 namespace Dataflow {
43 namespace Networks {
44 
45  class SCISHARE Network : public NetworkInterface, boost::noncopyable
46  {
47  public:
48  typedef std::map<ConnectionId, ConnectionHandle, OrderedByConnectionId> Connections;
49  typedef std::vector<ModuleHandle> Modules;
50 
52  ~Network();
53 
54  virtual ModuleHandle add_module(const ModuleLookupInfo& info);
55  virtual bool remove_module(const ModuleId& id);
56  virtual size_t nmodules() const;
57  virtual ModuleHandle module(size_t i) const;
58  virtual ExecutableObject* lookupExecutable(const ModuleId& id) const;
59  virtual ModuleHandle lookupModule(const ModuleId& id) const;
60  virtual ConnectionId connect(const ConnectionOutputPort&, const ConnectionInputPort&);
61  virtual bool disconnect(const ConnectionId&);
62  virtual size_t nconnections() const;
63  virtual void disable_connection(const ConnectionId&);
64  virtual ConnectionDescriptionList connections() const;
65  virtual int errorCode() const;
66  virtual void incrementErrorCode(const ModuleId& moduleId);
67  virtual NetworkGlobalSettings& settings();
68  virtual std::string toString() const;
69  virtual void setModuleExecutionState(ModuleInterface::ExecutionState state);
70  virtual void clear();
71  private:
72  ModuleFactoryHandle moduleFactory_;
73  ModuleStateFactoryHandle stateFactory_;
74  Connections connections_;
75  Modules modules_;
76  int errorCode_;
77  NetworkGlobalSettings settings_;
78  };
79 
80 }}}
81 
82 
83 #endif
ExecutionState
Definition: ModuleInterface.h:90
std::vector< ConnectionDescription > ConnectionDescriptionList
Definition: NetworkInterface.h:77
Definition: ConnectionId.h:67
Definition: Network.h:45
Definition: ModuleDescription.h:99
#define SCISHARE
Definition: share.h:39
boost::shared_ptr< ModuleStateInterfaceFactory > ModuleStateFactoryHandle
Definition: NetworkFwd.h:76
boost::shared_ptr< AlgorithmFactory > AlgorithmFactoryHandle
Definition: AlgorithmFwd.h:42
Definition: ExecutableObject.h:45
Definition: ModuleDescription.h:77
boost::shared_ptr< ModuleInterface > ModuleHandle
Definition: NetworkFwd.h:74
Definition: NetworkInterface.h:58
boost::shared_ptr< ModuleFactory > ModuleFactoryHandle
Definition: NetworkFwd.h:81
Definition: NetworkInterface.h:74
std::map< ConnectionId, ConnectionHandle, OrderedByConnectionId > Connections
Definition: Network.h:48
Definition: NetworkInterface.h:66
std::vector< ModuleHandle > Modules
Definition: Network.h:49