CTR Pia  4.11.3
Game Communication Engine
session_Api.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: session_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/session/session_definitions.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace session
25 {
26 
27 
28 /*!
29 @name Module Initialization and Finalization
30 @{
31 */
32 /*!
33 @brief Initializes the <tt>PiaSession</tt> module.
34 Execute the <tt>nn::pia::common::Initialize</tt> function in advance.
35 
36 @details Memory that the <tt>session</tt> module dynamically allocates and uses is allocated from memory passed by the <tt>@ref nn::pia::common::Initialize</tt> function.
37 
38 @return Returns a <tt>Result</tt> value indicating success if called at the right time. Your application's implementation must ensure that this function does not return any errors.
39 @retval ResultInvalidState Indicates that the <tt>common</tt> module is not initialized. Programming error. Fix your program so that this error is not returned.
40 @retval ResultAlreadyInitialized Indicates that the function has already been executed and initialization has completed. Programming error. Fix your program so that this error is not returned.
41 
42 */
43 nn::Result Initialize();
44 
45 /*!
46 @brief Declares the start of setup.
47 
48 @details Call before executing initialization processing beneath the <tt>session</tt> module. In other words, call before executing the <tt>@ref Session::CreateInstance</tt> function.
49 
50 Because this function does not run correctly if competing with another module's setup processing, perform initialization in the <tt>local</tt> module, and promptly call the <tt>@ref EndSetup</tt> function to complete setup.
51 
52 @return Returns a <tt>Result</tt> value indicating success if called at the right time. Your application's implementation must ensure that this function does not return any errors.
53 @retval ResultNotInitialized Indicates that the <tt>session::Initialize</tt> function has not been called. Programming error. Fix your program so that this error is not returned.
54 @retval ResultInvalidState Indicates that the function was called again during setup. Programming error. Fix your program so that this error is not returned.
55 
56 
57 
58 */
59 nn::Result BeginSetup(void);
60 
61 /// @cond PRIVATE
62 /*!
63 @brief Checks whether setup is currently underway.
64 
65 @details The application should not call this function. It is provided for internal use. <br>
66 
67 @return Returns <tt>true</tt> between calls to the <tt>@ref session::BeginSetup</tt> and <tt>@ref session::EndSetup</tt> functions.
68 */
69 bool IsDuringSetup(void);
70 /// @endcond
71 
72 /*!
73 @brief Declares the end of setup.
74 
75 @details Call after executing initialization processing beneath the <tt>session</tt> module. In other words, call after executing the <tt>@ref Session::CreateInstance</tt> function.
76 
77 Calling this function determines the amount of memory used by singletons and other objects in the <tt>session</tt> module, and optimizes memory management in the module.
78 
79 Because this function does not run correctly if competing with another module's setup processing, perform initialization in the <tt>local</tt> module, and promptly call the <tt>@ref EndSetup</tt> function to complete setup.
80 
81 @return Returns a <tt>Result</tt> value indicating success if called at the right time. Your application's implementation must ensure that this function does not return any errors.
82 
83 @retval ResultNotInitialized Indicates that the <tt>session::Initialize</tt> function has not been called. Programming error. Fix your program so that this error is not returned.
84 @retval ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
85 
86 
87 
88 
89 */
90 nn::Result EndSetup(void);
91 
92 /*!
93 @brief Returns whether the <tt>PiaSession</tt> module is initialized.
94 
95 @return Returns <tt>true</tt> if initialized, and <tt>false</tt> otherwise.
96 */
97 bool IsInitialized(void);
98 
99 /*!
100 @brief Finalizes the <tt>PiaSession</tt> module.
101 Call this function before calling the <tt>@ref nn::pia::common::Finalize</tt> function.
102 
103 @details Processing of all <tt>PiaSession</tt> modules must be finalized before executing this function.
104 Calling this function has no effect if the <tt>@ref nn::pia::session::Initialize</tt> function has not been called.
105 */
106 void Finalize(void);
107 /*!
108 @}
109 */
110 }
111 }
112 } // end of namespace nn::pia::session
bool IsInitialized(void)
Returns whether the PiaSession module is initialized.
nn::Result EndSetup(void)
Declares the end of setup.
Definition: assert.h:115
nn::Result BeginSetup(void)
Declares the start of setup.
nn::Result Initialize()
Initializes the PiaSession module. Execute the nn::pia::common::Initialize function in advance...
void Finalize(void)
Finalizes the PiaSession module. Call this function before calling the nn::pia::common::Finalize func...