CTR Pia  4.11.3
Game Communication Engine
session_SessionSearchCriteria.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: session_SessionSearchCriteria.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 namespace nn
20 {
21 namespace pia
22 {
23 namespace session
24 {
25 /*!
26  @brief The base class for the search criteria used when searching for sessions.
27  @details This class is never instantiated by an application. Use a class that inherits this class.
28  @date 2014-02-27 Initial version.
29 @if CTR_DOC
30  @see nn::pia::local::LocalSessionSearchCriteria
31 @endif
32  @see nn::pia::inet::NexSessionSearchCriteria
33  */
35 {
36 public:
37 /*!
38  @cond PRIVATE
39  @brief Type of search criteria.
40 */
41  enum SearchCriteriaKey
42  {
43  SearchCriteriaKey_Standard = 0, //!< Set standard search criteria such as the number of participants.
44  SearchCriteriaKey_OwnerPrincipalId, //!< Set the principal ID of the owner as the search criterion.
45  SearchCriteriaKey_ParticipantPrincipalId, //!< Set the principal ID of the participant as the search criterion.
46  SearchCriteriaKey_Unused //!< Do not set search criteria.
47  };
48  //! @endcond
49 
50  // The destructor.
51  virtual ~SessionSearchCriteria() {};
52 
53 /*!
54  @brief Specifies the range of search results to get.
55  @details If you specify <tt>0xFFFFFFFF</tt> for the offset only during Internet communication, the search results will be sorted randomly and
56  it will get the specified number of entries.
57  @param[in] offset Starting position of the entries to get as search results from the list of entries that match the search criteria.
58  @param[in] size Number of entries to get as search results from the list of entries that match the search criteria.
59 */
60  virtual void SetResultRange(u32 offset, u32 size)
61  {
62  m_ResultOffset = offset;
63  m_ResultSize = size;
64  }
65 
66 /*!
67  @cond PRIVATE
68 */
69  u32 GetResultRangeOffset() const
70  {
71  return m_ResultOffset;
72  }
73  //! @endcond
74 
75 /*!
76  @cond PRIVATE
77 */
78  u32 GetResultRangeSize() const
79  {
80  return m_ResultSize;
81  }
82  //! @endcond
83 
84 /*!
85  @cond PRIVATE
86  @brief Gets the search condition type.
87 */
88  SearchCriteriaKey GetKeyType() const
89  {
90  return m_KeyType;
91  }
92  //! @endcond
93 
94 /*!
95  @brief Assignment operator.
96  @param[in] r The object to assign.
97  @return See this object.
98 */
100  {
101  m_KeyType = r.m_KeyType;
102  m_ResultOffset = r.m_ResultOffset;
103  m_ResultSize = r.m_ResultSize;
104  return *this;
105  }
106 
107  // Prints information that is useful for debugging.
108  virtual void Trace(u64 flag) const
109  {
110  NN_PIA_DUMMY_PARAM(flag);
111  }
112 
113 protected:
114  // The Search key.
115  SearchCriteriaKey m_KeyType;
116 
117  // Search range.
118  u32 m_ResultOffset;
119  u32 m_ResultSize;
120 
121  // The constructor.
123  : m_KeyType(SearchCriteriaKey_Standard),
124  m_ResultOffset(0),
125  m_ResultSize(20) {};
126 
127 private:
128  // The copy constructor is sealed.
130 };
131 }
132 }
133 } // end of namespace nn::pia::session
Definition: assert.h:115
The base class for the search criteria used when searching for sessions.
Definition: session_SessionSearchCriteria.h:34
SessionSearchCriteria & operator=(const SessionSearchCriteria &r)
Assignment operator.
Definition: session_SessionSearchCriteria.h:99
virtual void SetResultRange(u32 offset, u32 size)
Specifies the range of search results to get.
Definition: session_SessionSearchCriteria.h:60
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40