Sen API
Sen Libraries
Loading...
Searching...
No Matches
proxy_object.h
Go to the documentation of this file.
1// === proxy_object.h ==================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_CORE_OBJ_DETAIL_PROXY_OBJECT_H
9#define SEN_CORE_OBJ_DETAIL_PROXY_OBJECT_H
10
11// sen
13#include "sen/core/obj/object.h"
14
15// std
16#include <mutex>
17
18namespace sen::kernel::impl
19{
20
21class LocalParticipant;
22class RemoteParticipant;
23
24} // namespace sen::kernel::impl
25
26namespace sen::impl
27{
28
29class RemoteObject;
30
32class SEN_EXPORT ProxyObject: public Object
33{
34 SEN_NOCOPY_NOMOVE(ProxyObject)
35
36public: // special members
37 ProxyObject() = default;
38 ~ProxyObject() override = default;
39
40public:
42 virtual void drainInputs() = 0;
43
45 [[nodiscard]] virtual bool isRemote() const noexcept = 0;
46
48 [[nodiscard]] virtual RemoteObject* asRemoteObject() noexcept = 0;
49
51 [[nodiscard]] virtual const RemoteObject* asRemoteObject() const noexcept = 0;
52
53public: // lock interface to externally/internally lock a proxy object during updates
54 void lock() const { selfMutex_.lock(); }
55
56 void unlock() const { selfMutex_.unlock(); }
57
58private:
59 mutable std::mutex selfMutex_;
60};
61
62} // namespace sen::impl
63
64#endif // SEN_CORE_OBJ_DETAIL_PROXY_OBJECT_H