SST  8.0.0
StructuralSimulationToolkit
linkPair.h
1 // Copyright 2009-2018 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2018, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_LINKPAIR_H
13 #define SST_CORE_LINKPAIR_H
14 
15 #include <sst/core/sst_types.h>
16 
17 #include <sst/core/link.h>
18 
19 namespace SST {
20 
21 /**
22  * Defines a pair of links (to define a connected link)
23  */
24 class LinkPair {
25 public:
26  /** Create a new LinkPair with specified ID */
27  LinkPair(LinkId_t id) :
28  left(new Link(id)),
29  right(new Link(id))
30  {
31  my_id = id;
32 
33  left->pair_link = right;
34  right->pair_link = left;
35 
36  }
37  virtual ~LinkPair() {}
38 
39  /** return the ID of the LinkPair */
40  LinkId_t getId() {
41  return my_id;
42  }
43 
44  /** Return the Left Link */
45  inline Link* getLeft() {return left;}
46  /** Return the Right Link */
47  inline Link* getRight() {return right;}
48 
49 private:
50 
51  Link* left;
52  Link* right;
53 
54  LinkId_t my_id;
55 
56 };
57 
58 } //namespace SST
59 
60 #endif // SST_CORE_LINKPAIR_H
LinkId_t getId()
return the ID of the LinkPair
Definition: linkPair.h:40
Link * getLeft()
Return the Left Link.
Definition: linkPair.h:45
Defines a pair of links (to define a connected link)
Definition: linkPair.h:24
Link * getRight()
Return the Right Link.
Definition: linkPair.h:47
LinkPair(LinkId_t id)
Create a new LinkPair with specified ID.
Definition: linkPair.h:27