SST/macro
packet.h
Go to the documentation of this file.
1 #ifndef sstmac_hardware_packet_h
2 #define sstmac_hardware_packet_h
3 
7 
8 namespace sstmac {
9 namespace hw {
10 
11 class packet :
12  public event
13 {
14 
15  public:
16  message*
17  orig() const {
18  return orig_;
19  }
20 
21  virtual std::string
22  to_string() const {
23  return "packet";
24  }
25 
26  bool
27  is_tail() const {
28  return orig_;
29  }
30 
31  int
32  byte_length() const {
33  return num_bytes_;
34  }
35 
36  uint64_t
37  unique_id() const {
38  return unique_id_;
39  }
40 
41  void
44  }
45 
46  double
47  delay_us() const {
48  return cumulative_delay_us_;
49  }
50 
51  virtual void
53 
54  virtual bool
55  is_packet() const {
56  return true;
57  }
58 
59  virtual node_id
60  toaddr() const = 0;
61 
62  virtual node_id
63  fromaddr() const = 0;
64 
65  long
66  byte_offset() const {
67  return byte_offset_;
68  }
69 
70  protected:
71  packet() : orig_(0) {}
72 
73  packet(
74  message* orig,
75  long num_bytes,
76  long byte_offset);
77 
78  protected:
80 
82 
84 
85  uint64_t unique_id_;
86 
88 
89 };
90 
91 
92 }
93 }
94 
95 #endif
96 
double cumulative_delay_us_
Definition: packet.h:87
uint64_t unique_id_
Definition: packet.h:85
A class describing an event.
Definition: sst_message.h:42
long byte_offset() const
Definition: packet.h:66
virtual void serialize_order(serializer &ser)
bool is_tail() const
Definition: packet.h:27
double delay_us() const
Definition: packet.h:47
message * orig() const
Definition: packet.h:17
virtual node_id toaddr() const =0
long byte_offset_
Definition: packet.h:83
virtual node_id fromaddr() const =0
virtual bool is_packet() const
convenience methods
Definition: packet.h:55
message * orig_
Definition: packet.h:79
void add_delay_us(double delay_us)
Definition: packet.h:42
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:33
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
int byte_length() const
Definition: packet.h:32
uint64_t unique_id() const
Definition: packet.h:37
endpoint_id node_id
Definition: node_address.h:20
virtual std::string to_string() const
Definition: packet.h:22