SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConnectionId.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/ConnectionId.h
29 
30 #ifndef DATAFLOW_NETWORK_CONNECTIONID_H
31 #define DATAFLOW_NETWORK_CONNECTIONID_H
32 
34 #include <Dataflow/Network/share.h>
35 
36 namespace SCIRun {
37 namespace Dataflow {
38 namespace Networks {
39 
41  {
44  : moduleId_(id), portId_(p) {}
47  };
48 
50  {
53  : moduleId_(id), portId_(p) {}
56  };
57 
59  {
62  : out_(out), in_(in) {}
65  };
66 
68  {
69  ConnectionId(const char* s) : id_(s) {}
70  ConnectionId(const std::string& s) : id_(s) {}
71  static ConnectionId create(const ConnectionDescription& desc);
72  ConnectionDescription describe() const;
73 
74  std::string id_;
75  operator std::string() const { return id_; }
76  };
77 
78  SCISHARE bool operator==(const ConnectionId& lhs, const ConnectionId& rhs);
79  SCISHARE bool operator!=(const ConnectionId& lhs, const ConnectionId& rhs);
80  SCISHARE bool operator==(const OutgoingConnectionDescription& lhs, const OutgoingConnectionDescription& rhs);
81  SCISHARE bool operator!=(const OutgoingConnectionDescription& lhs, const OutgoingConnectionDescription& rhs);
82  SCISHARE bool operator==(const IncomingConnectionDescription& lhs, const IncomingConnectionDescription& rhs);
83  SCISHARE bool operator!=(const IncomingConnectionDescription& lhs, const IncomingConnectionDescription& rhs);
84  SCISHARE bool operator==(const ConnectionDescription& lhs, const ConnectionDescription& rhs);
85  SCISHARE bool operator!=(const ConnectionDescription& lhs, const ConnectionDescription& rhs);
86 
88  {
89  bool operator()(const ConnectionId& lhs, const ConnectionId& rhs) const
90  {
91  return lhs.id_ < rhs.id_;
92  }
93  };
94 
95 }}}
96 
97 
98 #endif
ConnectionDescription(const OutgoingConnectionDescription &out, const IncomingConnectionDescription &in)
Definition: ConnectionId.h:61
IncomingConnectionDescription(const ModuleId &id, const PortId &p)
Definition: ConnectionId.h:52
Definition: ConnectionId.h:67
ModuleId moduleId_
Definition: ConnectionId.h:45
IncomingConnectionDescription()
Definition: ConnectionId.h:51
ConnectionId(const char *s)
Definition: ConnectionId.h:69
bool operator()(const ConnectionId &lhs, const ConnectionId &rhs) const
Definition: ConnectionId.h:89
#define SCISHARE
Definition: share.h:39
SCISHARE bool operator==(const ConnectionId &lhs, const ConnectionId &rhs)
Definition: ConnectionId.cc:37
Definition: ModuleDescription.h:77
OutgoingConnectionDescription out_
Definition: ConnectionId.h:63
ConnectionDescription()
Definition: ConnectionId.h:60
SCISHARE bool operator!=(const ConnectionId &lhs, const ConnectionId &rhs)
Definition: ConnectionId.cc:42
OutgoingConnectionDescription()
Definition: ConnectionId.h:42
IncomingConnectionDescription in_
Definition: ConnectionId.h:64
ConnectionId(const std::string &s)
Definition: ConnectionId.h:70
OutgoingConnectionDescription(const ModuleId &id, const PortId &p)
Definition: ConnectionId.h:43
Definition: ModuleDescription.h:45
ModuleId moduleId_
Definition: ConnectionId.h:54
std::string id_
Definition: ConnectionId.h:74