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