CTR Pia  4.11.3
Game Communication Engine
transport_Api.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: transport_Api.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/transport/transport_definitions.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace transport
25 {
26 
27 
28 /*!
29 @brief Returns whether the <tt>transport</tt> module is initialized.
30 
31 @details This function is thread-safe.
32 
33 @return Returns <tt>true</tt> if initialized, and <tt>false</tt> otherwise.
34 @see Initialize, Finalize
35 */
36 bool IsInitialized(void);
37 
38 
39 /*!
40 @brief Initializes the <tt>transport</tt> module.
41 
42 @return Returns a <tt>Result</tt> value indicating success if initialization succeeds. Your application's implementation must ensure that this function does not return any errors.
43 @retval ResultAlreadyInitialized Specifies that the module is already initialized. Programming error. Fix your program so that this error is not returned.
44 @see IsInitialized, Finalize
45 */
46 nn::Result Initialize(void);
47 
48 
49 /*!
50 @brief Initializes the <tt>transport</tt> module.
51 This function does nothing and returns if it is called before the <tt>Initialize</tt> function has been called.
52 
53 @see IsInitialized, Initialize
54 
55 */
56 void Finalize(void);
57 
58 
59 /*!
60 @brief Declares the start of setup.
61 
62 @details Call this function before creating a singleton of the <tt>transport</tt> module.
63 Always call this function and <tt>@ref EndSetup</tt> even if your application does not create any singletons of the <tt>transport</tt> module.
64 
65 @return Returns a <tt>Result</tt> value indicating success if called at the right time. You must make sure that the implementation of this function in your application does not return any errors.
66 @retval ResultNotInitialized Indicates that the <tt>transport::Initialize</tt> function has not been called. Programming error. Fix your program so that this error is not returned.
67 @retval ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
68 @see EndSetup
69 
70 */
71 nn::Result BeginSetup(void);
72 
73 
74 /*!
75 @brief Declares the end of setup.
76 
77 @details Call this function after creation of a singleton of the <tt>transport</tt> module has finished.
78 Calling this function configures memory to be used by the <tt>transport</tt> module singleton and optimizes memory management within the library.
79 Always call <tt>@ref BeginSetup</tt> and this function even if your application does not create any singletons of the <tt>transport</tt> module.
80 
81 @return Returns a <tt>Result</tt> value indicating success if called at the right time. You must make sure that the implementation of this function in your application does not return any errors.
82 @retval ResultNotInitialized Indicates that the <tt>transport::Initialize</tt> function has not been called. Programming error. Fix your program so that this error is not returned.
83 @retval ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
84 @see BeginSetup
85 
86 
87 */
88 nn::Result EndSetup(void);
89 
90 
91 /*!
92 @cond PRIVATE
93 @brief Returns whether an application is executing code between calls to the <tt>BeginSetup</tt> and <tt>EndSetup</tt> functions.
94 
95 @details This function is thread-safe.
96 */
97 bool IsInSetupMode(void);
98 //! @endcond
99 }
100 }
101 } // end of namespace nn::pia::transport
nn::Result BeginSetup(void)
Declares the start of setup.
Definition: assert.h:115
nn::Result EndSetup(void)
Declares the end of setup.
void Finalize(void)
Initializes the transport module. This function does nothing and returns if it is called before the I...
bool IsInitialized(void)
Returns whether the transport module is initialized.
nn::Result Initialize(void)
Initializes the transport module.