Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / qpg6100 / PlatformManagerImpl.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 /**
19  *    @file
20  *          Provides an implementation of the PlatformManager object for the QPG6100 platform.
21  */
22
23 #pragma once
24
25 #include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.h>
26
27 namespace chip {
28 namespace DeviceLayer {
29
30 /**
31  * Concrete implementation of the PlatformManager singleton object for the platform.
32  */
33 class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>
34 {
35     // Allow the PlatformManager interface class to delegate method calls to
36     // the implementation methods provided by this class.
37     friend PlatformManager;
38
39     // Allow the generic implementation base class to call helper methods on
40     // this class.
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42     friend Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>;
43 #endif
44
45 public:
46     // ===== Platform-specific members that may be accessed directly by the application.
47
48     /* none so far */
49
50 private:
51     // ===== Methods that implement the PlatformManager abstract interface.
52
53     CHIP_ERROR _InitChipStack(void);
54
55     // ===== Members for internal use by the following friends.
56
57     friend PlatformManager & PlatformMgr(void);
58     friend PlatformManagerImpl & PlatformMgrImpl(void);
59     friend class Internal::BLEManagerImpl;
60
61     static PlatformManagerImpl sInstance;
62
63     using Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::PostEventFromISR;
64 };
65
66 /**
67  * Returns the public interface of the PlatformManager singleton object.
68  *
69  * chip applications should use this to access features of the PlatformManager object
70  * that are common to all platforms.
71  */
72 inline PlatformManager & PlatformMgr(void)
73 {
74     return PlatformManagerImpl::sInstance;
75 }
76
77 /**
78  * Returns the platform-specific implementation of the PlatformManager singleton object.
79  *
80  * chip applications can use this to gain access to features of the PlatformManager
81  * that are specific to the platform.
82  */
83 inline PlatformManagerImpl & PlatformMgrImpl(void)
84 {
85     return PlatformManagerImpl::sInstance;
86 }
87
88 } // namespace DeviceLayer
89 } // namespace chip