SST  11.1.0
StructuralSimulationToolkit
linkPair.h
1 // Copyright 2009-2021 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-2021, 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/link.h"
16 #include "sst/core/sst_types.h"
17 
18 namespace SST {
19 
20 /**
21  * Defines a pair of links (to define a connected link)
22  */
23 class LinkPair
24 {
25 public:
26  /** Create a new LinkPair with specified ID */
27 #if !SST_BUILDING_CORE
28  LinkPair(LinkId_t id) __attribute__((
29  deprecated("LinkPair class was not intended to be used outside of SST Core and will be removed in SST 12."))) :
30 #else
31  LinkPair(LinkId_t id) :
32 #endif
33  left(new Link(id)),
34  right(new Link(id))
35  {
36  my_id = id;
37 
38  left->pair_link = right;
39  right->pair_link = left;
40  }
41 
42 #if !SST_BUILDING_CORE
43  virtual ~LinkPair() __attribute__((
44  deprecated("LinkPair class was not intended to be used outside of SST Core and will be removed in SST 12.")))
45  {}
46 #else
47  virtual ~LinkPair() {}
48 #endif
49 
50  /** return the ID of the LinkPair */
51 #if !SST_BUILDING_CORE
52  LinkId_t getId() __attribute__((
53  deprecated("LinkPair class was not intended to be used outside of SST Core and will be removed in SST 12.")))
54  {
55 #else
56  LinkId_t getId()
57  {
58 #endif
59  return my_id;
60  }
61 
62  /** Return the Left Link */
63 #if !SST_BUILDING_CORE
64  inline Link* getLeft() __attribute__((
65  deprecated("LinkPair class was not intended to be used outside of SST Core and will be removed in SST 12.")))
66  {
67  return left;
68  }
69 #else
70  inline Link* getLeft() { return left; }
71 #endif
72  /** Return the Right Link */
73 #if !SST_BUILDING_CORE
74  inline Link* getRight() __attribute__((
75  deprecated("LinkPair class was not intended to be used outside of SST Core and will be removed in SST 12.")))
76  {
77  return right;
78  }
79 #else
80  inline Link* getRight() { return right; }
81 #endif
82 
83 private:
84  Link* left;
85  Link* right;
86 
87  LinkId_t my_id;
88 };
89 
90 } // namespace SST
91 
92 #endif // SST_CORE_LINKPAIR_H
LinkId_t getId()
return the ID of the LinkPair
Definition: linkPair.h:52
Link * getLeft()
Return the Left Link.
Definition: linkPair.h:64
Defines a pair of links (to define a connected link)
Definition: linkPair.h:23
Link * getRight()
Return the Right Link.
Definition: linkPair.h:74
LinkPair(LinkId_t id)
Create a new LinkPair with specified ID.
Definition: linkPair.h:28