CTR Pia  4.11.3
Game Communication Engine
clone_SerializePolicyDefinition.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: clone_SerializePolicyDefinition.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/clone/clone_definitions.h>
18 #include <pia/clone/clone_StraightSerializePolicy.h>
19 #include <pia/clone/clone_ReverseSerializePolicy.h>
20 
21 namespace nn
22 {
23 namespace pia
24 {
25 namespace clone
26 {
27 
28 
29 /*!
30 @brief Represents a serialization algorithm based on network byte order.
31 @details Use this class when you want to communicate with the network byte order regardless of the hardware byte order.
32 @tparam Type Specifies the type of the data to be serialized.
33 @date 2013-07-18 Initial version.
34 */
35 template <typename Type>
37 #if NN_PIA_ENDIAN_BIG
38  : public StraightSerializePolicy<Type>
39 #else
40  : public ReverseSerializePolicy<Type>
41 #endif
42 {
43 };
44 
45 
46 /*!
47 @brief Represents a serialization algorithm based on host byte order.
48 @details This algorithm is fast because byte order conversion is not needed, but you cannot communicate between hardware with different host byte orders.
49 @tparam Type Specifies the type of the data to be serialized.
50 @date 2013-07-18 Initial version.
51 */
52 template <typename Type>
54 {
55 };
56 
57 
58 /*!
59 @brief Represents a serialization algorithm based on little endian.
60 @details Use this class when you want to communicate with little endian regardless of the hardware byte order.
61 @tparam Type Specifies the type of the data to be serialized.
62 @date 2013-07-18 Initial version.
63 */
64 template <typename Type>
66 #if NN_PIA_ENDIAN_BIG
67  : public ReverseSerializePolicy<Type>
68 #else
69  : public StraightSerializePolicy<Type>
70 #endif
71 {
72 };
73 }
74 }
75 } // end of namespace nn::pia::clone
Definition: assert.h:115
Represents a serialization algorithm based on host byte order.
Definition: clone_SerializePolicyDefinition.h:53
Represents a serialization algorithm based on little endian.
Definition: clone_SerializePolicyDefinition.h:65
Serializes the source data structure without changes.
Definition: clone_StraightSerializePolicy.h:36
Represents a serialization algorithm based on network byte order.
Definition: clone_SerializePolicyDefinition.h:36
Reverses the byte order of the source data and then serializes it.
Definition: clone_ReverseSerializePolicy.h:58