-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSlot.hpp
34 lines (29 loc) · 838 Bytes
/
Slot.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright Kabuki Starship� <kabukistarship.com>.
#pragma once
#ifndef SCRIPT2_SLOT_INLINE_CODE
#define SCRIPT2_SLOT_INLINE_CODE
#include "Slot.h"
#if SEAM >= SCRIPT2_CRABS
namespace _ {
enum {
SlotBytesMin = 32 //< Minimum size of a slot in bytes.
};
/* Calculates the used ring socket space.
@param Start The origin of the data.
@param Stop The stop of the data.
@param Size The size of the socket. */
template<typename T>
inline T TSlotLength(IUA* origin, IUA* stop, ISW size) {
return T(stop - origin);
}
/* Calculates the space left in the given ring socket.
@param Start The origin of the data.
@param Stop The stop of the data.
@param Size The size of the socket. */
template<typename T>
inline T TSlotSpace(IUA* start, IUA* stop, ISW size) {
return T(size - (stop - start));
}
} //< namespace _
#endif
#endif