프로젝트

일반

사용자정보

Makepnc5( Python 코드 생성 ) » nerv_typedef.hh

이용우, 2020/07/27 04:36

 
1
#pragma once
2

    
3
#include "nerv_define.hh"
4
#include "nerv_pre_define.hh"
5
#include <stddef.h>
6
#include <stdint.h>
7

    
8
namespace Nerv35 {
9

    
10
typedef ::int8_t   int8_t;   // size : 1
11
typedef ::int16_t  int16_t;  // size : 2
12
typedef ::int32_t  int32_t;  // size : 4
13
typedef ::int64_t  int64_t;  // size : 8
14
typedef ::uint8_t  uint8_t;  // size : 1
15
typedef ::uint16_t uint16_t; // size : 2
16
typedef ::uint32_t uint32_t; // size : 4
17
typedef ::uint64_t uint64_t; // size : 8
18
typedef uint8_t   enum8_t;
19
typedef uint16_t  enum16_t;
20
typedef uint32_t  enum32_t;
21
typedef uint64_t  enum64_t;
22
typedef ::size_t   size_t;   /* 데이터 크기    */
23

    
24
#if defined _MSC_VER || defined __GNUC__
25
typedef float                   float32_t;
26
typedef double                  float64_t;
27
#endif
28

    
29
#if defined _MSC_VER
30
typedef unsigned long ip_t; /* IP add_ress     */
31
#else
32
typedef uint32_t ip_t; /* IP add_ress     */
33
#endif
34

    
35
typedef uint16_t               msg_code_t; /* 메시지 코드    */
36
typedef uint16_t               port_t;     /* Domain add_ress */
37
typedef uint32_t               pksize_t;   /* 데이터 크기    */
38
typedef uint64_t               nerv_clock_t;
39
typedef struct_return_promise* return_promise_t;
40

    
41
typedef struct nerv_addr_t {
42
	ip_t   ip;
43
	port_t port;
44
	nerv_addr_t() : ip(0U), port(0U) {}
45
	nerv_addr_t(ip_t _ip, port_t _port) : ip(_ip), port(_port) {}
46
} struct_nerv_addr;
47

    
48
inline bool operator<(nerv_addr_t _left, nerv_addr_t _right)
49
{
50
	return (_left.port < _right.port ||
51
	        (_left.port == _right.port && _left.ip < _right.ip));
52
}
53

    
54
enum class Sync_model : uint8_t { on_post = 0x00U, on_timer = 0x01U };
55

    
56
/* 가변 필드용 제어 구조체 */
57
typedef struct struct_variable_array_field_dctrl
58
{
59
	pksize_t    dindex;     // byte 단위의 저장 인덱스 위치
60
	pksize_t    dsize;      // byte 단위의 size 저장
61
} variable_array_field_dctrl_t;
62

    
63

    
64
} // namespace Nerv35
(3-3/3)