SST/macro
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
sstmac
hardware
packet_flow
packet_allocator.h
Go to the documentation of this file.
1
#ifndef PACKET_ALLOCATOR_H
2
#define PACKET_ALLOCATOR_H
3
4
#include <
sprockit/factories/factory.h
>
5
#include <
sstmac/hardware/packet_flow/packet_flow_fwd.h
>
6
#include <
sstmac/common/messages/sst_message_fwd.h
>
7
8
namespace
sstmac
{
9
namespace
hw {
10
11
/**
12
* @brief The packet_allocator class
13
* Factory for creating packets.
14
* Default packet allocator adds the bare minimum needed for congestion modeling.
15
* Non-default packet allocators can add extra fields to the packets to track more statistics.
16
*/
17
class
packet_allocator
:
public
sprockit::factory_type
18
{
19
public
:
20
/**
21
* @brief new_packet Allocates a new packet corresponding to a subset
22
* of a flow (message)
23
* @param bytes Number of bytes in the packet
24
* @param byte_offset The offset within the message (flow) the packet begins at
25
* @param msg The message being packetized
26
* @return A packet compatible with packet_flow model
27
*/
28
virtual
packet_flow_payload*
29
new_packet
(
int
bytes,
long
byte_offset,
message
* msg) = 0;
30
31
virtual
~packet_allocator
(){}
32
33
};
34
35
DeclareFactory
(
packet_allocator
)
36
37
}
38
}
39
40
#endif // PACKET_ALLOCATOR_H
sstmac::message
A class describing an event.
Definition:
sst_message.h:42
sstmac::hw::packet_allocator
The packet_allocator class Factory for creating packets.
Definition:
packet_allocator.h:17
sstmac::hw::DeclareFactory
DeclareFactory(node)
sprockit::factory_type
Definition:
factory.h:26
sst_message_fwd.h
sstmac::hw::packet_allocator::new_packet
virtual packet_flow_payload * new_packet(int bytes, long byte_offset, message *msg)=0
new_packet Allocates a new packet corresponding to a subset of a flow (message)
sstmac
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
Definition:
parallel_runtime.h:18
factory.h
sstmac::hw::packet_allocator::~packet_allocator
virtual ~packet_allocator()
Definition:
packet_allocator.h:31
packet_flow_fwd.h
Generated by
1.8.11